/* ================================================================== */
/*  Дерево добрых дел — админ-панель                                   */
/* ================================================================== */

:root {
  --ink: #22321f;
  --ink-soft: #4b5a45;
  --ink-faint: #7a8672;
  --cream: #f7f3e7;
  --cream-2: #efe8d5;
  --paper: #fffdf7;
  --green: #2f5d3a;
  --green-deep: #1b3424;
  --green-dark: #13251a;
  --green-soft: #7da55c;
  --green-pale: #e7efda;
  --gold: #c9973f;
  --gold-pale: #f7ecd2;
  --red: #b3483d;
  --red-pale: #f8e4e1;
  --blue: #3c6490;
  --blue-pale: #e6eef7;
  --line: rgba(46, 64, 35, 0.14);
  --line-strong: rgba(46, 64, 35, 0.24);
  --shadow: 0 18px 50px rgba(32, 47, 27, 0.12);
  --shadow-sm: 0 6px 20px rgba(32, 47, 27, 0.09);
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 18px;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  background:
    radial-gradient(1100px 700px at 85% -10%, rgba(157, 190, 120, 0.25), transparent 60%),
    radial-gradient(900px 600px at -10% 100%, rgba(218, 196, 145, 0.22), transparent 55%),
    var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
svg { display: block; }
::selection { background: rgba(125, 165, 92, 0.35); }

/* ── Каркас ─────────────────────────────────────────────────────── */

.admin-shell {
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 26px 20px 20px;
  color: #eaf1e2;
  background:
    radial-gradient(600px 300px at 0% 0%, rgba(148, 189, 108, 0.22), transparent 60%),
    linear-gradient(170deg, #23422e, #162a1d 60%, #101f16);
  overflow: hidden;
}

.sidebar::after {
  content: "";
  position: absolute;
  inset: auto -90px -120px auto;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  border: 1px solid rgba(206, 225, 178, 0.18);
  box-shadow: 0 0 0 34px rgba(206, 225, 178, 0.05), 0 0 0 70px rgba(206, 225, 178, 0.03);
  pointer-events: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  position: relative;
  z-index: 1;
}

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(238, 246, 225, 0.1);
  border: 1px solid rgba(238, 246, 225, 0.2);
  color: #d7e8bf;
  flex-shrink: 0;
}

.brand-mark svg { width: 26px; height: 26px; }

.brand-copy strong {
  display: block;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.08;
}

.brand-copy span {
  display: block;
  margin-top: 3px;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(226, 238, 210, 0.56);
}

.side-user {
  position: relative;
  z-index: 1;
  padding: 13px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.side-user-role {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(226, 238, 210, 0.52);
}

.side-user-name {
  margin-top: 4px;
  font-weight: 700;
  font-size: 14px;
  color: #f1f6ea;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-user-login {
  margin-top: 2px;
  font-size: 12px;
  color: rgba(226, 238, 210, 0.6);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.side-nav {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.side-label {
  padding: 10px 12px 6px;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(226, 238, 210, 0.44);
}

.side-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  border-radius: 11px;
  text-decoration: none;
  color: rgba(235, 243, 226, 0.78);
  font-weight: 600;
  font-size: 13.5px;
  transition: background .16s, color .16s, transform .16s;
}

.side-link svg { width: 19px; height: 19px; opacity: 0.8; flex-shrink: 0; }

.side-link:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.side-link:active { transform: scale(0.985); }

.side-link.active {
  background: linear-gradient(100deg, rgba(152, 190, 112, 0.3), rgba(152, 190, 112, 0.12));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(190, 219, 158, 0.28);
}

.side-link.active svg { opacity: 1; color: #d9edc0; }

.side-count {
  margin-left: auto;
  min-width: 22px;
  padding: 1px 7px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 11px;
  text-align: center;
  color: #eaf1e2;
}

.side-footer {
  margin-top: auto;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.side-footer .side-link { padding: 10px 12px; }

/* ── Основная область ───────────────────────────────────────────── */

.admin-main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 34px;
  background: rgba(247, 243, 231, 0.82);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.topbar-title { min-width: 0; }
.topbar-title h1 {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.topbar-title p { margin-top: 2px; font-size: 12.5px; color: var(--ink-faint); }

.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }

.topbar-org {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 320px;
  padding: 8px 13px;
  border-radius: 999px;
  background: var(--paper);
  border: 1px solid var(--line);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--green);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.topbar-org svg { width: 15px; height: 15px; flex-shrink: 0; }

.admin-content {
  width: 100%;
  max-width: 1440px;
  padding: 30px 34px 70px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ── Флеш-сообщения ─────────────────────────────────────────────── */

.flashes { display: flex; flex-direction: column; gap: 10px; }

.flash {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 15px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 600;
  animation: flash-in .35s ease both;
}

.flash svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.flash.success { background: var(--green-pale); border-color: #c9ddb2; color: #2b562f; }
.flash.error { background: var(--red-pale); border-color: #efc8c2; color: #8e342c; }
.flash.info { background: var(--blue-pale); border-color: #c9d9ea; color: #2f547c; }

@keyframes flash-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Карточки и статистика ──────────────────────────────────────── */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.stat-card {
  position: relative;
  padding: 20px 20px 18px;
  border-radius: var(--radius);
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.stat-card::after {
  content: "";
  position: absolute;
  right: -34px;
  top: -34px;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(125, 165, 92, 0.18), transparent 70%);
}

.stat-label {
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 700;
}

.stat-value {
  margin-top: 8px;
  font-family: var(--serif);
  font-size: 38px;
  font-weight: 700;
  line-height: 1;
  color: var(--green-deep);
}

.stat-note { margin-top: 7px; font-size: 12px; color: var(--ink-faint); }

.stat-card.accent { background: linear-gradient(150deg, #2c5336, #1b3424); border-color: transparent; color: #f2f7eb; }
.stat-card.accent .stat-label { color: rgba(235, 245, 224, 0.6); }
.stat-card.accent .stat-value { color: #fff; }
.stat-card.accent .stat-note { color: rgba(235, 245, 224, 0.65); }
.stat-card.accent::after { background: radial-gradient(circle, rgba(206, 229, 171, 0.22), transparent 70%); }

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--line);
}

.card-title { min-width: 0; }
.card-title h2 {
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 600;
  line-height: 1.15;
}
.card-title p { margin-top: 2px; font-size: 12px; color: var(--ink-faint); }
.card-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.card-body { padding: 20px 24px 24px; }
.card-body.tight { padding: 0; }

.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr);
  gap: 22px;
  align-items: start;
}

/* ── Кнопки и формы ─────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--paper);
  color: var(--ink);
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .1s, background .16s, border-color .16s, box-shadow .16s;
}
.btn svg { width: 16px; height: 16px; }
.btn:active { transform: scale(0.975); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--green); color: #fff; box-shadow: 0 8px 20px rgba(47, 93, 58, 0.22); }
.btn-primary:hover { background: #285030; }
.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--ink-soft); }
.btn-ghost:hover { background: rgba(47, 93, 58, 0.06); border-color: var(--green-soft); color: var(--green); }
.btn-soft { background: var(--green-pale); color: var(--green); }
.btn-soft:hover { background: #dbe8c9; }
.btn-danger { background: var(--red-pale); color: var(--red); }
.btn-danger:hover { background: #f2d2cd; }
.btn-blue { background: var(--blue-pale); color: var(--blue); }
.btn-blue:hover { background: #d8e6f4; }
.btn-sm { padding: 6px 11px; font-size: 12px; border-radius: 8px; }
.btn-icon { padding: 8px; border-radius: 9px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); }

.input, .field input, .field select, .field textarea {
  width: 100%;
  padding: 10px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  font-size: 13.5px;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--green-soft);
  box-shadow: 0 0 0 3px rgba(125, 165, 92, 0.16);
}
.field textarea { resize: vertical; min-height: 110px; }

.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-form .input { flex: 1; min-width: 150px; }
.hint { font-size: 12px; color: var(--ink-faint); }

/* ── Таблицы ────────────────────────────────────────────────────── */

.table-wrap { overflow-x: auto; }

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

table.data th {
  padding: 12px 16px;
  text-align: left;
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  border-bottom: 1px solid var(--line);
  background: rgba(239, 232, 213, 0.35);
  white-space: nowrap;
}

table.data td {
  padding: 13px 16px;
  border-bottom: 1px solid rgba(46, 64, 35, 0.08);
  vertical-align: top;
}

table.data tr:last-child td { border-bottom: none; }
table.data tr:hover td { background: rgba(125, 165, 92, 0.045); }
table.data .num { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--ink-faint); }

.cell-title { font-weight: 700; color: var(--ink); }
.cell-sub { margin-top: 2px; font-size: 11.5px; color: var(--ink-faint); }
.cell-desc { max-width: 520px; color: var(--ink-soft); font-size: 13px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.badge-approved { background: var(--green-pale); color: #2b562f; }
.badge-pending { background: var(--gold-pale); color: #8a6423; }
.badge-rejected { background: var(--red-pale); color: var(--red); }
.badge-org { background: var(--blue-pale); color: var(--blue); }
.badge-muted { background: rgba(46, 64, 35, 0.08); color: var(--ink-faint); }

.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ── Фильтры ────────────────────────────────────────────────────── */

.filters {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(239, 232, 213, 0.25);
}
.filters .field { min-width: 160px; }
.filters .field.grow { flex: 1; min-width: 220px; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-link {
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  color: var(--ink-soft);
}
.chip-link.active { background: var(--green); border-color: var(--green); color: #fff; }

/* ── Организации ────────────────────────────────────────────────── */

.org-list { display: flex; flex-direction: column; }

.org-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  padding: 18px 24px;
  border-bottom: 1px solid rgba(46, 64, 35, 0.09);
}

.org-item:last-child { border-bottom: none; }
.org-main { min-width: 0; }

.org-name {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.2;
}

.org-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 7px;
  font-size: 11.5px;
  color: var(--ink-faint);
}

.org-admin {
  margin-top: 11px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.org-admin-form {
  margin-top: 10px;
  display: none;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.org-admin-form.visible { display: flex; }
.org-admin-form .input { max-width: 190px; }

.org-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.org-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

details.rename-box { margin-top: 8px; }
details.rename-box summary {
  cursor: pointer;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-faint);
  list-style: none;
}
details.rename-box summary::-webkit-details-marker { display: none; }
details.rename-box summary:hover { color: var(--green); }
details.rename-box form { margin-top: 8px; }

/* ── Пустые состояния ───────────────────────────────────────────── */

.empty {
  padding: 42px 20px;
  text-align: center;
  color: var(--ink-faint);
  font-size: 13px;
}
.empty strong { display: block; margin-bottom: 4px; color: var(--ink-soft); font-size: 14px; }

/* ── Вкладки (на случай JS-навигации) ───────────────────────────── */

.tabs { display: flex; gap: 4px; padding: 5px; background: rgba(46, 64, 35, 0.07); border-radius: 12px; }
.tab {
  padding: 7px 14px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
  color: var(--ink-faint);
}
.tab.active { background: var(--paper); color: var(--green); box-shadow: var(--shadow-sm); }

/* ── Страница настроек ──────────────────────────────────────────── */

.settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 22px;
  align-items: start;
}

.settings-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  padding: 14px 18px;
  border-radius: 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 82px;
  z-index: 15;
}

.settings-toolbar .search { flex: 1; min-width: 200px; }
.settings-toolbar .dirty-note { font-size: 12px; color: var(--ink-faint); font-weight: 600; }
.settings-toolbar .dirty-note.dirty { color: var(--gold); }

.settings-sections { display: flex; flex-direction: column; gap: 13px; }

.settings-section {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.settings-section > summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.settings-section > summary::-webkit-details-marker { display: none; }

.settings-section > summary::after {
  content: "";
  width: 9px;
  height: 9px;
  margin-left: auto;
  border-right: 2px solid var(--ink-faint);
  border-bottom: 2px solid var(--ink-faint);
  transform: rotate(45deg);
  transition: transform .18s;
}
.settings-section[open] > summary::after { transform: rotate(-135deg); }

.summary-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--green-pale);
  color: var(--green);
  flex-shrink: 0;
}
.summary-icon svg { width: 18px; height: 18px; }

.summary-copy strong { display: block; font-size: 14px; font-weight: 800; }
.summary-copy span { display: block; margin-top: 1px; font-size: 11.5px; color: var(--ink-faint); }

.settings-list { padding: 0 20px 8px; }

.setting {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) 128px minmax(140px, 1.1fr);
  gap: 14px;
  align-items: center;
  padding: 11px 0;
  border-top: 1px solid rgba(46, 64, 35, 0.08);
}

.setting-label { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.setting[hidden] { display: none; }
.settings-section[hidden] { display: none; }
.setting output {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px;
  color: var(--green);
  font-weight: 700;
}

.setting input[type="range"] {
  width: 100%;
  accent-color: var(--green);
  cursor: pointer;
}

.setting select,
.setting input[type="color"] {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  font-size: 12.5px;
}
.setting input[type="color"] { height: 34px; padding: 2px; cursor: pointer; }

.setting input[type="checkbox"] {
  width: 19px;
  height: 19px;
  accent-color: var(--green);
  cursor: pointer;
  justify-self: start;
}

.setting .setting-value-col { display: flex; align-items: center; gap: 10px; }
.setting .setting-value-col output { min-width: 42px; text-align: right; }
.setting .setting-value-col input[type="range"] { flex: 1; }

.settings-side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 82px; }

.preview-card {
  padding: 20px;
  border-radius: 18px;
  color: #edf5e4;
  background:
    radial-gradient(240px 160px at 80% 0%, rgba(188, 220, 151, 0.35), transparent 70%),
    linear-gradient(155deg, #2f5d3a, #18301f);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}
.preview-card::after {
  content: "";
  position: absolute;
  right: -30px;
  bottom: -40px;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  border: 1px solid rgba(226, 240, 207, 0.18);
  box-shadow: 0 0 0 28px rgba(226, 240, 207, 0.05);
}
.preview-card h3 { font-family: var(--serif); font-size: 24px; font-weight: 600; }
.preview-card p { margin-top: 3px; font-size: 12px; color: rgba(237, 245, 228, 0.68); }
.preview-stats { position: relative; z-index: 1; margin-top: 18px; display: grid; gap: 8px; }
.preview-stat { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; border-bottom: 1px dashed rgba(237, 245, 228, 0.16); padding-bottom: 7px; }
.preview-stat span { color: rgba(237, 245, 228, 0.62); }
.preview-stat strong { color: #fff; font-weight: 700; text-align: right; }

.side-card { padding: 18px 20px; }
.side-card h3 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-faint); }
.side-card .hint { margin-top: 8px; }

.save-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  padding: 16px 18px;
  border-radius: 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.save-bar .spacer { flex: 1; }

/* ── Тост ───────────────────────────────────────────────────────── */

.admin-toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 120;
  max-width: min(560px, calc(100vw - 32px));
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--green-deep);
  color: #f2f8ea;
  font-size: 13px;
  font-weight: 700;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translate(-50%, 14px);
  pointer-events: none;
  transition: opacity .22s, transform .22s;
}
.admin-toast.show { opacity: 1; transform: translate(-50%, 0); }
.admin-toast.error { background: #7d2e27; }
.admin-toast.info { background: #2f547c; }

/* ── Вход ───────────────────────────────────────────────────────── */

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(380px, 0.95fr);
}

.login-art {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px 54px;
  color: #eef5e6;
  overflow: hidden;
  background:
    radial-gradient(900px 600px at 15% 0%, rgba(173, 209, 132, 0.34), transparent 62%),
    radial-gradient(700px 500px at 100% 100%, rgba(208, 180, 120, 0.22), transparent 60%),
    linear-gradient(160deg, #284c34, #14271b 70%);
}
.login-art::before {
  content: "";
  position: absolute;
  right: -160px;
  top: -140px;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  border: 1px solid rgba(222, 239, 201, 0.16);
  box-shadow: 0 0 0 54px rgba(222, 239, 201, 0.04), 0 0 0 110px rgba(222, 239, 201, 0.025);
}
.login-art::after {
  content: "❧";
  position: absolute;
  right: 40px;
  bottom: 26px;
  font-size: 180px;
  color: rgba(222, 239, 201, 0.07);
  font-family: Georgia, serif;
  line-height: 1;
}
.login-art .brand { position: relative; z-index: 1; }
.login-art h1 {
  position: relative;
  z-index: 1;
  max-width: 560px;
  font-family: var(--serif);
  font-size: clamp(44px, 5.2vw, 76px);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.02em;
}
.login-art h1 em { font-style: italic; color: #cfe4b4; }
.login-art .lede {
  position: relative;
  z-index: 1;
  max-width: 440px;
  margin-top: 18px;
  font-size: 14px;
  color: rgba(238, 245, 230, 0.66);
}
.login-art .footnote { position: relative; z-index: 1; font-size: 11.5px; color: rgba(238, 245, 230, 0.45); }

.login-side {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 28px;
  background: linear-gradient(180deg, rgba(255, 253, 247, 0.4), transparent);
}

.login-card {
  width: 100%;
  max-width: 420px;
  padding: 34px 32px 30px;
  border-radius: 22px;
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.login-card h2 { font-family: var(--serif); font-size: 30px; font-weight: 600; line-height: 1.1; }
.login-card .hint { margin-top: 6px; }
.login-form { margin-top: 24px; display: flex; flex-direction: column; gap: 15px; }
.login-form .btn { width: 100%; padding: 12px; }
.login-error {
  margin-top: 16px;
  padding: 10px 13px;
  border-radius: 10px;
  background: var(--red-pale);
  color: var(--red);
  font-size: 12.5px;
  font-weight: 700;
}
.login-note {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--ink-faint);
  line-height: 1.6;
}
.login-back { display: inline-flex; align-items: center; gap: 6px; margin-top: 18px; font-size: 12px; font-weight: 700; color: var(--green); text-decoration: none; }
.login-back:hover { text-decoration: underline; }

/* ── Страница редактирования дела ───────────────────────────────── */

.edit-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr); gap: 22px; align-items: start; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.photo-tile { position: relative; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--cream-2); }
.photo-tile img { width: 100%; height: 110px; object-fit: cover; display: block; }
.photo-remove { display: flex; align-items: center; gap: 6px; padding: 6px 8px; font-size: 11px; font-weight: 700; color: var(--red); cursor: pointer; }

/* ── Адаптив ────────────────────────────────────────────────────── */

@media (max-width: 1180px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2, .settings-layout, .edit-grid { grid-template-columns: minmax(0, 1fr); }
  .settings-side { position: static; }
}

@media (max-width: 900px) {
  .admin-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: relative;
    height: auto;
    padding: 18px 18px 16px;
    gap: 14px;
  }
  .side-nav { flex-direction: row; flex-wrap: wrap; }
  .side-label { display: none; }
  .side-link { padding: 8px 12px; }
  .side-footer { margin-top: 0; flex-direction: row; flex-wrap: wrap; }
  .topbar { position: relative; padding: 16px 20px; flex-wrap: wrap; }
  .admin-content { padding: 22px 20px 60px; }
  .login-page { grid-template-columns: 1fr; }
  .login-art { min-height: 320px; padding: 32px 28px; }
  .login-art h1 { font-size: clamp(38px, 10vw, 56px); }
  .login-side { padding: 28px 20px 48px; }
}

@media (max-width: 620px) {
  .stats-grid { grid-template-columns: 1fr; }
  .card-head { flex-wrap: wrap; }
  .card-head .actions { margin-left: 0; width: 100%; }
  .org-item { grid-template-columns: 1fr; }
  .org-side { align-items: flex-start; }
  .org-actions { justify-content: flex-start; }
  .setting { grid-template-columns: 1fr; gap: 7px; }
  .form-grid { grid-template-columns: 1fr; }
  .filters { padding: 14px 16px; }
  .filters .field, .filters .field.grow { min-width: 100%; }
  .topbar-title h1 { font-size: 24px; }
}
