/* ===== Тема ===== */
:root {
  --bg: #fbf7f2;
  --surface: #ffffff;
  --surface-2: #f5efe7;
  --text: #2a2833;
  --muted: #6e6a78;
  --line: #ebe3d8;
  --accent: #f26b4f;
  --accent-hover: #e05a3e;
  --accent-ink: #ffffff;
  --accent-soft: #fde8e1;
  --accent-2: #3aa38d;
  --ok: #2b9b6b;
  --ok-soft: #e1f4ea;
  --warn: #b97a00;
  --warn-soft: #fbf0d6;
  --bad: #d14646;
  --bad-soft: #fbe3e3;
  --info-soft: #e5eefb;
  --shadow: 0 1px 2px rgba(60, 40, 20, .05), 0 4px 14px rgba(60, 40, 20, .06);
  --radius: 16px;
  --radius-sm: 10px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #15141a;
  --surface: #1f1e26;
  --surface-2: #28262f;
  --text: #eceaf2;
  --muted: #a3a0ae;
  --line: #34313d;
  --accent: #ff7f63;
  --accent-hover: #ff9378;
  --accent-ink: #1b1214;
  --accent-soft: #3a2420;
  --accent-2: #4fc0a8;
  --ok: #4cc58f;
  --ok-soft: #1c3428;
  --warn: #e3ac35;
  --warn-soft: #3a3020;
  --bad: #f07272;
  --bad-soft: #3c2222;
  --info-soft: #222c3c;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 14px rgba(0, 0, 0, .25);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15141a;
    --surface: #1f1e26;
    --surface-2: #28262f;
    --text: #eceaf2;
    --muted: #a3a0ae;
    --line: #34313d;
    --accent: #ff7f63;
    --accent-hover: #ff9378;
    --accent-ink: #1b1214;
    --accent-soft: #3a2420;
    --accent-2: #4fc0a8;
    --ok: #4cc58f;
    --ok-soft: #1c3428;
    --warn: #e3ac35;
    --warn-soft: #3a3020;
    --bad: #f07272;
    --bad-soft: #3c2222;
    --info-soft: #222c3c;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 14px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

/* ===== Основа ===== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 "Nunito", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.1rem); font-weight: 800; }
h2 { font-size: 1.3rem; font-weight: 800; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 1em; }
code { background: var(--surface-2); padding: 1px 6px; border-radius: 6px; font-size: .9em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.hint { color: var(--muted); font-size: .85rem; margin: .4em 0 0; }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.main { flex: 1; padding-top: 24px; padding-bottom: 48px; }
.ic { flex: none; vertical-align: -4px; }

/* ===== Бутони ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 999px;
  padding: 10px 18px; min-height: 42px;
  font: inherit; font-weight: 700; line-height: 1.1;
  cursor: pointer; text-decoration: none !important;
  background: var(--surface-2); color: var(--text);
  transition: background .15s, border-color .15s, transform .05s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn-ghost:hover { border-color: var(--muted); }
.btn-ok { background: var(--ok); color: #fff; }
.btn-ok:hover { filter: brightness(1.08); }
.btn-danger { background: var(--bad); color: #fff; }
.btn-danger-ghost { background: transparent; border-color: var(--line); color: var(--bad); }
.btn-danger-ghost:hover { border-color: var(--bad); }
.btn-sm { padding: 6px 12px; min-height: 34px; font-size: .88rem; }
.btn-lg { padding: 13px 24px; font-size: 1.05rem; }
.btn-block { width: 100%; }
button.link { background: none; border: 0; color: var(--accent); font: inherit; cursor: pointer; padding: 0; }

/* ===== Хедър ===== */
.site-header {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-row { display: flex; align-items: center; gap: 16px; min-height: 68px; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 800; font-size: 1.25rem; text-decoration: none !important; }
.logo-mark svg { display: block; }
.logo-sm { font-size: 1.05rem; }
.header-search { flex: 1; display: flex; max-width: 480px; margin-left: auto; position: relative; }
.header-search input {
  width: 100%; border: 1px solid var(--line); background: var(--surface-2); color: var(--text);
  border-radius: 999px; padding: 10px 44px 10px 18px; font: inherit; min-height: 42px;
}
.header-search input:focus { outline: none; border-color: var(--accent); background: var(--surface); }
.header-search button {
  position: absolute; right: 4px; top: 4px; width: 34px; height: 34px; border: 0; border-radius: 50%;
  background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center;
}
.header-nav { display: flex; align-items: center; gap: 8px; }
.nav-link { display: inline-flex; align-items: center; gap: 6px; color: var(--text); font-weight: 700; padding: 8px 10px; border-radius: 999px; }
.nav-link:hover { background: var(--surface-2); text-decoration: none; }
.theme-toggle { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: transparent; color: var(--text); cursor: pointer; display: grid; place-items: center; }
.user-menu { position: relative; }
.user-menu summary { list-style: none; cursor: pointer; }
.user-menu summary::-webkit-details-marker { display: none; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-2); color: #fff; font-weight: 800;
}
.avatar-lg { width: 52px; height: 52px; font-size: 1.3rem; }
.menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; z-index: 40;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  box-shadow: var(--shadow); padding: 6px; display: flex; flex-direction: column;
}
.menu a, .menu button {
  display: block; text-align: left; width: 100%; padding: 9px 12px; border-radius: 8px;
  color: var(--text); background: none; border: 0; font: inherit; cursor: pointer;
}
.menu a:hover, .menu button:hover { background: var(--surface-2); text-decoration: none; }
.menu .danger { color: var(--bad); }
.menu select { margin: 4px 0 6px; }
.menu-head { padding: 8px 12px 10px; font-weight: 800; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.menu-head small { display: block; color: var(--muted); font-weight: 400; }
.count { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: .75rem; text-align: center; line-height: 20px; }
.announcement { background: var(--warn-soft); color: var(--text); font-weight: 600; padding: 10px 0; text-align: center; border-bottom: 1px solid var(--line); }

/* ===== Съобщения ===== */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-weight: 600; }
.alert-ok { background: var(--ok-soft); color: var(--ok); }
.alert-error { background: var(--bad-soft); color: var(--bad); }
.alert-info { background: var(--info-soft); color: var(--text); }

/* ===== Hero ===== */
.hero {
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 32px; align-items: center;
  background: linear-gradient(135deg, var(--accent-soft), var(--surface) 70%);
  border: 1px solid var(--line); border-radius: 24px; padding: 40px; margin-bottom: 28px;
}
.hero h1 { font-size: clamp(1.7rem, 1.2rem + 2.2vw, 2.6rem); margin-bottom: .4em; }
.hero-text p { color: var(--muted); font-size: 1.08rem; }
.hero-stats { display: flex; gap: 22px; flex-wrap: wrap; }
.hero-stats span { color: var(--muted); }
.hero-stats b { display: block; font-size: 1.7rem; color: var(--text); font-weight: 800; line-height: 1.1; }
.hero-search { background: var(--surface); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.hero-search label { font-weight: 800; display: block; margin-bottom: 10px; font-size: 1.1rem; }
.search-big { display: flex; gap: 8px; }
.search-big input { flex: 1; min-width: 0; }
.search-quick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.hero-give { display: block; margin-top: 16px; color: var(--muted); font-size: .95rem; }
.hero-give b { color: var(--accent); }

/* ===== Категории ===== */
.cats {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; margin-bottom: 22px;
}
.cat {
  display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center;
  padding: 14px 8px 12px; border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--line); color: var(--text); transition: border-color .15s, transform .15s;
}
.cat:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-2px); }
.cat.active { border-color: var(--accent); background: var(--accent-soft); }
.cat-icon { font-size: 2rem; line-height: 1; }
.cat-name { font-weight: 700; font-size: .88rem; line-height: 1.2; }
.cat-count { font-size: .75rem; color: var(--muted); }

/* ===== Форми ===== */
input, select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; min-height: 42px;
}
textarea { resize: vertical; min-height: 90px; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 35%, transparent); border-color: var(--accent); }
input[type="checkbox"] { width: 18px; height: 18px; min-height: 0; accent-color: var(--accent); }
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-weight: 700; }
.field label small { font-weight: 400; color: var(--muted); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.auth { max-width: 480px; margin: 12px auto; }
.auth-wide { max-width: 640px; }
.form-page { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.form-page > .muted { margin-top: -10px; }
.danger-zone { border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); }
fieldset.card { margin: 0 0 18px; display: flex; flex-direction: column; gap: 14px; }
legend { font-weight: 800; padding: 0 8px; font-size: 1.05rem; }
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; font-size: .92rem; }
.checks .ok { color: var(--ok); }
.checks .bad { color: var(--bad); font-weight: 700; }

/* ===== Филтри / търсене ===== */
.filters {
  display: flex; flex-wrap: wrap; gap: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin-bottom: 20px;
}
.filters input[type="search"] { flex: 2 1 260px; width: auto; }
.filters select { flex: 1 1 170px; width: auto; }
.filters .btn { flex: none; }
.list-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.list-head h2 { margin: 0; }

/* ===== Карти обяви ===== */
.grid-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.item-card {
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; color: var(--text); transition: transform .15s, box-shadow .15s;
}
.item-card:hover { text-decoration: none; transform: translateY(-3px); box-shadow: var(--shadow); }
.item-thumb { aspect-ratio: 4 / 3; background: var(--surface-2); position: relative; overflow: hidden; }
.item-thumb img { width: 100%; height: 100%; object-fit: cover; }
.no-photo { display: grid; place-items: center; height: 100%; font-size: 3rem; }
.ribbon {
  position: absolute; top: 12px; left: 12px; background: var(--ok); color: #fff;
  font-weight: 800; font-size: .8rem; padding: 4px 10px; border-radius: 999px;
}
.ribbon-lg { font-size: 1rem; padding: 6px 14px; }
.item-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.item-body h3 { margin: 0; font-size: 1rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item-cat { font-size: .8rem; color: var(--muted); font-weight: 700; }
.item-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: .85rem; color: var(--muted); margin-top: auto; padding-top: 6px; }
.item-meta .ic { width: 15px; height: 15px; margin-right: 2px; }
.item-body time { font-size: .78rem; color: var(--muted); }
.chip { background: var(--accent-soft); color: var(--text); border-radius: 999px; padding: 1px 9px; font-size: .78rem; font-weight: 700; }

.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 800; margin: 4px 4px 0 0; }
.badge-pending { background: var(--warn-soft); color: var(--warn); }
.badge-approved { background: var(--ok-soft); color: var(--ok); }
.badge-rejected { background: var(--bad-soft); color: var(--bad); }
.badge-given { background: var(--info-soft); color: var(--text); }

.empty { text-align: center; padding: 48px 16px; }
.empty-icon { font-size: 3.5rem; margin-bottom: 10px; }

.pager { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 28px 0 0; }
.pager a, .pager span { min-width: 40px; height: 40px; padding: 0 12px; display: grid; place-items: center; border-radius: 999px; border: 1px solid var(--line); color: var(--text); font-weight: 700; }
.pager a:hover { border-color: var(--accent); text-decoration: none; }
.pager .current { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* ===== Страница на обява ===== */
.crumbs { font-size: .9rem; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--muted); }
.item-page { display: grid; grid-template-columns: 1.25fr 1fr; gap: 32px; align-items: start; }
.gallery { position: sticky; top: 90px; }
.gallery-main {
  display: block; width: 100%; padding: 0; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; background: var(--surface-2); cursor: zoom-in; position: relative; aspect-ratio: 4 / 3;
}
.gallery-main img { width: 100%; height: 100%; object-fit: contain; }
.no-photo-lg { display: grid; place-items: center; font-size: 6rem; cursor: default; }
.gallery-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); gap: 8px; margin-top: 10px; }
.gallery-thumbs button { padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; cursor: pointer; background: var(--surface-2); aspect-ratio: 1; }
.gallery-thumbs button.active { border-color: var(--accent); }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.item-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.item-info h1 { margin-top: 6px; }
.free-tag { display: inline-block; background: var(--ok-soft); color: var(--ok); font-weight: 800; padding: 6px 14px; border-radius: 999px; }
.specs { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 4px 0 18px; }
.specs dt { color: var(--muted); }
.specs dd { margin: 0; font-weight: 700; }
.specs .ic { width: 16px; height: 16px; }
.description { white-space: normal; margin-bottom: 20px; overflow-wrap: anywhere; }
.donor { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.donor-head { display: flex; align-items: center; gap: 12px; }
.donor-head small { display: block; }
.contact-actions { display: grid; gap: 8px; }
.owner-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.owner-actions form { margin: 0; }
.report summary { cursor: pointer; color: var(--muted); font-size: .9rem; list-style: none; display: inline-flex; gap: 6px; align-items: center; }
.report summary .ic { width: 16px; height: 16px; }
.similar { margin-top: 44px; }

/* ===== Лайтбокс ===== */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(10, 8, 12, .92); display: grid; place-items: center; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 94vw; max-height: 88vh; object-fit: contain; border-radius: 8px; }
.lightbox button { position: absolute; background: rgba(255, 255, 255, .12); color: #fff; border: 0; width: 52px; height: 52px; border-radius: 50%; font-size: 2rem; line-height: 1; cursor: pointer; }
.lightbox button:hover { background: rgba(255, 255, 255, .25); }
.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 16px; top: 50%; transform: translateY(-50%); }

/* ===== Качване на снимки ===== */
.dropzone {
  position: relative; border: 2px dashed var(--line); border-radius: var(--radius); background: var(--surface-2);
  padding: 30px 16px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone:focus, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); outline: none; }
.dropzone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.dz-inner { display: flex; flex-direction: column; align-items: center; gap: 4px; pointer-events: none; }
.dz-inner .ic { width: 36px; height: 36px; color: var(--accent); margin-bottom: 4px; }
.dz-inner span { color: var(--muted); font-size: .9rem; }
.dropzone.full { opacity: .5; pointer-events: none; }
.previews { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; margin-top: 10px; }
.previews:empty { display: none; }
.preview { -webkit-touch-callout: none; user-select: none; position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--surface-2); cursor: grab; border: 2px solid transparent; }
.preview:first-child { border-color: var(--accent); }
.preview:first-child::after { content: "Основна"; position: absolute; left: 6px; bottom: 6px; background: var(--accent); color: var(--accent-ink); font-size: .7rem; font-weight: 800; padding: 2px 8px; border-radius: 999px; }
.preview img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.preview.dragging { opacity: .4; }
.preview.processing::before { content: ""; position: absolute; inset: 0; background: color-mix(in srgb, var(--surface) 60%, transparent); }
.pv-remove { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .65); color: #fff; font-size: 1.1rem; line-height: 1; cursor: pointer; }
.progress { height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }

/* ===== Моите обяви ===== */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.page-head h1 { margin: 0; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.tabs a { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); color: var(--text); font-weight: 700; font-size: .92rem; }
.tabs a b { color: var(--muted); font-weight: 700; margin-left: 2px; }
.tabs a.active { background: var(--text); border-color: var(--text); color: var(--bg); }
.tabs a.active b { color: inherit; opacity: .7; }
.tabs a:hover { text-decoration: none; }
.my-list { display: flex; flex-direction: column; gap: 10px; }
.my-row { display: grid; grid-template-columns: 96px 1fr auto; gap: 16px; align-items: center; padding: 12px; }
.my-thumb { width: 96px; height: 96px; border-radius: 12px; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; font-size: 2rem; }
.my-thumb img { width: 100%; height: 100%; object-fit: cover; }
.my-title { font-weight: 800; color: var(--text); display: block; }
.my-info .ic { width: 15px; height: 15px; }
.my-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.my-actions form { margin: 0; }
.reject-note { color: var(--bad); font-size: .88rem; margin-top: 4px; }

/* ===== Статични страници ===== */
.prose { max-width: 780px; margin: 0 auto; }
.prose h2 { margin-top: 1.6em; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: .4em; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 24px 0; }
.step { padding: 20px; }
.step-n { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 800; margin-bottom: 10px; }
.step p { margin: 0; color: var(--muted); }

/* ===== Админ ===== */
.admin { display: grid; grid-template-columns: 220px 1fr; gap: 24px; align-items: start; }
.admin-nav { position: sticky; top: 90px; display: flex; flex-direction: column; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; }
.admin-nav a { padding: 10px 12px; border-radius: 10px; color: var(--text); font-weight: 700; display: flex; justify-content: space-between; align-items: center; }
.admin-nav a:hover { background: var(--surface-2); text-decoration: none; }
.admin-nav a.active { background: var(--accent-soft); color: var(--accent); }
.admin-nav .admin-back { color: var(--muted); font-weight: 600; margin-top: 6px; border-top: 1px solid var(--line); border-radius: 0 0 10px 10px; }
.admin-main { min-width: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { padding: 18px; color: var(--text); }
.stat:hover { text-decoration: none; border-color: var(--accent); }
.stat b { display: block; font-size: 2rem; font-weight: 800; line-height: 1.1; }
.stat span { color: var(--muted); font-size: .9rem; }
.admin-cols { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; align-items: start; }
.mini-row { display: grid; grid-template-columns: 54px 1fr auto; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.mini-row small { display: block; }
.mini-row form { margin: 0; }
.mini-thumb { width: 54px; height: 54px; border-radius: 10px; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; font-size: 1.5rem; }
.mini-thumb img { width: 100%; height: 100%; object-fit: cover; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar input[type="search"] { flex: 1; min-width: 200px; }
.toolbar select { width: auto; }
.bulk-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.bulk-bar select { width: auto; min-width: 220px; }
.admin-items { display: flex; flex-direction: column; gap: 10px; }
.admin-item { display: grid; grid-template-columns: auto 110px 1fr auto; gap: 14px; align-items: start; padding: 14px; }
.admin-item > input { margin-top: 6px; }
.admin-thumb { width: 110px; height: 110px; border-radius: 12px; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; font-size: 2.2rem; position: relative; }
.admin-thumb img { width: 100%; height: 100%; object-fit: cover; }
.admin-thumb small { position: absolute; right: 6px; bottom: 6px; background: rgba(0, 0, 0, .6); color: #fff; font-size: .7rem; padding: 1px 6px; border-radius: 999px; }
.admin-item-info { min-width: 0; }
.admin-item-info .ic { width: 14px; height: 14px; }
.admin-desc { color: var(--muted); font-size: .88rem; margin: 6px 0 0; overflow-wrap: anywhere; }
.admin-item-actions { display: flex; flex-direction: column; gap: 6px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--surface-2); }
.table tr:last-child td { border-bottom: 0; }
.table.compact td { padding: 6px 4px; }
.table .num { text-align: right; font-weight: 800; }
.table .actions { white-space: nowrap; text-align: right; }
.table .actions form { display: inline-flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; margin: 0; }
.row-blocked td { opacity: .6; }
.row-menu { position: relative; display: inline-block; }
.row-menu summary { list-style: none; }
.row-menu summary::-webkit-details-marker { display: none; }
.row-menu .menu { text-align: left; white-space: normal; }
.cats-table input { min-height: 36px; padding: 6px 10px; }
.icon-input { width: 64px !important; text-align: center; font-size: 1.4rem; padding: 2px !important; cursor: pointer; }
.sort-input { width: 90px !important; }
.cat-fields { display: grid; grid-template-columns: 64px 1fr 90px auto; gap: 8px; }
.emoji-picker { display: flex; flex-wrap: wrap; gap: 4px; }
.emoji-picker button { width: 40px; height: 40px; font-size: 1.35rem; border: 1px solid var(--line); background: var(--surface-2); border-radius: 10px; cursor: pointer; }
.emoji-picker button:hover { border-color: var(--accent); }
.icon-input.picking { outline: 2px solid var(--accent); }

/* ===== Футър ===== */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); padding: 28px 0 20px; font-size: .92rem; }
.footer-row { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer-row p { margin: 6px 0 0; max-width: 420px; }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; align-items: flex-start; }
.footer-links a { color: var(--text); font-weight: 700; }
.footer-bottom { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }

/* ===== Адаптивност ===== */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding: 26px 20px; }
  .item-page { grid-template-columns: 1fr; gap: 20px; }
  .gallery { position: static; }
  .admin { grid-template-columns: 1fr; }
  .admin-nav { position: static; flex-direction: row; flex-wrap: wrap; }
  .admin-nav .admin-back { border-top: 0; margin-top: 0; }
  .admin-cols { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .header-row { flex-wrap: wrap; gap: 8px 12px; padding-top: 8px; padding-bottom: 10px; min-height: 0; }
  .header-search { order: 3; flex: 1 1 100%; max-width: none; margin: 0; }
  .header-nav { margin-left: auto; }
  .nav-link span, .btn-give span { display: none; }
  .btn-give { padding: 0; width: 42px; }
  .steps { grid-template-columns: 1fr; }
  .my-row { grid-template-columns: 72px 1fr; }
  .my-thumb { width: 72px; height: 72px; }
  .my-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .admin-item { grid-template-columns: auto 80px 1fr; }
  .admin-thumb { width: 80px; height: 80px; }
  .admin-item-actions { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; }
  .cat-fields { grid-template-columns: 64px 1fr; }
}
@media (max-width: 560px) {
  .field-row { grid-template-columns: 1fr; }
  .filters select { flex-basis: 40%; }
  .filters .btn { flex: 1 1 auto; }
  .search-big { flex-direction: column; }
  .cats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .cat-icon { font-size: 1.6rem; }
  .grid-items { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .item-body { padding: 10px; }
  .item-body h3 { font-size: .92rem; }
  .card { padding: 16px; }
  .logo-text { font-size: 1.1rem; }
  .lightbox .lb-prev, .lightbox .lb-next { top: auto; bottom: 20px; transform: none; }
}
