/* =====================================================
   AURA DONOR BASE — стили (фирменная палитра auradonor.com)
   ===================================================== */

:root {
  --rose: #E9A3AA;
  --rose-dark: #DE8F97;
  --rose-deeper: #D17F88;
  --rose-soft: #F5C6C4;
  --rose-light: #FBE9E7;
  --cream: #FDF5EE;
  --cream-2: #FFF7F2;
  --cream-3: #F8EDF5;
  --brown: #4A3938;
  --brown-soft: #6F5655;
  --muted: #8A7776;
  --green: #5f9e6e;
  --green-bg: #E9F5EC;
  --blue: #5b7fb8;
  --blue-bg: #EAF1FA;
  --danger: #c26d6d;
  --danger-bg: #F9ECEC;
  --border: rgba(27, 20, 20, .08);
  --border-2: rgba(27, 20, 20, .14);
  --shadow: 0 18px 56px rgba(0, 0, 0, .10);
  --shadow-sm: 0 8px 28px rgba(0, 0, 0, .07);
  --r-lg: 24px;
  --r-md: 16px;
  --r-sm: 10px;
  --font: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  color: var(--brown);
  background: var(--cream-2);
  line-height: 1.55;
  font-size: 15px;
  min-height: 100vh;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 15px; color: var(--brown); }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

.hidden { display: none !important; }
.is-hidden { display: none !important; }
.hidden-form { display: none !important; }
.dim { color: var(--muted); font-size: 13.5px; }
.link { color: var(--rose-deeper); border-bottom: 1px dashed var(--rose-soft); }
.link:hover { color: var(--brown); }

/* ---------- Кнопки ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 999px;
  padding: 12px 24px;
  font-weight: 600; font-size: 14.5px; line-height: 1.1;
  transition: all .18s ease;
  white-space: nowrap;
}
.btn-rose { background: var(--rose); color: #fff; }
.btn-rose:hover { background: var(--rose-dark); transform: translateY(-1px); }
.btn-ghost { background: #fff; color: var(--brown); border: 1.5px solid var(--border-2); }
.btn-ghost:hover { border-color: var(--rose); color: var(--rose-deeper); }
.btn-dark { background: var(--brown); color: #fff; }
.btn-dark:hover { background: #332726; }
.btn-danger { background: var(--danger-bg); color: var(--danger); border: 1.5px solid rgba(194,109,109,.3); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-xs { padding: 5px 12px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%;
  background: #fff; border: 1.5px solid var(--border-2);
  color: var(--brown-soft); font-size: 15px;
  transition: all .15s;
}
.icon-btn:hover { border-color: var(--rose); color: var(--rose-deeper); }
.icon-btn-danger:hover { border-color: var(--danger); color: var(--danger); background: var(--danger-bg); }

/* ---------- Формы ---------- */

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--brown-soft); }
.field .hint { font-size: 12px; color: var(--muted); font-weight: 400; }

.input {
  width: 100%;
  border: 1.5px solid var(--border-2);
  border-radius: var(--r-sm);
  background: #fff;
  padding: 10px 14px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--rose); box-shadow: 0 0 0 3px rgba(233, 163, 170, .2); }
textarea.input { resize: vertical; }
.input-xs { padding: 5px 8px; font-size: 13px; width: 64px; }
.input-sm { padding: 7px 10px; font-size: 13.5px; }
.input-date { margin-top: 6px; }
.input-pin { max-width: 220px; text-align: center; letter-spacing: 3px; font-weight: 700; }

select.input { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%238A7776' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }

.check-row { display: flex; align-items: center; gap: 10px; font-weight: 500; cursor: pointer; padding: 6px 0; }
.check-row input { width: 18px; height: 18px; accent-color: var(--rose); }

.range2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.inline-form { display: inline-flex; align-items: center; gap: 8px; }

/* ---------- Бейджи, флэш ---------- */

.badge {
  display: inline-block; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; padding: 3px 10px;
  letter-spacing: .02em;
}
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-gray { background: #F1EBE9; color: var(--muted); }
.badge-brown { background: #EFE3E1; color: var(--brown-soft); }
.badge-blue { background: var(--blue-bg); color: var(--blue); }

.flash {
  border-radius: var(--r-md);
  padding: 12px 18px; margin: 0 0 16px;
  font-size: 14px; font-weight: 500;
}
.flash-ok { background: var(--green-bg); color: var(--green); }
.flash-error { background: var(--danger-bg); color: var(--danger); }

/* ---------- Логотип ---------- */

.logo { display: inline-flex; align-items: center; gap: 10px; }
.logo-mark {
  width: 38px; height: 38px; border-radius: 12px;
  background: linear-gradient(135deg, var(--rose) 0%, var(--rose-soft) 100%);
  color: #fff; font-weight: 700; font-size: 20px;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm);
}
.logo-mark-lg { width: 54px; height: 54px; font-size: 28px; border-radius: 16px; }
.logo-text { font-weight: 700; font-size: 19px; letter-spacing: .06em; line-height: 1.1; display: flex; flex-direction: column; }
.logo-text-lg { font-size: 26px; }
.logo-sub { font-weight: 500; font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.logo-center { flex-direction: column; gap: 14px; align-items: center; text-align: center; }
.logo-center .logo-sub { text-align: center; }

/* =====================================================
   КЛИЕНТСКАЯ ЧАСТЬ
   ===================================================== */

.client-body {
  background:
    radial-gradient(900px 500px at 90% -100px, rgba(233,163,170,.16), transparent 60%),
    radial-gradient(700px 500px at -100px 30%, rgba(248,237,245,.9), transparent 55%),
    var(--cream-2);
}

.preview-bar {
  background: var(--brown);
  color: var(--rose-soft);
  text-align: center;
  padding: 8px 16px;
  font-size: 13px;
  display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap;
}

.c-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255, 247, 242, .88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.c-header-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 12px; padding-bottom: 12px; }
.c-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.c-nav-link {
  padding: 8px 14px; border-radius: 999px; font-size: 14px; font-weight: 600;
  color: var(--brown-soft); transition: all .15s;
}
.c-nav-link:hover { background: var(--rose-light); color: var(--brown); }
.c-nav-link.is-active { background: var(--rose); color: #fff; }
.as-button { border: 0; background: none; font-weight: 600; }
.fav-count {
  display: inline-flex; min-width: 20px; height: 20px; padding: 0 6px;
  background: #fff; color: var(--rose-deeper); border-radius: 999px;
  align-items: center; justify-content: center; font-size: 11.5px; font-weight: 700;
}
.c-nav-link.is-active .fav-count { background: rgba(255,255,255,.25); color: #fff; }
.lang-dot {
  padding: 7px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 700;
  color: var(--muted); border: 1.5px solid var(--border-2);
}
.lang-dot.is-active { background: var(--brown); color: #fff; border-color: var(--brown); }

.c-main { padding: 26px 20px 60px; min-height: 60vh; }

.c-footer {
  border-top: 1px solid var(--border);
  background: var(--cream);
  padding: 22px 0; font-size: 13.5px;
}
.c-footer .wrap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.c-footer-muted { color: var(--muted); font-size: 12px; }

/* ---------- Вход (gate) ---------- */

.gate {
  min-height: calc(100vh - 180px);
  display: flex; align-items: center; justify-content: center;
  padding: 40px 0;
}
.gate-card {
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  padding: 44px 48px;
  max-width: 460px; width: 100%;
  text-align: center;
}
.gate-title { font-size: 24px; font-weight: 700; margin: 18px 0 10px; }
.gate-text { color: var(--brown-soft); font-size: 14.5px; margin-bottom: 22px; }
.pin-form { display: flex; flex-direction: column; gap: 14px; }
.pin-input {
  text-align: center; font-size: 26px; font-weight: 700; letter-spacing: 12px;
  padding: 14px; border-radius: var(--r-md);
  border: 2px solid var(--rose-soft);
}
.pin-input:focus { border-color: var(--rose); outline: none; box-shadow: 0 0 0 4px rgba(233,163,170,.2); }

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

.filters {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
  padding: 16px 20px; margin-bottom: 24px;
}
.filters-toggle {
  display: flex; align-items: center; gap: 10px;
  background: none; border: 0; font-weight: 700; font-size: 15px; color: var(--brown);
  width: 100%; padding: 2px 0;
}
.filters-count {
  margin-left: auto; font-weight: 600; font-size: 13px; color: var(--rose-deeper);
  background: var(--rose-light); padding: 4px 12px; border-radius: 999px;
}
.filters-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px;
  margin-top: 16px;
}
.filters-actions { display: flex; gap: 10px; align-items: center; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }

/* ---------- Сетка карточек ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}

.d-card {
  position: relative;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease;
  display: block;
}
.d-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.d-card.as-label { cursor: default; }

.d-photo { position: relative; aspect-ratio: 3/4; background: var(--rose-light); overflow: hidden; }
.d-photo img { width: 100%; height: 100%; object-fit: cover; }
.d-photo-none {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 13px;
}
.d-code {
  position: absolute; top: 10px; left: 10px;
  background: rgba(74, 57, 56, .82); color: #fff;
  border-radius: 999px; padding: 4px 12px;
  font-size: 12px; font-weight: 700; letter-spacing: .05em;
}
.d-info { padding: 12px 16px 14px; display: flex; flex-direction: column; gap: 4px; }
.d-row { display: flex; justify-content: space-between; font-size: 13.5px; }
.d-row span { color: var(--muted); }
.d-row b { font-weight: 600; }
.d-view { margin-top: 6px; color: var(--rose-deeper); font-size: 12.5px; font-weight: 600; }
.d-fav {
  position: absolute; top: 10px; right: 10px;
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,.92); color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm);
  pointer-events: none;
}
.d-fav.is-fav { color: #e0607d; }
.fav-check {
  position: absolute; top: 10px; right: 10px; z-index: 3;
  width: 24px; height: 24px; accent-color: var(--rose-deeper);
}
.d-open { position: absolute; inset: 0; z-index: 1; }
.d-card.as-label .d-photo, .d-card.as-label .d-info { cursor: pointer; }
.d-remove {
  position: absolute; bottom: 10px; right: 10px; z-index: 3;
  width: 28px; height: 28px; border-radius: 50%;
  border: 1.5px solid var(--border-2); background: #fff; color: var(--muted);
  font-size: 16px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.d-remove:hover { color: var(--danger); border-color: var(--danger); }

/* ---------- Пагинация ---------- */

.pagination { display: flex; gap: 8px; justify-content: center; margin: 32px 0 8px; flex-wrap: wrap; }
.pg {
  min-width: 38px; height: 38px; padding: 0 12px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #fff; border: 1.5px solid var(--border-2); border-radius: 999px;
  font-size: 13.5px; font-weight: 600; color: var(--brown-soft);
}
.pg:hover { border-color: var(--rose); color: var(--rose-deeper); }
.pg.is-active { background: var(--rose); border-color: var(--rose); color: #fff; }
.pg-dots { color: var(--muted); align-self: center; }

/* ---------- Карточка донора ---------- */

.backlink {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 600; font-size: 14px; color: var(--brown-soft);
  margin-bottom: 16px; padding: 8px 14px; border-radius: 999px;
  background: #fff; border: 1px solid var(--border);
}
.backlink:hover { color: var(--rose-deeper); }

.dcard {
  display: grid; grid-template-columns: minmax(0,5fr) minmax(0,7fr);
  gap: 28px;
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow);
  padding: 24px;
}
.dcard-main { aspect-ratio: 3/4; border-radius: var(--r-md); overflow: hidden; background: var(--rose-light); cursor: zoom-in; }
.dcard-main img { width: 100%; height: 100%; object-fit: cover; }
.dcard-main-none { display: flex; align-items: center; justify-content: center; color: var(--muted); }
.dcard-thumbs { display: flex; gap: 10px; margin-top: 12px; overflow-x: auto; padding-bottom: 4px; }
.dthumb {
  flex: 0 0 auto; width: 64px; aspect-ratio: 3/4;
  border-radius: 8px; overflow: hidden; border: 2px solid transparent;
  padding: 0; background: var(--rose-light);
}
.dthumb img { width: 100%; height: 100%; object-fit: cover; }
.dthumb.is-active { border-color: var(--rose); }

.dcard-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 6px; }
.dcard-code { font-size: 26px; font-weight: 700; letter-spacing: .04em; }
.dcard-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.btn-fav svg { flex: 0 0 auto; }

.dsect { margin-top: 22px; padding-top: 18px; border-top: 1px dashed var(--border-2); }
.dsect:first-of-type { border-top: 0; margin-top: 10px; padding-top: 0; }
.dsect-title {
  font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--rose-deeper); margin-bottom: 14px;
}

.dlist { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 24px; }
.dlist-col { grid-template-columns: 1fr; }
.dlist > div { padding: 6px 0; }
.dlist dt { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.dlist dd { font-size: 14.5px; font-weight: 500; margin-top: 2px; word-break: break-word; }
.dnote {
  margin-top: 12px; background: var(--cream); border-radius: var(--r-sm);
  padding: 10px 14px; font-size: 13.5px; color: var(--brown-soft);
}

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

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); font-weight: 600; padding: 10px 12px;
  border-bottom: 1.5px solid var(--border-2); white-space: nowrap;
}
.table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table-hover tbody tr:hover { background: rgba(233,163,170,.06); }
.cell-note { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.td-center { text-align: center; }

/* ---------- Избранное / отправка ---------- */

.page-head { margin-bottom: 20px; }
.h1 { font-size: 24px; font-weight: 700; }
.h2 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }

.sendbox {
  margin-top: 26px;
  background: #fff; border: 1.5px solid var(--rose-soft);
  border-radius: var(--r-lg); padding: 22px;
  box-shadow: var(--shadow-sm);
}
.sendbox textarea { margin: 12px 0 4px; }
.sendbox .filters-actions { justify-content: space-between; margin-top: 8px; }

.req-history { background: #fff; border: 1px solid var(--border); border-radius: var(--r-lg); padding: 22px; margin-top: 26px; }

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

.empty {
  text-align: center; padding: 60px 20px;
  background: #fff; border: 1px dashed var(--border-2);
  border-radius: var(--r-lg); color: var(--brown-soft);
}
.empty p { margin: 10px 0 18px; }
.empty-icon { font-size: 34px; }

/* ---------- Лайтбокс ---------- */

.lightbox {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(43, 30, 30, .92);
  display: flex; align-items: center; justify-content: center;
}
.lightbox[hidden] { display: none; }
.lb-fig { max-width: min(94vw, 1100px); max-height: 92vh; }
.lb-fig img { max-width: 100%; max-height: 92vh; object-fit: contain; border-radius: 8px; }
.lb-close, .lb-prev, .lb-next {
  position: fixed; background: rgba(255,255,255,.12); color: #fff;
  border: 0; border-radius: 50%; width: 46px; height: 46px; font-size: 26px;
  display: flex; align-items: center; justify-content: center;
}
.lb-close { top: 18px; right: 18px; }
.lb-prev { left: 14px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 14px; top: 50%; transform: translateY(-50%); }
.lb-close:hover, .lb-prev:hover, .lb-next:hover { background: var(--rose); }

/* =====================================================
   АДМИНКА
   ===================================================== */

.admin-body { background: var(--cream-2); }

.admin-shell { display: flex; min-height: 100vh; }

.a-sidebar {
  width: 248px; flex: 0 0 248px;
  background: #fff;
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.a-logo { padding: 20px 20px 16px; border-bottom: 1px solid var(--border); }
.a-nav { padding: 12px 12px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.a-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: 12px;
  font-size: 14px; font-weight: 600; color: var(--brown-soft);
}
.a-link:hover { background: var(--rose-light); color: var(--brown); }
.a-link.is-active { background: var(--rose); color: #fff; box-shadow: var(--shadow-sm); }
.a-badge {
  margin-left: auto; background: #F1EBE9; color: var(--muted);
  border-radius: 999px; font-size: 11.5px; font-weight: 700; padding: 2px 9px;
}
.a-link.is-active .a-badge { background: rgba(255,255,255,.28); color: #fff; }
.a-badge-new { background: var(--rose-deeper); color: #fff; }
.a-sidebar-foot { padding: 14px 16px; border-top: 1px solid var(--border); }
.a-who { margin-top: 10px; font-size: 12.5px; color: var(--muted); text-align: center; }

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

.a-topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255, 247, 242, .9);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px;
  padding: 12px 26px;
}
.a-title { font-size: 19px; font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.a-topbar-right { display: flex; gap: 10px; }
.a-burger { display: none; background: #fff; border: 1.5px solid var(--border-2); border-radius: 10px; padding: 7px; }

.a-content { padding: 22px 26px 60px; max-width: 1280px; width: 100%; }
.a-content-center { min-height: 100vh; display: flex; align-items: center; justify-content: center; max-width: none; }

.a-backdrop { display: none; }

/* ---------- Дашборд ---------- */

.stats-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin-bottom: 22px; }
.stat-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 18px; box-shadow: var(--shadow-sm); transition: transform .15s;
}
.stat-card:hover { transform: translateY(-2px); }
.stat-num { font-size: 30px; font-weight: 700; color: var(--rose-deeper); }
.stat-sub { font-size: 16px; color: var(--muted); font-weight: 600; }
.stat-label { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.stat-muted .stat-num { color: var(--brown-soft); }
.stat-alert .stat-num { color: var(--danger); }
.stat-alert { border-color: rgba(194,109,109,.35); background: var(--danger-bg); }

.dash-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 22px; }
.dash-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }

.panel {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
}
.panel-title { font-size: 15.5px; font-weight: 700; margin-bottom: 14px; }
.panel-title-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 6px; }
.panel-admin { border-left: 4px solid var(--rose); }
.panel-danger { border-left: 4px solid var(--danger); }
.panel-creds { border: 1.5px solid var(--rose); background: linear-gradient(135deg, #fff 60%, var(--rose-light)); }
.panel-creds .panel-title { color: var(--rose-deeper); }

/* ---------- Тулбар / списки ---------- */

.toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  flex-wrap: wrap; margin-bottom: 16px;
}
.toolbar-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.toolbar-form .input { width: auto; min-width: 170px; }
.toolbar-right { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.filters-body-h { display: flex; gap: 6px; background: #fff; border: 1px solid var(--border); border-radius: 999px; padding: 5px; }
.filters-body-h .tab { border-radius: 999px; }

.row-photo { width: 44px; height: 58px; object-fit: cover; border-radius: 8px; }
.row-photo-none {
  width: 44px; height: 58px; border-radius: 8px; background: var(--rose-light);
  display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 11px;
}
.row-actions { white-space: nowrap; display: flex; gap: 6px; }
.row-new td { background: rgba(233,163,170,.05); }
.langbar {
  font-size: 12px; font-weight: 700; color: var(--muted);
  background: #F1EBE9; padding: 3px 10px; border-radius: 999px;
}
.langbar.full { background: var(--green-bg); color: var(--green); }

/* ---------- Форма донора ---------- */

.form-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; margin-bottom: 14px;
}
.form-head-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.form-head-left h2 { font-size: 19px; }
.form-head-right { display: flex; gap: 10px; flex-wrap: wrap; }
.form-code { font-size: 22px; font-weight: 700; letter-spacing: .04em; }

.tabs {
  display: flex; gap: 6px; flex-wrap: wrap;
  background: #fff; border: 1px solid var(--border);
  border-radius: 999px; padding: 5px;
  margin-bottom: 18px;
}
.tab {
  border: 0; background: none; color: var(--brown-soft);
  font-weight: 600; font-size: 13.5px;
  padding: 9px 16px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 7px;
}
a.tab:hover { color: var(--rose-deeper); }
.tab.is-active { background: var(--rose); color: #fff; }
.tab-lock { font-size: 11px; opacity: .8; }

.tab-pane { display: none; }
.tab-pane.is-active { display: block; }

.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 18px; }
.form-grid-4 { grid-template-columns: repeat(4, 1fr); }
.form-grid-2 { grid-template-columns: repeat(2, 1fr); }
.field-wide { grid-column: 1 / -1; }

.langtabs { display: flex; gap: 6px; flex-wrap: wrap; }
.langtab {
  border: 1.5px solid var(--border-2); background: #fff; color: var(--brown-soft);
  font-size: 12.5px; font-weight: 700; padding: 6px 14px; border-radius: 999px;
}
.langtab.is-active { background: var(--brown); border-color: var(--brown); color: #fff; }
.langtabs-mid { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--border-2); }
.langpane { display: none; }
.langpane.is-active { display: block; }

.med-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 18px; }
.med-block {
  border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 14px; background: var(--cream-2);
  display: flex; flex-direction: column; gap: 10px;
}

.dh-row {
  display: grid; grid-template-columns: 1.4fr .7fr .8fr 1.6fr 40px;
  gap: 10px; align-items: end; margin-bottom: 10px;
}
.dh-del { margin-bottom: 4px; }

/* ---------- Загрузка фото ---------- */

.upload-box {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  border: 2px dashed var(--rose-soft); border-radius: var(--r-md);
  background: var(--rose-light);
  padding: 30px 20px; cursor: pointer; text-align: center;
  transition: all .15s; margin-bottom: 14px;
}
.upload-box:hover, .upload-box.is-drag {
  border-color: var(--rose-deeper); background: var(--rose-light);
  box-shadow: var(--shadow-sm);
}
.upload-box input[type=file] { display: none; }
.upload-preview { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.upload-preview img { width: 60px; height: 80px; object-fit: cover; border-radius: 8px; }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.photo-card {
  position: relative; border-radius: var(--r-md); overflow: hidden;
  border: 2px solid transparent; background: var(--rose-light);
}
.photo-card.is-main { border-color: var(--rose); }
.photo-card img { width: 100%; aspect-ratio: 3/4; object-fit: cover; }
.photo-main-badge {
  position: absolute; top: 8px; left: 8px;
  background: var(--rose); color: #fff;
  font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px;
}
.photo-ops {
  position: absolute; bottom: 0; left: 0; right: 0;
  display: flex; gap: 6px; justify-content: center;
  background: linear-gradient(transparent, rgba(43,30,30,.55));
  padding: 22px 0 8px;
}
.photo-ops form { display: inline-flex; }
.photo-ops .icon-btn { background: #fff; width: 28px; height: 28px; font-size: 13px; }

/* ---------- Комментарии ---------- */

.comment-form { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; margin-bottom: 16px; }
.comments { display: flex; flex-direction: column; gap: 12px; }
.comment {
  background: var(--cream-2); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 12px 16px;
}
.comment-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; font-size: 13px; }
.comment-head .inline-form { margin-left: auto; }
.comment-text { font-size: 14px; white-space: pre-wrap; word-break: break-word; }

/* ---------- Доступы ---------- */

.cred-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.cred-label { font-weight: 700; font-size: 13.5px; min-width: 70px; }
.cred-input { flex: 1; min-width: 220px; background: var(--cream-2); font-weight: 600; }
.cred-pin { max-width: 140px; text-align: center; font-size: 18px; letter-spacing: 4px; color: var(--rose-deeper); }

/* =====================================================
   АДАПТИВНОСТЬ
   ===================================================== */

@media (max-width: 1100px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
  .filters-grid { grid-template-columns: repeat(3, 1fr); }
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
  .form-grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 980px) {
  .dcard { grid-template-columns: 1fr; }
  .dash-cols { grid-template-columns: 1fr; }
  .med-grid { grid-template-columns: 1fr; }
  .dh-row { grid-template-columns: 1fr 1fr; }
  .dh-note { grid-column: 1 / -1; }
  .dh-del { position: absolute; display: none; } /* кнопка видна через wrap */
  .dh-row { position: relative; }
}

@media (max-width: 860px) {
  /* Админка: сайдбар → шторка */
  .a-sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 60;
    transform: translateX(-105%); transition: transform .22s ease;
    box-shadow: var(--shadow);
  }
  .a-sidebar.is-open { transform: translateX(0); }
  .a-backdrop {
    display: block; position: fixed; inset: 0; z-index: 55;
    background: rgba(43,30,30,.45); opacity: 0; pointer-events: none; transition: opacity .2s;
  }
  .a-backdrop.is-open { opacity: 1; pointer-events: auto; }
  .a-burger { display: inline-flex; }
  .a-content { padding: 16px 14px 50px; }
  .a-topbar { padding: 10px 14px; }
  .a-topbar-right .btn { display: none; }

  .grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .filters-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid, .form-grid-2 { grid-template-columns: 1fr; }
  .dlist { grid-template-columns: 1fr; }
  .gate-card { padding: 30px 22px; }
  .c-main { padding: 18px 14px 50px; }
  .wrap { padding: 0 14px; }
  .dcard { padding: 14px; }
  .sendbox { padding: 16px; }
}

@media (max-width: 520px) {
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .filters-grid { grid-template-columns: 1fr; }
  .form-grid-4 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .dh-row { grid-template-columns: 1fr 1fr; }
  .logo-text { font-size: 16px; }
  .logo-mark { width: 32px; height: 32px; font-size: 17px; border-radius: 10px; }
  .c-nav-link { padding: 7px 10px; font-size: 13px; }
  .toolbar-form .input { min-width: 0; width: 100%; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar-right { justify-content: space-between; }
  .stat-num { font-size: 24px; }
}

/* =====================================================
   ЗАЩИТА КОНТЕНТА (body.no-copy — клиентская часть)
   ===================================================== */

.no-copy {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.no-copy input, .no-copy textarea {
  -webkit-user-select: text;
  user-select: text;
}
.no-copy img {
  -webkit-user-drag: none;
  pointer-events: none; /* блокирует «Сохранить изображение» и перетаскивание */
}
.no-copy .pin-input { pointer-events: auto; }

/* Печать запрещена: пустая страница */
@media print {
  body.no-copy * { display: none !important; }
  body.no-copy::after {
    content: "Printing is not allowed — AURA AGENCY";
    display: block !important;
    font-family: Arial, sans-serif;
    font-size: 16px;
    color: #4A3938;
  }
}

/* Оверлей: окно неактивно / попытка скриншота / открытые DevTools */
body.screen-guard > *:not(.guard):not(.toast) {
  filter: blur(16px);
  pointer-events: none;
}
body.devtools-open > *:not(.guard):not(.toast) {
  filter: blur(18px);
  pointer-events: none;
}
.guard {
  position: fixed; inset: 0; z-index: 300;
  display: none;
  align-items: center; justify-content: center;
  background: rgba(253, 245, 238, .98);
  text-align: center;
  padding: 24px;
}
body.screen-guard .guard, body.devtools-open .guard { display: flex; }
.guard-in {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  color: var(--brown);
}
.guard-in b { font-size: 19px; }
.guard-in span { font-size: 13.5px; color: var(--muted); max-width: 340px; }
.guard-ico {
  width: 64px; height: 64px; border-radius: 20px;
  background: var(--rose-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
}

/* Тост-уведомления */
.toast {
  position: fixed; left: 50%; bottom: 26px; z-index: 310;
  transform: translateX(-50%) translateY(16px);
  background: var(--brown); color: #fff;
  padding: 10px 20px; border-radius: 999px;
  font-size: 13px; font-weight: 600;
  opacity: 0; pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
  max-width: 92vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* =====================================================
   АДАПТИВНОСТЬ: удобство на мобильных
   ===================================================== */

html { scroll-behavior: smooth; }

/* iOS: не зумить страницу при фокусе в поле (шрифт ≥16px) */
@media (max-width: 860px) {
  .input, select.input, textarea.input { font-size: 16px; }
  .pin-input { font-size: 22px; }
}

/* Крупные зоны касания */
@media (max-width: 520px) {
  .pg { min-width: 44px; height: 44px; }
  .filters-toggle { min-height: 46px; }
  .icon-btn { width: 36px; height: 36px; }
  .c-nav-link { padding: 9px 12px; }
  .d-fav { width: 36px; height: 36px; }
  .btn { padding: 13px 20px; }
}

/* Список PIN-кодов клиентов */
.td-pin { white-space: nowrap; }
.pin-val {
  font-weight: 700; letter-spacing: 2px;
  color: var(--rose-deeper);
  display: inline-block; min-width: 44px;
}
.pin-tools { display: inline-flex; gap: 6px; align-items: center; }

/* Комфорт на очень узких экранах */
@media (max-width: 360px) {
  body { font-size: 14px; }
  .grid { gap: 8px; }
  .gate-card { padding: 24px 16px; }
}
