/* ══════════════════════════════════════════════════════════════════════════════
   Каталог номенклатур v2 — стили панели администратора
   ══════════════════════════════════════════════════════════════════════════════ */

/* ── Admin layout ────────────────────────────────────────────────────────── */
.admin-wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 24px 60px;
  padding-top: calc(var(--header-h, 64px) + 24px);
}

/* ── Login screen ────────────────────────────────────────────────────────── */
.login-screen {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  padding: 24px;
}
.login-card {
  background: var(--surface);
  border-radius: var(--radius-xl, 24px);
  box-shadow: var(--shadow-lg);
  padding: 40px;
  width: 100%; max-width: 400px;
  border: 1px solid var(--border);
}
.login-logo {
  display: flex; flex-direction: column; align-items: center;
  gap: 12px; margin-bottom: 32px;
}
.login-logo img { height: 40px; width: auto; object-fit: contain; }
[data-theme="dark"] .login-logo img {
  filter: brightness(0) invert(1) sepia(1) saturate(3) hue-rotate(280deg);
}
.login-title { font-size: 22px; font-weight: 700; color: var(--text); text-align: center; }
.login-sub   { font-size: 14px; color: var(--text-secondary); text-align: center; }

.form-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.form-label { font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.form-input {
  height: 44px; padding: 0 14px;
  border-radius: var(--radius-md, 12px);
  border: 1.5px solid var(--border-strong);
  background: var(--surface2); color: var(--text);
  font-size: 15px; outline: none;
  transition: all 0.2s ease;
}
.form-input:focus {
  border-color: var(--brand, #a01671);
  box-shadow: 0 0 0 3px var(--brand-faint);
  background: var(--surface);
}
.form-input::placeholder { color: var(--text-tertiary); }

/* ── Admin header ────────────────────────────────────────────────────────── */
.admin-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  height: var(--header-h, 64px);
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 20px; gap: 16px;
}
[data-theme="dark"] .admin-header {
  background: rgba(13,13,13,0.88);
}
.admin-header__logo {
  display: flex; align-items: center; gap: 10px; text-decoration: none; flex-shrink: 0;
}
.admin-header__logo img { height: 30px; width: auto; }
[data-theme="dark"] .admin-header__logo img {
  filter: brightness(0) invert(1) sepia(1) saturate(3) hue-rotate(280deg);
}
.admin-badge {
  font-size: 11px; font-weight: 700; letter-spacing: 0.5px;
  background: var(--brand, #a01671); color: #fff;
  padding: 2px 8px; border-radius: 20px;
  text-transform: uppercase;
}
.admin-header__nav {
  display: flex; align-items: center; gap: 2px;
  overflow-x: auto; scrollbar-width: none; flex: 1;
}
.admin-header__nav::-webkit-scrollbar { display: none; }
.admin-nav-btn {
  padding: 6px 14px; border-radius: 20px;
  font-size: 14px; font-weight: 500;
  color: var(--text-secondary);
  background: none;
  transition: all 0.2s ease; cursor: pointer;
  white-space: nowrap;
  position: relative;
}
.admin-nav-btn:hover { color: var(--brand, #a01671); background: var(--brand-faint); }
.admin-nav-btn.active { color: var(--brand, #a01671); background: var(--brand-faint); font-weight: 600; }
.admin-nav-btn .badge-count {
  position: absolute; top: 2px; right: 4px;
  min-width: 16px; height: 16px; border-radius: 8px;
  background: var(--brand, #a01671); color: #fff;
  font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
}

.admin-header__actions {
  display: flex; align-items: center; gap: 8px; margin-left: auto; flex-shrink: 0;
}

/* ── Admin panels ────────────────────────────────────────────────────────── */
.admin-panel { display: none; }
.admin-panel.active { display: block; }

/* ── Card ────────────────────────────────────────────────────────────────── */
.admin-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 16px);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.admin-card__title {
  font-size: 17px; font-weight: 700;
  color: var(--text); margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}
.admin-card__subtitle {
  font-size: 14px; color: var(--text-secondary); margin-bottom: 16px;
}

/* ── Stats grid ──────────────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px; margin-bottom: 24px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 12px);
  padding: 20px;
  text-align: center;
}
.stat-card__num {
  font-size: 32px; font-weight: 800;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-light) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}
.stat-card__label {
  font-size: 13px; color: var(--text-secondary); margin-top: 6px;
}

/* ── Section management ──────────────────────────────────────────────────── */
.section-list { display: flex; flex-direction: column; gap: 10px; }
.section-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 12px);
  padding: 14px 16px;
  transition: all 0.2s ease;
}
.section-item:hover { border-color: var(--brand-faint2); }
.section-item__icon { font-size: 20px; flex-shrink: 0; }
.section-item__name { font-size: 15px; font-weight: 600; color: var(--text); flex: 1; }
.section-item__slug { font-size: 12px; color: var(--text-tertiary); font-family: monospace; }
.section-item__actions { display: flex; gap: 6px; }

/* ── Pending photos ──────────────────────────────────────────────────────── */
.pending-list { display: flex; flex-direction: column; gap: 12px; }
.pending-item {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 12px);
  padding: 12px 16px;
  transition: all 0.2s ease;
}
.pending-item__thumb {
  width: 80px; height: 80px; flex-shrink: 0;
  border-radius: var(--radius-sm, 8px);
  object-fit: contain; background: var(--surface); padding: 6px;
  border: 1px solid var(--border);
  cursor: zoom-in;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.pending-item__thumb:hover {
  transform: scale(1.06);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}
.pending-item__info { flex: 1; min-width: 0; }
.pending-item__id {
  font-size: 13px; font-weight: 700; color: var(--brand);
  font-family: monospace; margin-bottom: 2px;
}
.pending-item__name { font-size: 14px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pending-item__meta { font-size: 12px; color: var(--text-tertiary); margin-top: 2px; }
.pending-item__actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ── Photo grid ──────────────────────────────────────────────────────────── */
.photo-grid {
  display: flex; gap: 12px; flex-wrap: wrap;
}
.photo-tile {
  position: relative; width: 110px; height: 110px;
  border-radius: var(--radius-md, 12px);
  overflow: hidden; border: 1px solid var(--border);
  background: var(--surface2);
}
.photo-tile img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.photo-tile__del {
  position: absolute; top: 4px; right: 4px;
  width: 24px; height: 24px; border-radius: 50%;
  background: rgba(224, 49, 49, 0.9);
  color: #fff; font-size: 14px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; opacity: 0;
  transition: opacity 0.2s ease;
}
.photo-tile:hover .photo-tile__del { opacity: 1; }

/* ── Item search (admin) ─────────────────────────────────────────────────── */
.item-search-wrap { position: relative; }
.item-search-input {
  width: 100%; height: 44px; padding: 0 14px 0 40px;
  border-radius: var(--radius-md, 12px);
  border: 1.5px solid var(--border-strong);
  background: var(--surface2); color: var(--text);
  font-size: 15px; outline: none;
  transition: all 0.2s ease;
}
.item-search-input:focus {
  border-color: var(--brand, #a01671);
  box-shadow: 0 0 0 3px var(--brand-faint);
  background: var(--surface);
}
.item-search-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-tertiary); pointer-events: none; width: 18px; height: 18px;
}
.item-search-dropdown {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 200;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md, 12px);
  box-shadow: var(--shadow-lg);
  overflow: hidden; max-height: 300px; overflow-y: auto;
}
.item-search-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s ease;
}
.item-search-row:last-child { border-bottom: none; }
.item-search-row:hover { background: var(--brand-faint); }
.item-search-row strong { font-size: 13px; color: var(--brand); font-family: monospace; }
.item-search-row span { font-size: 14px; color: var(--text); }

/* ── File drop zone ──────────────────────────────────────────────────────── */
.drop-zone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-md, 12px);
  padding: 32px; text-align: center;
  transition: all 0.2s ease; cursor: pointer;
  background: var(--surface2);
}
.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--brand, #a01671);
  background: var(--brand-faint);
}
.drop-zone__icon { font-size: 36px; margin-bottom: 10px; }
.drop-zone__text { font-size: 15px; color: var(--text-secondary); }
.drop-zone__hint { font-size: 13px; color: var(--text-tertiary); margin-top: 4px; }
.drop-zone input[type="file"] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}

/* ── Settings row ────────────────────────────────────────────────────────── */
.settings-row {
  display: flex; align-items: flex-start; gap: 20px;
  padding: 16px 0; border-bottom: 1px solid var(--border);
}
.settings-row:last-child { border-bottom: none; }
.settings-row__label { flex: 1; }
.settings-row__title { font-size: 15px; font-weight: 600; color: var(--text); }
.settings-row__desc  { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.settings-row__control { width: 240px; flex-shrink: 0; }

/* ── Alert ───────────────────────────────────────────────────────────────── */
.alert {
  padding: 12px 16px; border-radius: var(--radius-md, 12px);
  font-size: 14px; font-weight: 500;
  margin-bottom: 16px; display: none;
}
.alert.show { display: block; }
.alert-success { background: rgba(0, 184, 119, 0.12); color: #007a50; border: 1px solid rgba(0, 184, 119, 0.25); }
.alert-error   { background: rgba(224, 49, 49, 0.1);  color: #c92a2a; border: 1px solid rgba(224, 49, 49, 0.2); }
.alert-info    { background: var(--brand-faint); color: var(--brand); border: 1px solid var(--brand-faint2); }
[data-theme="dark"] .alert-success { color: #00b877; }
[data-theme="dark"] .alert-error   { color: #ff6b6b; }

/* ── Divider ─────────────────────────────────────────────────────────────── */
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* ── Toggle ──────────────────────────────────────────────────────────────── */
.toggle {
  position: relative; width: 44px; height: 26px;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--border-strong); border-radius: 13px;
  transition: 0.2s ease;
}
.toggle-slider::before {
  content: ''; position: absolute;
  width: 20px; height: 20px; left: 3px; bottom: 3px;
  background: #fff; border-radius: 50%;
  transition: 0.2s ease; box-shadow: var(--shadow-sm);
}
.toggle input:checked + .toggle-slider { background: var(--brand, #a01671); }
.toggle input:checked + .toggle-slider::before { transform: translateX(18px); }

/* ── Category management ─────────────────────────────────────────────────── */
.cat-group-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--border);
}
.cat-group-row:last-child { border-bottom: none; }
.cat-group-row__name {
  flex: 0 0 220px; font-size: 14px; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cat-group-row__arrow { color: var(--text-tertiary); font-size: 16px; flex-shrink: 0; }
.cat-group-row__input { flex: 1; height: 36px; font-size: 13px; }

/* ── Lightbox ────────────────────────────────────────────────────────────── */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  animation: lb-fade-in 0.2s ease;
}
.lightbox.open {
  display: flex;
}
@keyframes lb-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.lightbox__img {
  max-width: 92vw;
  max-height: 88vh;
  border-radius: 12px;
  object-fit: contain;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
  animation: lb-zoom-in 0.2s ease;
  cursor: default;
}
@keyframes lb-zoom-in {
  from { transform: scale(0.88); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}
.lightbox__close {
  position: fixed;
  top: 20px;
  right: 24px;
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  font-size: 22px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
  z-index: 10000;
}
.lightbox__close:hover { background: rgba(255,255,255,0.28); }

/* ── Dept orders panel ───────────────────────────────────────────────────── */
.dept-filter-btn {
  padding: 6px 16px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--surface);
  cursor: pointer;
  transition: all 0.15s;
}
.dept-filter-btn:hover { border-color: var(--brand); color: var(--brand); }
.dept-filter-btn.active { background: var(--brand); color: #fff; border-color: var(--brand); }

.dept-order-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 10px;
  background: var(--surface);
}
.dept-order-card:last-child { margin-bottom: 0; }
.dept-order-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.dept-order-card__store {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.dept-order-card__meta {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}
.dept-order-card__comment {
  font-size: 13px;
  color: var(--text);
  background: var(--bg);
  border-left: 3px solid var(--brand);
  border-radius: 4px;
  padding: 6px 10px;
  margin-top: 8px;
}
.dept-order-card__transfer {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 6px;
}
.dept-order-card__items {
  margin-top: 8px;
  border-top: 1px solid var(--border);
  padding-top: 8px;
}
.dept-order-card__item {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  padding: 3px 0;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}
.dept-order-card__item:last-child { border-bottom: none; }
.dept-order-card__item-qty { font-weight: 600; color: var(--text); margin-left: 8px; white-space: nowrap; }
.dept-order-card__toggle {
  font-size: 12px;
  color: var(--brand);
  cursor: pointer;
  user-select: none;
  margin-top: 6px;
  display: inline-block;
}

.dept-order-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}
.dept-order-badge.new                    { background: #dbeafe; color: #1d4ed8; }
.dept-order-badge.in_progress            { background: #fef3c7; color: #92400e; }
.dept-order-badge.done                   { background: #dcfce7; color: #166534; }
.dept-order-badge.rejected               { background: #fee2e2; color: #b91c1c; }
.dept-order-badge.clarification_needed   { background: #fff7ed; color: #c2410c; }

.dept-order-action-btn {
  padding: 5px 14px;
  border-radius: 7px;
  border: 1.5px solid var(--brand);
  background: transparent;
  color: var(--brand);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.dept-order-action-btn:hover { background: var(--brand); color: #fff; }
.dept-order-action-btn.done   { border-color: #166534; color: #166534; }
.dept-order-action-btn.done:hover { background: #166534; color: #fff; }
.dept-order-action-btn.return { border-color: #c2410c; color: #c2410c; }
.dept-order-action-btn.return:hover { background: #c2410c; color: #fff; }

/* Форма «Вернуть на уточнение» */
.dept-return-form {
  display: none;
  margin-top: 8px;
  padding: 10px 12px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 9px;
}
.dept-return-form textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 7px 10px;
  border: 1.5px solid #fed7aa;
  border-radius: 7px;
  font-size: 13px;
  font-family: inherit;
  background: #fff;
  color: var(--text, #1d1d1f);
  resize: vertical;
  min-height: 64px;
  outline: none;
}
.dept-return-form textarea:focus { border-color: #c2410c; }
.dept-return-form__hint {
  font-size: 12px;
  color: #c2410c;
  margin: 0 0 6px;
  font-weight: 500;
}

/* Блок «На уточнении» в dept-карточке */
.dept-order-card__clarification {
  font-size: 12px;
  color: #c2410c;
  background: #fff7ed;
  border-left: 3px solid #c2410c;
  border-radius: 0 7px 7px 0;
  padding: 6px 10px;
  margin: 6px 0;
}

/* Блок комментариев уточнения в карточке директора */
.dir-clarification-block {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  padding: 8px 12px;
  margin: 6px 0;
}
.dir-clarification-block__title {
  font-size: 11px;
  font-weight: 700;
  color: #c2410c;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.dir-clarification-row {
  font-size: 13px;
  color: var(--text, #1d1d1f);
  padding: 2px 0;
}

/* Кнопка «Отправить повторно» у директора */
.dir-btn-resend {
  background: #c2410c; color: #fff; border: none;
  border-radius: 8px; padding: 8px 18px; font-size: 13px; font-weight: 600; cursor: pointer; transition: background 0.15s;
}
.dir-btn-resend:hover { background: #9a3412; }

/* Комментарий исполнения в dept-карточке */
.dept-order-card__fc-row {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}
.dept-order-fc-input {
  flex: 1;
  font-size: 13px;
  padding: 6px 10px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
}
.dept-order-fc-input:focus { border-color: var(--brand); }
.dept-order-fc-input::placeholder { color: var(--text-tertiary); }
.dept-order-fc-ok {
  font-size: 12px;
  color: #27ae60;
  opacity: 0;
  transition: opacity 0.3s;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Shelf type rows (panel-shelves) ─────────────────────────────────────── */
.shelf-type-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.shelf-type-row:last-child { border-bottom: none; }
.shelf-type-row__name {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shelf-type-row__meta {
  font-size: 12px;
  color: var(--text-tertiary);
  white-space: nowrap;
  flex-shrink: 0;
}
.shelf-type-row__select {
  width: 190px;
  height: 36px;
  font-size: 13px;
  padding: 4px 8px;
  flex-shrink: 0;
}
.shelf-type-row__ok {
  font-size: 14px;
  color: #27ae60;
  opacity: 0;
  transition: opacity 0.3s;
  flex-shrink: 0;
  min-width: 18px;
}

/* ── Item list classes (overrides inline styles in renderDeptOrderCard) ───── */
.doi-id  { font-family: monospace; font-size: 11px; color: var(--text-secondary); min-width: 110px; flex-shrink: 0; }
.doi-name{ flex: 1; font-size: 13px; padding: 0 8px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Dept action buttons row ─────────────────────────────────────────────── */
.dept-order-card__actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
}

/* ── Onboarding banners ──────────────────────────────────────────────────── */
.admin-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  background: var(--brand-faint);
  border: 1px solid var(--brand-faint2);
  border-radius: var(--radius-lg, 16px);
  margin-bottom: 12px;
}
.admin-banner__icon {
  font-size: 22px;
  flex-shrink: 0;
  width: 44px; height: 44px;
  background: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
[data-theme="dark"] .admin-banner__icon { background: var(--surface2); }
.admin-banner__body { flex: 1; }
.admin-banner__title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}
.admin-banner__text {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}
.admin-banner__foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}
.admin-banner__btn {
  padding: 7px 20px;
  border-radius: 20px;
  background: var(--brand, #a01671);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s;
  touch-action: manipulation;
}
.admin-banner__btn:hover { opacity: 0.88; }
.admin-banner__btn:disabled { opacity: 0.5; cursor: default; }
.admin-banner__close {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: none;
  border: 1.5px solid var(--border);
  color: var(--text-tertiary);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
  touch-action: manipulation;
  flex-shrink: 0;
}
.admin-banner__close:hover { background: var(--border); }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {

  /* ── Header: nav wraps to second row ──────────────────────────────────── */
  .admin-header {
    height: auto;
    min-height: 54px;
    flex-wrap: wrap;
    padding: 8px 14px 0;
    gap: 8px;
    align-items: center;
  }
  .admin-header__logo img { height: 24px; }
  .admin-header__nav {
    order: 10;            /* below other elements */
    flex-basis: 100%;
    margin: 0 -14px;      /* bleed to header edges */
    padding: 6px 14px 8px;
    border-top: 1px solid var(--border);
    gap: 4px;
  }
  .admin-nav-btn {
    padding: 8px 14px;
    font-size: 13px;
    min-height: 36px;
    touch-action: manipulation;
  }
  .admin-header__actions { margin-left: auto; gap: 4px; }
  #logout-btn { font-size: 13px; padding: 5px 12px; }

  /* ── Content area: account for taller header ──────────────────────────── */
  .admin-wrap {
    padding: 16px 12px 60px;
    padding-top: 120px;   /* header ~54px + nav ~48px + gap */
  }
  .admin-card { padding: 14px 12px; }

  /* ── Stats grid ───────────────────────────────────────────────────────── */
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px; }
  .stat-card { padding: 14px 10px; }
  .stat-card__num { font-size: 26px; }

  /* ── Settings ─────────────────────────────────────────────────────────── */
  .settings-row { flex-direction: column; gap: 10px; }
  .settings-row__control { width: 100%; }

  /* ── Pending photos ───────────────────────────────────────────────────── */
  .pending-item { flex-wrap: wrap; }
  .pending-item__actions { width: 100%; }
  .pending-item__actions .btn { flex: 1; }

  /* ── Login card ───────────────────────────────────────────────────────── */
  .login-card { padding: 28px 20px; }

  /* ── Dept order card ──────────────────────────────────────────────────── */
  .dept-order-card { padding: 12px; }

  /* Items list: stack ID + name vertically */
  .dept-order-card__item {
    flex-wrap: wrap;
    gap: 1px;
    padding: 6px 0;
    align-items: flex-start;
  }
  .doi-id {
    min-width: auto;
    width: auto;
    order: 1;
    font-size: 10px;
    color: var(--text-tertiary);
  }
  .doi-name {
    order: 3;
    flex-basis: 100%;   /* full row */
    padding: 0;
    white-space: normal; /* allow wrap */
    font-size: 13px;
    color: var(--text);
  }
  .dept-order-card__item-qty {
    order: 2;
    margin-left: auto;
    font-size: 13px;
    font-weight: 700;
    color: var(--brand);
  }

  /* Action buttons: full width, larger tap targets */
  .dept-order-card__actions {
    flex-direction: column;
    gap: 8px;
  }
  .dept-order-action-btn {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    text-align: center;
    touch-action: manipulation;
  }

  /* Filter buttons: larger tap area */
  .dept-filter-btn {
    padding: 8px 16px;
    font-size: 13px;
    min-height: 36px;
    touch-action: manipulation;
  }

  /* Shelf type select: full width */
  .shelf-type-row { flex-wrap: wrap; }
  .shelf-type-row__select { width: 100%; }
}
