/* Адмінка «Притулок для хвостиків». Шрифти — ті самі файли, що на сайті. */
@font-face { font-family: Manrope; font-style: normal; font-weight: 700 800; font-display: swap;
  src: url(/assets/fonts/manrope-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Manrope; font-style: normal; font-weight: 700 800; font-display: swap;
  src: url(/assets/fonts/manrope-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Manrope; font-style: normal; font-weight: 700 800; font-display: swap;
  src: url(/assets/fonts/manrope-ext.woff2) format('woff2'); unicode-range: U+20B4; }
@font-face { font-family: Inter; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url(/assets/fonts/inter-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Inter; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url(/assets/fonts/inter-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Inter; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url(/assets/fonts/inter-ext.woff2) format('woff2'); unicode-range: U+20B4; }

:root {
  --bg: #FFFBF5;
  --accent: #FFD76A;
  --accent-soft: #FFF0B8;
  --coral: #FF8A65;
  --text: #1F1F1F;
  --text-2: #6B7280;
  --text-card: #4B5563;
  --border: #D6D3C6;
  --line: #EDE6D3;
  --alt: #F4F1E9;
  --danger: #B42318;
  --danger-soft: #FEE4E2;
  --ok: #1F6B36;
  --ok-soft: #DCF5E3;
  --head: Manrope, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --body: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--body); }
h1, h2, h3 { margin: 0 0 12px; font-family: var(--head); font-weight: 800; line-height: 1.2; }
h1 { font-size: 28px; letter-spacing: -0.02em; }
h2 { font-size: 20px; }
p { margin: 0 0 12px; }
a { color: inherit; text-underline-offset: 3px; }
img { max-width: 100%; height: auto; display: block; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--text); outline-offset: 2px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Шапка */
.bar { position: sticky; top: 0; z-index: 10; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; padding: 10px 24px; background: #fff; border-bottom: 2px solid var(--text); }
.bar__brand { font-family: var(--head); font-weight: 800; text-decoration: none; }
.bar__nav { display: flex; flex-wrap: wrap; gap: 4px; }
.bar__nav a { padding: 8px 12px; border-radius: 999px; text-decoration: none; font-weight: 500; }
.bar__nav a:hover { background: var(--alt); }
.bar__nav a[aria-current="page"] { background: var(--accent); font-weight: 600; }
.bar__user { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.bar__user form { margin: 0; }
.main { max-width: 1120px; margin: 0 auto; padding: 28px 24px 64px; }

/* Сторінки без входу */
.bare__main { display: flex; flex-direction: column; align-items: center; min-height: 100vh; padding: 48px 16px; }
.bare__brand { margin-bottom: 20px; font-family: var(--head); font-weight: 800; }

/* Картки */
.card { padding: 24px; background: #fff; border: 2px solid var(--text); border-radius: 20px; box-shadow: 4px 4px 0 var(--accent); }
.card--narrow { width: min(440px, 100%); }
.card + .card { margin-top: 20px; }
.muted { color: var(--text-2); }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.page-head h1 { margin: 0; }

/* Кнопки */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border: 2px solid var(--text); border-radius: 999px; background: var(--accent); color: var(--text); font: 700 15px/1.2 var(--head); text-decoration: none; cursor: pointer; }
.btn:hover { box-shadow: 2px 2px 0 var(--text); }
.btn--ghost { background: #fff; }
.btn--danger { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.btn--sm { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 20px; }
.inline { display: inline; margin: 0; }

/* Форми */
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 16px; }
.field label, .label { font-weight: 600; }
.field input, .field select, .field textarea { width: 100%; min-height: 44px; padding: 10px 12px; border: 2px solid var(--border); border-radius: 12px; background: #fff; font: inherit; color: inherit; }
.field textarea { min-height: 96px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--text); outline: none; }
.field--error input, .field--error select, .field--error textarea { border-color: var(--danger); }
.field__hint { color: var(--text-2); }
.field__error { color: var(--danger); font-weight: 600; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.check input { width: 20px; height: 20px; accent-color: var(--text); }
/* «Розділи сайту»: перемикач + підказка під ним */
.toggles { display: grid; gap: 4px; margin: 8px 0 0; padding: 0; list-style: none; }
.toggles li { padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.toggles li:last-child { border-bottom: 0; }
.toggles .field__hint { display: block; margin: -6px 0 0 30px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
fieldset { margin: 0 0 16px; padding: 16px; border: 2px solid var(--line); border-radius: 14px; }
legend { padding: 0 6px; font-weight: 700; }

/* Повідомлення */
.flash { padding: 12px 16px; border-radius: 12px; border: 2px solid var(--ok); background: var(--ok-soft); font-weight: 600; }
.flash--error { border-color: var(--danger); background: var(--danger-soft); color: var(--danger); }
.flash--warn { border-color: #B54708; background: #FEF0C7; }

/* Таблиці */
.table-wrap { overflow-x: auto; border: 2px solid var(--text); border-radius: 16px; background: #fff; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-card); background: var(--alt); }
tr:last-child td { border-bottom: 0; }
.thumb { width: 64px; height: 48px; object-fit: cover; border-radius: 8px; background: var(--alt); }
.tag { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--alt); font-size: 13px; font-weight: 600; }
.tag--accent { background: var(--accent); }
.tag--coral { background: var(--coral); }
.code { font: 600 15px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .04em; }
.codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 20px; padding: 16px; border: 2px dashed var(--border); border-radius: 12px; }
.qr { width: 200px; height: 200px; margin: 8px 0 16px; border: 2px solid var(--line); border-radius: 12px; background: #fff; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { flex: 1; }

@media (max-width: 700px) {
  .bar { padding: 10px 16px; }
  .bar__user { margin-left: 0; }
  .main { padding: 20px 16px 48px; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  h1 { font-size: 24px; }
}
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 20px; }
.row-actions { white-space: nowrap; text-align: right; }
.row-actions > * { margin-left: 4px; }
.thumb--empty { display: inline-block; }
.photo-preview { width: 240px; max-width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border: 2px solid var(--line); border-radius: 12px; margin: 8px 0; background: var(--alt); }
.photo-current { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-bottom: 8px; }
.need-edit { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0; }
.need-edit input[name="text"] { flex: 1 1 260px; min-height: 40px; padding: 8px 12px; border: 2px solid var(--border); border-radius: 10px; font: inherit; }
.need-edit input[name="text"]:focus { border-color: var(--text); outline: none; }
@media (max-width: 700px) {
  .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .row-actions { white-space: normal; }
}
.mt-0 { margin-top: 0; }
.facts-list { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 20px; margin: 12px 0 0; }
.facts-list dt { font-weight: 600; color: var(--text-card); }
.facts-list dd { margin: 0; overflow-wrap: anywhere; }
.pre { white-space: pre-wrap; }
h3 { font-size: 16px; }

/* Точка фокуса фото тварини: клік по морді → як обріжеться картка 4:3 */
.focal { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px 20px; margin: 8px 0; }
.focal[hidden] { display: none; }
.focal__frame { position: relative; flex: none; max-width: 100%; line-height: 0; }
.focal__img { display: block; width: auto; height: auto; max-width: min(320px, 100%); max-height: 320px; border: 2px solid var(--line); border-radius: 12px; cursor: crosshair; }
.focal__dot { position: absolute; left: 50%; top: 30%; width: 22px; height: 22px; margin: -11px 0 0 -11px; border: 3px solid #fff; border-radius: 50%; background: var(--coral); box-shadow: 0 0 0 2px rgba(0, 0, 0, .55); pointer-events: none; }
.focal__card { margin: 0; }
.focal__card canvas { display: block; width: 240px; max-width: 100%; height: auto; border: 2px solid var(--line); border-radius: 12px; background: var(--alt); }
.focal__card figcaption { margin-top: 4px; font-size: 13px; color: var(--text-2); }
.focal > .field__hint { flex-basis: 100%; }

/* Галерея тварини */
.gallery-admin { display: flex; flex-wrap: wrap; gap: 16px; margin: 12px 0 16px; padding: 0; list-style: none; }
.gallery-admin li { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.gallery-admin__img { display: block; width: 120px; height: 120px; object-fit: cover; border: 2px solid var(--line); border-radius: 12px; background: var(--alt); }
