/* ==========================================================================
   Дизайн-система платформы совместных закупок
   Минимализм + зелёный акцент, mobile-first, без фреймворков.
   ========================================================================== */

/* --- Токены --- */
:root {
  --bg: #f8faf9;
  --surface: #ffffff;
  --text: #1b2a20;
  --muted: #6b7280;
  --accent: #16a34a;
  --accent-hover: #15803d;
  --accent-bg: #dcfce7;
  --border: #e5e7eb;
  --danger: #dc2626;
  --info: #2563eb;
  --radius-card: 12px;
  --radius-btn: 8px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
}

/* --- Сброс и база --- */
* { box-sizing: border-box; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

h1 { font-size: 1.5rem; margin: 0 0 1rem; }
h2 { font-size: 1.15rem; margin: 1.5rem 0 0.75rem; }

.cat-title {
  font-size: 0.95rem;
  color: var(--muted);
  margin: 1.25rem 0 0.5rem;
  font-weight: 600;
}

.progress {
  height: 8px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin: 0.5rem 0;
}
.progress__bar {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.3s;
}

.pack__bar {
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin: 0.2rem 0;
  min-width: 4rem;
}
.pack__fill { height: 100%; background: var(--accent); border-radius: 999px; }
.pack__meta { font-size: 0.78rem; color: var(--muted); white-space: nowrap; }

/* --- Лента-карусель (Сбор / Каталог) --- */
.carousel-wrap { position: relative; }
.carousel {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding: 0.25rem 0.1rem;
}
.carousel::-webkit-scrollbar { display: none; }
.carousel > .card { flex: 0 0 220px; scroll-snap-align: start; }
.carousel-wrap .carousel__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: var(--surface);
  color: var(--accent);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
  transition: background 0.2s, color 0.2s;
}
.carousel-wrap .carousel__arrow:hover {
  background: var(--accent);
  color: #fff;
}
.carousel-wrap .carousel__arrow--prev { left: 0; }
.carousel-wrap .carousel__arrow--next { right: 0; }
.catalog-content { min-width: 0; }

/* --- Профиль: секции и сегментированные переключатели --- */
.profile-sections {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-items: start;
}
@media (max-width: 820px) {
  .profile-sections { grid-template-columns: 1fr; }
}
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 1rem;
}
.panel > h2 { margin-top: 0; font-size: 1.05rem; }
.profile-name { font-size: 1.05rem; margin: 0.25rem 0 0.75rem; }
.view-settings { display: flex; flex-direction: column; gap: 0.9rem; }
.view-setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.view-setting__label { font-weight: 500; }
.segmented {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  background: var(--bg);
}
.segmented__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
  transition: background 0.15s, color 0.15s;
}
.segmented__btn svg { width: 1rem; height: 1rem; }
.segmented__btn.is-active { background: var(--accent); color: #fff; }
.segmented__btn:not(.is-active):hover { background: var(--accent-bg); color: var(--accent-hover); }

/* Иконка переключателя вида: показываем ту, что соответствует действию */
.view-toggle .vt-grid, .view-toggle .vt-carousel { display: none; align-items: center; }
.view-toggle[data-view="carousel"] .vt-grid { display: inline-flex; }
.view-toggle[data-view="grid"] .vt-carousel { display: inline-flex; }

.catalog-controls {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.catalog-controls input, .catalog-controls select {
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
}
.catalog-controls input { flex: 1; min-width: 160px; }

.stepper { display: inline-flex; align-items: center; gap: 0.35rem; }
.stepper__btn {
  width: 1.6rem;
  height: 1.6rem;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  padding: 0;
}
.stepper__btn:hover { background: var(--bg); }

.cart-stepper { display: inline-flex; align-items: center; gap: 0.35rem; }
.cart-stepper .qty-value {
  width: 4.6rem;
  height: 1.7rem;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
  padding: 0 0.2rem;
}
.stepper .qty-value {
  width: 4.6rem;
  height: 1.7rem;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
  padding: 0 0.2rem;
}

/* Скрыть нативные стрелки у числовых полей */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type=number] {
  -moz-appearance: textfield;
  appearance: textfield;
}
.stepper__btn--add { border-radius: 6px; background: var(--accent); color: #fff; }
.stepper__btn--add:hover { background: var(--accent-hover); }

.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  height: 1.7rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1;
  padding: 0;
  color: var(--muted);
  margin-left: auto;
}
.share-btn:hover { color: var(--accent); border-color: var(--accent); }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  height: 1.7rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  padding: 0;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); background: var(--bg); }
.icon-btn svg { width: 0.9rem; height: 0.9rem; }
.icon-btn--danger:hover { color: var(--danger); border-color: var(--danger); }
.stepper__input {
  width: 3.5rem;
  height: 2rem;
  text-align: center;
  border: 1px solid var(--border);
  border-left: none;
  border-right: none;
  border-radius: 0;
}

#toast-container {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 100;
}

.catalog-layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 768px) {
  .catalog-layout { grid-template-columns: 1fr; }
}

.catalog-sidebar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 0.5rem;
}

.tree { list-style: none; margin: 0; padding: 0; }
.tree ul { list-style: none; margin: 0; padding-left: 1rem; }
.tree a {
  display: block;
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
  color: var(--text);
  font-size: 0.9rem;
}
.tree a:hover { background: var(--bg); text-decoration: none; }
.tree a.is-active { background: var(--accent-bg); color: var(--accent-hover); font-weight: 600; }

.tree details { margin: 0; }
.tree summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  border-radius: 6px;
}
.tree summary::-webkit-details-marker { display: none; }
.tree summary::marker { content: ''; }
.tree summary a { flex: 1; }
.tree details[open] > summary { background: var(--bg); }

.breadcrumb {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 1rem;
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { margin: 0 0.3rem; }

.acc {
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 0.4rem;
  background: var(--surface);
  overflow: hidden;
}
.acc__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.75rem;
  cursor: pointer;
  font-weight: 500;
  list-style: none;
}
.acc__summary::-webkit-details-marker { display: none; }
.acc__summary::before {
  content: '▸';
  margin-right: 0.5rem;
  transition: transform 0.2s;
  color: var(--muted);
}
.acc[open] > .acc__summary::before { transform: rotate(90deg); }
.acc__link { font-size: 0.9rem; }
.acc__body { padding: 0 0.75rem 0.75rem 1.25rem; }
.toast {
  background: var(--text);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s, transform 0.3s;
  box-shadow: var(--shadow);
  max-width: 320px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.toast--show { opacity: 1; transform: translateY(0); }
.toast__btn {
  background: none;
  border: none;
  color: #86efac;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}
.toast__btn:hover { text-decoration: underline; }

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 1.25rem 1rem;
}

.muted { color: var(--muted); font-size: 0.9rem; }

.empty {
  text-align: center;
  color: var(--muted);
  padding: 2.5rem 1rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
}
.error { color: var(--danger); }

/* --- Шапка --- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.topbar__inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand {
  font-weight: 700;
  font-size: 1.05rem;
}
.brand a { color: var(--text); }
.brand a:hover { text-decoration: none; }

.nav { display: flex; gap: 0.25rem; }
.nav a {
  color: var(--text);
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  font-weight: 500;
}
.nav a:hover { background: var(--bg); text-decoration: none; }
.nav a.is-active { background: var(--accent-bg); color: var(--accent-hover); }

.topbar__actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.username { font-weight: 600; color: var(--text); }
.username:hover { color: var(--accent); }

.search { position: relative; flex: 1; max-width: 340px; }
.search input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  background: var(--surface);
  color: var(--text);
}
.search input:focus { outline: 2px solid var(--accent-bg); border-color: var(--accent); }
.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 0.3rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  max-height: 320px;
  overflow-y: auto;
  display: none;
  z-index: 20;
}
.search-results.is-open { display: block; }
.search-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  color: var(--text);
  font-size: 0.9rem;
}
.search-item:hover { background: var(--bg); text-decoration: none; }
.search-item__img { width: 2rem; height: 2rem; object-fit: cover; border-radius: 4px; flex-shrink: 0; }
.search-item__name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-item__price { font-weight: 600; white-space: nowrap; }

.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  background: var(--accent-bg);
  color: var(--accent-hover);
}
.badge--muted { background: #f3f4f6; color: var(--muted); }
.badge--danger { background: #fee2e2; color: var(--danger); }
.badge--info { background: #dbeafe; color: var(--info); }

/* Бургер (мобильная навигация) */
.burger {
  display: none;
  margin-left: auto;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.4rem 0.6rem;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--text);
}

@media (max-width: 640px) {
  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 0.5rem;
  }
  .nav.is-open { display: flex; }
  .burger { display: block; }
  .topbar__actions .username { display: none; }
}

/* --- Кнопки --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.9rem;
  border: 1px solid transparent;
  border-radius: var(--radius-btn);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
}
.btn:hover { background: var(--accent-hover); text-decoration: none; }
.btn--secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
.btn--secondary:hover { background: var(--bg); }
.btn--danger { background: var(--danger); }
.btn--sm { padding: 0.3rem 0.6rem; font-size: 0.85rem; }

.btn-link {
  background: none;
  border: none;
  color: var(--accent);
  font: inherit;
  cursor: pointer;
  padding: 0;
}
.btn-link:hover { text-decoration: underline; }

/* --- Формы --- */
.form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 400px;
}
.form label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.9rem;
  color: var(--muted);
}
.form input, .form select, .form textarea {
  padding: 0.55rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  font: inherit;
  color: var(--text);
  background: var(--surface);
}
.form input:focus, .form select:focus, .form textarea:focus {
  outline: none;
  border-color: var(--text);
}
.form .checkbox {
  flex-direction: row;
  align-items: center;
  gap: 0.4rem;
}

/* --- Сетка карточек --- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
}

/* --- Карточка (товар / закупка / поставщик) --- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.card a.card__link { color: inherit; }
.card a.card__link:hover { text-decoration: none; }
.card__link { display: flex; flex-direction: column; flex: 1; color: inherit; text-decoration: none; }
.card__link:hover .card__title { color: var(--accent); }
.card__body--actions { padding-top: 0; }
.collection-meta {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  font-size: 0.85rem;
  margin-bottom: 0.3rem;
}

.card__img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: #f3f4f6;
}

.card__body { padding: 0.75rem; display: flex; flex-direction: column; gap: 0.4rem; flex: 1; text-align: center; }
.card__desc {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-align: left;
}

.card__title {
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card__price { font-weight: 700; font-size: 1.05rem; }

.card__meta { color: var(--muted); font-size: 0.85rem; }

.card__foot { margin-top: auto; display: flex; gap: 0.3rem; flex-wrap: wrap; justify-content: center; }

/* --- Таблицы --- */
.table-wrap { overflow-x: auto; }

.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
}
.table th, .table td {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table th { font-weight: 600; color: var(--muted); font-size: 0.85rem; }
.table tr:last-child td { border-bottom: none; }

.thumb {
  height: 2.25rem;
  width: 2.25rem;
  object-fit: cover;
  border-radius: 6px;
  vertical-align: middle;
  margin-right: 0.4rem;
}

/* --- Блоки --- */
.order, .act {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 1rem;
  margin-bottom: 1rem;
}

.actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin: 1rem 0;
  flex-wrap: wrap;
}

.inline { display: inline; }

.result {
  background: var(--accent-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
}

.total { margin: 0.5rem 0; text-align: right; }

.order-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  margin: 0.5rem 0;
}

.act-totals {
  margin-top: 0.75rem;
  padding-right: 0.75rem;
}
.act-total-row {
  display: flex;
  justify-content: flex-end;
  align-items: baseline;
  gap: 1rem;
}
.act-total-row .lbl { color: var(--muted); }
.act-total-row .val {
  min-width: 90px;
  text-align: right;
  font-weight: 600;
}

.act-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

/* --- Печать актов выдачи --- */
@media print {
  .topbar,
  .nav,
  .burger,
  .topbar__actions,
  .print-hide {
    display: none !important;
  }
  .container {
    max-width: none;
    margin: 0;
    padding: 0;
  }
  .act {
    border: none;
    box-shadow: none;
    border-radius: 0;
  }
}

.add-item {
  display: none;
  gap: 0.4rem;
  align-items: center;
  margin: 0.5rem 0;
  flex-wrap: wrap;
}
.add-item.is-open { display: flex; }
.add-item select, .add-item input {
  padding: 0.4rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
}
.order-foot .toggle-add { margin-right: auto; }

/* Счётчик количества в строке */
.qty-input { width: 5.8rem; padding: 0.3rem; border: 1px solid var(--border); border-radius: 6px; font: inherit; }
select.qty-input { width: auto; min-width: 4.2rem; }
.inline-fields { display: flex; gap: 0.5rem; align-items: center; }
.inline-fields input { flex: 1; }
.inline-fields select { width: auto; }
.row-actions { white-space: nowrap; }

/* --- Кнопки внутри форм и панелей действий (совместимость) --- */
.form button:not(.password-toggle) {
  padding: 0.55rem 0.9rem;
  border: 1px solid transparent;
  border-radius: var(--radius-btn);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
}
.form button:not(.password-toggle):hover { background: var(--accent-hover); }

.actions button:not(.icon-btn) {
  padding: 0.5rem 0.75rem;
  border: 1px solid transparent;
  border-radius: var(--radius-btn);
  background: var(--accent);
  color: #fff;
  font: inherit;
  cursor: pointer;
}
.actions button.danger { background: var(--danger); }
.actions input[type="datetime-local"] {
  padding: 0.4rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
}

.order h2 { font-size: 1.1rem; margin-top: 0; }

.order-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}
.order-row:last-child { border-bottom: none; }
.order-row__name {
  flex: 1;
  min-width: 0;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.order-row__sum {
  width: 80px;
  text-align: right;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}
.order-row__qty { color: var(--muted); min-width: 3rem; text-align: center; }

.items-group { margin-bottom: 1.25rem; }
.items-group__head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.check-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.check-item__img { width: 2rem; height: 2rem; object-fit: cover; border-radius: 4px; flex-shrink: 0; }
.check-item__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.check-item__price { font-weight: 600; white-space: nowrap; }

.price-edit { display: inline-flex; align-items: center; gap: 0.3rem; }
.price-input {
  width: 5rem;
  padding: 0.3rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
}

@media (max-width: 520px) {
  .order-row { flex-wrap: wrap; }
  .order-row__name {
    flex-basis: 100%;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }
}

.order-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.order-head__title { font-weight: 600; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }

.act-link { font-size: 0.85rem; font-weight: 400; margin-left: 0.5rem; }

.add-item button {
  padding: 0.4rem 0.6rem;
  border: 1px solid transparent;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  cursor: pointer;
}
.add-item button:hover { background: var(--accent-hover); }

/* --- Публичная карточка товара --- */
.public-product {
  max-width: 480px;
  margin: 0 auto;
}
.public-product__img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius-card);
  background: #f3f4f6;
}
.public-product__link {
  color: inherit;
  text-decoration: none;
}
.public-product__link:hover h1 { color: var(--accent); }

/* --- Поле пароля с кнопкой «показать/скрыть» --- */
.password-field { position: relative; }
.password-field input { width: 100%; padding-right: 2rem; }
.password-toggle {
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  color: var(--muted);
  opacity: 0.6;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  outline: none;
  box-shadow: none;
  appearance: none;
  -webkit-appearance: none;
}
.password-toggle:hover { opacity: 1; color: var(--text); }
.password-toggle:focus,
.password-toggle:focus-visible,
.password-toggle:active { outline: none; box-shadow: none; }
.password-toggle svg { width: 1.1rem; height: 1.1rem; display: block; }
/* Состояние: скрыт → перечёркнутый глаз; виден → открытый глаз. */
.password-field .pw-eye { display: none; }
.password-field .pw-eye-off { display: block; }
.password-field.is-shown .pw-eye { display: block; }
.password-field.is-shown .pw-eye-off { display: none; }

/* --- Скрываемая форма смены пароля --- */
#password-form { display: none; }
#password-form.is-open { display: block; }

/* --- Закладки (табы) разделов пристроя --- */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 16px;
}
.tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 999px;
  background: #fff;
  color: var(--text, #111827);
  font-size: 0.9rem;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.tab:hover {
  border-color: var(--accent, #16a34a);
  color: var(--accent, #16a34a);
}
.tab.is-active {
  background: var(--accent, #16a34a);
  border-color: var(--accent, #16a34a);
  color: #fff;
}
.tab__count {
  font-size: 0.78rem;
  opacity: 0.75;
}
.tab.is-active .tab__count { opacity: 1; }
.tab--sort { padding: 7px 12px; }
.tab--sort svg { width: 1rem; height: 1rem; display: block; }

/* --- Уведомления организатора --- */
.notif-list { list-style: none; margin: 1rem 0; padding: 0; }
.notif { border-bottom: 1px solid var(--border); }
.notif:last-child { border-bottom: none; }
.notif__link {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.7rem 0.5rem; text-decoration: none; color: var(--text); border-radius: 6px;
}
.notif__link:hover { background: var(--accent-bg); }
.notif__time { white-space: nowrap; font-size: 0.85rem; }
.notif--unread .notif__text { font-weight: 600; }
.notif--unread .notif__text::before { content: '● '; color: var(--accent); }

/* --- Иконки в шапке (заказы, уведомления) --- */
.header-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 8px;
  color: var(--text);
}
.header-icon:hover { background: var(--bg); color: var(--accent); }
.header-icon svg { width: 1.2rem; height: 1.2rem; }
.icon-count {
  position: absolute;
  top: -3px;
  right: -5px;
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.1rem;
  text-align: center;
  box-shadow: 0 0 0 2px var(--surface);
}
.icon-count:empty { display: none; }
