:root {
  --parchment: oklch(96% 0.015 80);
  --parchment-mid: oklch(92% 0.022 75);
  --parchment-deep: oklch(87% 0.030 72);
  --walnut: oklch(30% 0.040 55);
  --walnut-light: oklch(42% 0.042 52);
  --ink: oklch(22% 0.025 60);
  --gold: oklch(68% 0.095 72);
  --gold-light: oklch(80% 0.065 72);
  --gold-muted: oklch(75% 0.055 72);
  --sage: oklch(60% 0.040 155);
  --rose-dust: oklch(72% 0.040 20);
  --shadow-soft: 0 2px 18px oklch(30% 0.04 55 / 0.10);
  --shadow-card: 0 4px 28px oklch(30% 0.04 55 / 0.13);
  --border: oklch(85% 0.025 72);
  --radius: 6px;
  --radius-lg: 12px;
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans: 'Lato', 'Helvetica Neue', sans-serif;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: var(--parchment); color: var(--ink); font-family: var(--font-sans); font-size: 15px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
::selection { background: var(--gold-light); color: var(--walnut); }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--parchment-mid); }
::-webkit-scrollbar-thumb { background: var(--parchment-deep); border-radius: 3px; }

/* ── App header ── */
.app-header {
  background: var(--walnut);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 58px;
  flex-shrink: 0;
  box-shadow: 0 2px 12px oklch(22% 0.03 60 / 0.22);
  position: sticky;
  top: 0;
  z-index: 200;
}
.app-header__left { display: flex; align-items: center; }
.app-header__brand {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--gold-light);
  text-decoration: none;
}
.app-header__nav { display: flex; gap: 4px; margin-left: 28px; }
.app-header__nav-link {
  background: transparent;
  border: none;
  color: oklch(96% 0.015 80 / 0.65);
  font-family: var(--font-sans);
  font-size: 13px;
  letter-spacing: 0.05em;
  padding: 6px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  display: inline-block;
}
.app-header__nav-link:hover, .app-header__nav-link.active {
  background: oklch(100% 0 0 / 0.10);
  color: var(--gold-light);
}
.app-header__user { display: flex; align-items: center; gap: 12px; }
.app-header__username { font-size: 13px; color: oklch(96% 0.015 80 / 0.65); }
.app-header__signout {
  background: none;
  border: 1px solid oklch(100% 0 0 / 0.20);
  color: oklch(96% 0.015 80 / 0.70);
  border-radius: var(--radius);
  font-size: 11px;
  padding: 5px 12px;
  cursor: pointer;
  font-family: var(--font-sans);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  transition: all 0.15s;
}
.app-header__signout:hover { border-color: oklch(100% 0 0 / 0.40); color: var(--parchment); }

/* ── Avatar ── */
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--walnut-light);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

/* ── Page content ── */
.page-content { max-width: 1100px; margin: 0 auto; padding: 32px 24px; }

/* ── Cards ── */
.card {
  background: var(--parchment);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  transition: box-shadow 0.18s ease;
}
.card:hover { box-shadow: var(--shadow-card); }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  cursor: pointer;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: all 0.18s ease;
  text-decoration: none;
  font-size: 12px;
  padding: 9px 22px;
  line-height: 1;
}
.btn-primary { background: var(--walnut); color: var(--parchment); }
.btn-primary:hover { background: var(--walnut-light); color: var(--parchment); }
.btn-secondary { background: transparent; color: var(--walnut); border: 1px solid var(--walnut); }
.btn-ghost { background: transparent; color: var(--walnut-light); border: 1px solid var(--border); }
.btn-gold { background: var(--gold); color: var(--walnut); }
.btn-danger { background: oklch(45% 0.07 20); color: var(--parchment); }
.btn-lg { font-size: 13px; padding: 12px 30px; }
.btn-sm { font-size: 11px; padding: 6px 14px; }
.btn:disabled { opacity: 0.45; cursor: default; }

/* ── Inputs ── */
.form-label {
  font-size: 12px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--walnut-light);
  font-weight: 400;
  display: block;
  margin-bottom: 6px;
}
.form-input {
  background: var(--parchment-mid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 13px;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
}
.form-input:focus { border-color: var(--gold); }

/* ── Divider ── */
.divider { border: none; border-bottom: 1px solid var(--border); }

/* ── Tags ── */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 100px;
  background: var(--parchment-deep);
  color: var(--walnut-light);
  font-size: 12px;
  border: 1px solid var(--border);
}
.tag.active { background: var(--gold); color: var(--walnut); border-color: var(--gold); }

/* ── Alert ── */
.alert-error {
  background: oklch(95% 0.015 20);
  border: 1px solid var(--rose-dust);
  color: oklch(35% 0.04 20);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 14px;
}

/* ── Page structure ── */
.page-header { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 28px; gap: 16px; }
.page-title { font-family: var(--font-serif); font-size: 30px; font-weight: 500; color: var(--walnut); line-height: 1.2; }
.back-link { font-size: 13px; color: var(--walnut-light); text-decoration: none; letter-spacing: 0.02em; }
.back-link:hover { color: var(--walnut); }
.form-hint { font-size: 12px; color: var(--walnut-light); opacity: 0.75; margin-top: 5px; }
.field-error { font-size: 12px; color: var(--rose-dust); display: block; margin-top: 4px; }
.form-card { background: var(--parchment); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; margin-bottom: 20px; }
.form-section-title { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--walnut-light); font-weight: 400; margin-bottom: 18px; }
.form-group { margin-bottom: 20px; }
.form-group:last-child { margin-bottom: 0; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-textarea { resize: vertical; min-height: 96px; }
.form-select { appearance: none; background-image: url("data:image/svg+xml,%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' stroke='%235C3D2E' stroke-width='1.5' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
.form-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 8px; padding-top: 8px; }
.empty-state { text-align: center; padding: 80px 24px; }
.empty-state__icon { font-size: 32px; color: var(--gold); margin-bottom: 16px; }
.empty-state__text { color: var(--walnut-light); font-size: 15px; }

/* ── Item grid ── */
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.filter-chip { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 100px; font-size: 12px; letter-spacing: 0.03em; border: 1px solid var(--border); background: var(--parchment-deep); color: var(--walnut-light); cursor: pointer; text-decoration: none; transition: all 0.15s; }
.filter-chip:hover { border-color: var(--gold); color: var(--walnut); }
.filter-chip.active { background: var(--gold); color: var(--walnut); border-color: var(--gold); }
.filter-chip--toggle { border-style: dashed; }
.filter-chip--toggle.active { background: var(--walnut-light); border-color: var(--walnut-light); color: var(--cream); border-style: solid; }
.item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.item-card { background: var(--parchment); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-soft); overflow: hidden; transition: box-shadow 0.18s ease, transform 0.18s ease; text-decoration: none; display: block; color: inherit; }
.item-card:hover { box-shadow: var(--shadow-card); transform: translateY(-2px); }
.item-card__image { aspect-ratio: 4/3; width: 100%; object-fit: cover; display: block; background: var(--parchment-deep); }
.item-card__placeholder { aspect-ratio: 4/3; width: 100%; background: var(--parchment-deep); display: flex; align-items: center; justify-content: center; color: var(--gold-muted); font-size: 36px; }
.item-card__body { padding: 16px; }
.item-card__meta { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.item-card__name { font-family: var(--font-serif); font-size: 16px; font-weight: 500; color: var(--walnut); margin-bottom: 6px; line-height: 1.3; }
.item-card__desc { font-size: 13px; color: var(--walnut-light); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 10px; line-height: 1.5; }
.item-card__era { font-size: 12px; color: var(--walnut-light); opacity: 0.7; }
.item-card__tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }

/* ── Condition badges ── */
.condition-badge { font-size: 11px; padding: 2px 9px; border-radius: 100px; letter-spacing: 0.04em; border: 1px solid transparent; display: inline-block; }
.condition-excellent { background: oklch(90% 0.04 155); color: oklch(35% 0.06 155); border-color: oklch(72% 0.05 155); }
.condition-good { background: oklch(93% 0.04 72); color: oklch(42% 0.07 72); border-color: oklch(76% 0.06 72); }
.condition-fair { background: var(--parchment-deep); color: var(--walnut-light); border-color: var(--border); }
.condition-poor { background: oklch(93% 0.02 20); color: oklch(38% 0.05 20); border-color: oklch(72% 0.04 20); }

/* ── Status badges ── */
.detail-status { font-size: 11px; padding: 2px 9px; border-radius: 100px; letter-spacing: 0.04em; border: 1px solid transparent; }
.status-available { background: oklch(93% 0.04 72); color: oklch(42% 0.07 72); border-color: oklch(76% 0.06 72); }
.status-invoting { background: oklch(88% 0.03 245); color: oklch(38% 0.05 245); border-color: oklch(68% 0.05 245); }
.status-awarded { background: oklch(90% 0.04 155); color: oklch(35% 0.06 155); border-color: oklch(72% 0.05 155); }

/* ── Item detail ── */
.detail-carousel { margin-bottom: 24px; }
.detail-carousel__main { position: relative; border-radius: var(--radius-lg); overflow: hidden; height: 420px; background: var(--parchment); }
.detail-carousel__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.25s; pointer-events: none; }
.detail-carousel__img.active { opacity: 1; pointer-events: auto; }
.detail-carousel__btn { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(61,43,31,0.5); color: #fff; border: none; border-radius: 50%; width: 44px; height: 44px; font-size: 26px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background 0.15s; z-index: 2; }
.detail-carousel__btn:hover { background: rgba(61,43,31,0.82); }
.detail-carousel__btn--prev { left: 14px; }
.detail-carousel__btn--next { right: 14px; }
.detail-carousel__thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.detail-carousel__thumb { width: 72px; height: 72px; border-radius: var(--radius); overflow: hidden; border: 2px solid transparent; transition: border-color 0.15s; cursor: pointer; background: none; padding: 0; flex-shrink: 0; }
.detail-carousel__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.detail-carousel__thumb.active { border-color: var(--gold); }
.detail-body { padding: 8px 0; }
.detail-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.detail-title { font-family: var(--font-serif); font-size: 30px; font-weight: 600; color: var(--walnut); line-height: 1.2; margin-bottom: 10px; }
.detail-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.detail-era { font-size: 13px; color: var(--walnut-light); }
.detail-description { font-size: 15px; color: var(--ink); line-height: 1.7; margin-bottom: 4px; }
.detail-fields { display: flex; gap: 32px; flex-wrap: wrap; }
.detail-field dt { font-size: 12px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--walnut-light); margin-bottom: 4px; }
.detail-field dd { font-size: 15px; color: var(--ink); }

/* ── Image upload ── */
.upload-area { border: 2px dashed var(--border); border-radius: var(--radius-lg); padding: 40px 24px; text-align: center; cursor: pointer; transition: all 0.15s; background: var(--parchment-mid); position: relative; }
.upload-area:hover, .upload-area.drag-over { border-color: var(--gold); background: oklch(94% 0.018 72); }
.upload-area input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.upload-area__label { pointer-events: none; }
.upload-area__icon { font-size: 26px; margin-bottom: 8px; color: var(--walnut-light); display: block; }
.upload-area__text { font-size: 14px; color: var(--walnut-light); }
.upload-area__hint { font-size: 12px; color: var(--walnut-light); opacity: 0.65; margin-top: 5px; }
.image-preview-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.image-preview-item { width: 80px; height: 80px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.image-preview-item img { width: 100%; height: 100%; object-fit: cover; }
.existing-images-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.existing-image-item { position: relative; width: 100px; height: 100px; border-radius: var(--radius); overflow: visible; }
.existing-image-item img { width: 100px; height: 100px; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--border); display: block; }
.primary-badge { position: absolute; bottom: -8px; left: 50%; transform: translateX(-50%); background: var(--gold); color: var(--walnut); font-size: 9px; padding: 2px 7px; border-radius: 100px; white-space: nowrap; letter-spacing: 0.05em; }
.image-remove-btn { position: absolute; top: -7px; right: -7px; width: 22px; height: 22px; border-radius: 50%; background: oklch(45% 0.07 20); color: white; border: none; cursor: pointer; font-size: 11px; display: flex; align-items: center; justify-content: center; line-height: 1; }

/* ── Tag input ── */
.tag-input-section { position: relative; }
.tag-input-wrap { border: 1px solid var(--border); border-radius: var(--radius); background: var(--parchment-mid); padding: 6px 10px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; transition: border-color 0.15s; min-height: 44px; cursor: text; }
.tag-input-wrap:focus-within { border-color: var(--gold); }
.tag-pills { display: contents; }
.tag-input-wrap .tag { display: inline-flex; align-items: center; gap: 4px; }
.tag-input-wrap input[type="text"] { border: none; background: transparent; outline: none; font-family: var(--font-sans); font-size: 14px; color: var(--ink); flex: 1; min-width: 100px; padding: 2px 0; }
.tag-remove { background: none; border: none; cursor: pointer; color: var(--walnut-light); padding: 0 0 0 2px; font-size: 13px; line-height: 1; opacity: 0.7; }
.tag-remove:hover { opacity: 1; }
.tag-suggestions { display: none; position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: var(--parchment); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-card); z-index: 120; max-height: 180px; overflow-y: auto; }
.tag-suggestions.open { display: block; }
.tag-suggestion-item { padding: 9px 14px; font-size: 14px; color: var(--ink); cursor: pointer; transition: background 0.1s; }
.tag-suggestion-item:hover, .tag-suggestion-item.focused { background: var(--parchment-mid); }

/* ── Groups / batches ── */
.page-subtitle { font-size: 14px; color: var(--walnut-light); margin-top: 4px; }
.batch-list { display: flex; flex-direction: column; gap: 16px; }
.batch-card { background: var(--parchment); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px 24px; box-shadow: var(--shadow-soft); transition: box-shadow 0.18s; }
.batch-card--open { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), var(--shadow-soft); }
.batch-card__header { margin-bottom: 14px; }
.batch-card__title-row { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.batch-card__name { font-family: var(--font-serif); font-size: 20px; color: var(--walnut); }
.batch-status { font-size: 11px; letter-spacing: 0.07em; text-transform: uppercase; padding: 2px 9px; border-radius: 100px; border: 1px solid transparent; }
.batch-status--draft { background: var(--parchment-deep); color: var(--walnut-light); border-color: var(--border); }
.batch-status--open { background: oklch(92% 0.04 72); color: oklch(42% 0.07 72); border-color: oklch(76% 0.06 72); }
.batch-status--closed { background: var(--parchment-deep); color: var(--walnut-light); border-color: var(--border); }
.batch-status--awarded { background: oklch(90% 0.04 155); color: oklch(35% 0.06 155); border-color: oklch(72% 0.05 155); }
.batch-card__meta { font-size: 13px; color: var(--walnut-light); }
.batch-card__items { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.batch-item-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--parchment-mid); border: 1px solid var(--border); border-radius: var(--radius); padding: 4px 10px; font-size: 12px; color: var(--walnut-light); }
.batch-item-chip img { width: 20px; height: 20px; object-fit: cover; border-radius: 3px; }
.batch-item-chip--more { color: var(--walnut-light); opacity: 0.65; }
.batch-card__actions { display: flex; gap: 10px; align-items: center; }
.form-section-count { float: right; font-size: 12px; color: var(--gold); text-transform: none; letter-spacing: 0; font-weight: 400; }

/* ── Item select grid (Groups form) ── */
.item-select-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.item-select-card { display: flex; flex-direction: column; border: 2px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s; position: relative; background: var(--parchment); }
.item-select-card:hover { border-color: var(--gold-muted); }
.item-select-card.selected,
.item-select-card:has(.item-select-checkbox:checked) { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.item-select-thumb { width: 100%; aspect-ratio: 4/3; object-fit: cover; background: var(--parchment-deep); display: block; }
.item-select-thumb--placeholder { aspect-ratio: 4/3; display: flex; align-items: center; justify-content: center; font-size: 24px; color: var(--gold-muted); background: var(--parchment-deep); }
.item-select-info { padding: 8px 10px; flex: 1; }
.item-select-name { font-size: 12px; color: var(--walnut); font-weight: 400; margin-bottom: 5px; line-height: 1.3; }
.item-select-check { position: absolute; top: 6px; right: 6px; width: 20px; height: 20px; background: var(--gold); color: var(--walnut); border-radius: 50%; display: none; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; }
.item-select-card.selected .item-select-check,
.item-select-card:has(.item-select-checkbox:checked) .item-select-check { display: flex; }

/* ── Vote page layout ── */
.vote-layout { display: grid; grid-template-columns: 1fr 220px; gap: 28px; max-width: 960px; margin: 0 auto; padding: 32px 24px; align-items: start; }
@media (max-width: 700px) { .vote-layout { grid-template-columns: 1fr; } .vote-sidebar { display: none; } }
.vote-main { min-width: 0; }
.vote-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.vote-close-info { text-align: right; flex-shrink: 0; }
.vote-instructions { font-size: 14px; color: var(--walnut-light); line-height: 1.6; margin-bottom: 24px; }
.vote-zone { margin-bottom: 8px; }
.vote-zone__label { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--walnut-light); margin-bottom: 8px; font-weight: 400; }
.vote-zone--ranked .vote-drop-area { min-height: 80px; }
.vote-zone--unranked { margin-top: 4px; }
.vote-zone--unranked .vote-zone__label { border-top: 1px solid var(--border); padding-top: 20px; margin-top: 12px; }
.vote-drop-area { border-radius: var(--radius-lg); padding: 4px; transition: background 0.15s; }
.vote-drop-area--empty { border: 2px dashed var(--border); padding: 20px; }
.vote-empty-hint { color: var(--walnut-light); font-size: 14px; text-align: center; padding: 16px 8px; }

/* ── Vote rows ── */
.vote-row { display: flex; align-items: center; gap: 10px; background: var(--parchment); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 12px; margin-bottom: 6px; transition: box-shadow 0.12s, border-color 0.12s; user-select: none; }
.vote-row:hover { box-shadow: var(--shadow-soft); }
.vote-row--unranked { background: var(--parchment-mid); }
.vote-row.sortable-ghost { opacity: 0.4; background: var(--parchment-deep); }
.vote-row.sortable-chosen { box-shadow: 0 0 0 2px var(--gold-light), var(--shadow-card); border-color: var(--gold-light); }
.drag-handle { color: var(--parchment-deep); cursor: grab; font-size: 16px; flex-shrink: 0; line-height: 1; }
.drag-handle:active { cursor: grabbing; }
.rank-badge { width: 22px; height: 22px; border-radius: 50%; background: var(--parchment-deep); color: var(--walnut-light); font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.rank-badge--gold { background: var(--gold); color: var(--walnut); }
.vote-row__thumb { width: 40px; height: 40px; object-fit: cover; border-radius: var(--radius); flex-shrink: 0; }
.vote-row__thumb--placeholder { width: 40px; height: 40px; background: var(--parchment-deep); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; font-size: 14px; color: var(--gold-muted); flex-shrink: 0; }
.vote-row__info { flex: 1; min-width: 0; }
.vote-row__name { font-size: 14px; color: var(--walnut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vote-row__meta { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; margin-top: 3px; }
.vote-row__era { font-size: 11px; color: var(--walnut-light); opacity: 0.7; }
.vote-row__detail-btn { flex-shrink: 0; opacity: 0.6; }
.vote-row__detail-btn:hover { opacity: 1; }
.vote-row__action { flex-shrink: 0; }

/* ── Vote sidebar ── */
.vote-sidebar { background: var(--parchment); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; position: sticky; top: 80px; box-shadow: var(--shadow-soft); }
.vote-sidebar__title { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--walnut-light); margin-bottom: 12px; }
.sidebar-item { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--border); }
.sidebar-item:last-child { border-bottom: none; }
.sidebar-rank { width: 18px; height: 18px; border-radius: 50%; background: var(--parchment-deep); color: var(--walnut-light); font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sidebar-name { font-size: 12px; color: var(--walnut); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-empty { font-size: 12px; color: var(--walnut-light); opacity: 0.65; text-align: center; padding: 8px 0; }
.vote-saved-indicator { font-size: 11px; color: var(--sage); margin-top: 10px; text-align: center; }

/* ── Phase 4: Awards — Admin ── */
.batch-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.batch-tab {
  background: var(--parchment); color: var(--walnut);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 8px 18px; font-size: 13px; text-decoration: none; cursor: pointer;
  transition: all 0.15s;
}
.batch-tab:hover { border-color: var(--gold-muted); }
.batch-tab--active { background: var(--walnut); color: var(--parchment); border-color: var(--walnut); }

.award-progress-bar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-bottom: 18px;
}
.award-progress-text { font-size: 14px; color: var(--walnut-light); flex-shrink: 0; }
.award-progress {
  flex: 1; min-width: 80px; max-width: 220px; height: 6px;
  appearance: none; border-radius: 100px; border: none; overflow: hidden;
  background: var(--parchment-deep);
}
.award-progress::-webkit-progress-bar { background: var(--parchment-deep); }
.award-progress::-webkit-progress-value { background: var(--sage); border-radius: 100px; }
.award-progress::-moz-progress-bar { background: var(--sage); }

.award-suggestion-banner {
  background: oklch(68% 0.095 72 / 0.10); border: 1px solid var(--gold-muted);
  border-radius: var(--radius-lg); padding: 14px 18px; margin-bottom: 20px;
  font-size: 13px; color: var(--walnut);
}

.award-list { display: flex; flex-direction: column; gap: 14px; }

.award-row {
  background: var(--parchment); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px 20px;
  display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap;
  transition: border-color 0.15s;
}
.award-row--awarded { border-color: var(--sage); }

.award-row__thumb {
  width: 64px; height: 64px; object-fit: cover;
  border-radius: var(--radius); flex-shrink: 0;
}
.award-row__thumb--placeholder {
  width: 64px; height: 64px; background: var(--parchment-deep);
  border-radius: var(--radius); display: flex; align-items: center;
  justify-content: center; font-size: 22px; color: var(--gold-muted); flex-shrink: 0;
}

.award-row__info { flex: 1; min-width: 200px; }
.award-row__name {
  font-family: var(--font-serif); font-size: 16px; font-weight: 500;
  color: var(--walnut); margin-bottom: 8px;
}

.vote-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.vote-chip {
  display: flex; align-items: center; gap: 5px;
  background: var(--parchment-mid); border-radius: 100px; padding: 3px 10px;
}
.vote-chip__name { font-size: 12px; color: var(--walnut); }
.vote-chip__rank { font-size: 11px; color: var(--gold); font-weight: 700; }
.vote-chips__empty { font-size: 12px; color: var(--walnut-light); font-style: italic; }

.avatar {
  border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; letter-spacing: 0.02em; color: white; flex-shrink: 0;
  font-family: var(--font-sans);
}
.avatar-xs { width: 20px; height: 20px; font-size: 8px; }
.avatar-sm { width: 28px; height: 28px; font-size: 11px; }

.award-suggestion-item {
  display: flex; align-items: center; gap: 8px; margin-top: 6px; flex-wrap: wrap;
}
.award-suggestion-label { font-size: 12px; color: var(--walnut-light); }

.award-status {
  display: flex; align-items: center; gap: 6px; margin-top: 6px; flex-wrap: wrap;
}
.award-status__label {
  font-size: 11px; color: var(--sage); font-weight: 700;
  letter-spacing: 0.05em; text-transform: uppercase;
}
.award-status__name { font-size: 13px; color: var(--walnut); }
.award-status__badge { font-size: 10px; padding: 2px 8px; border-radius: 100px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.award-status__badge--accepted { background: oklch(60% 0.040 155 / 0.15); color: var(--sage); }
.award-status__badge--pending { background: oklch(68% 0.095 72 / 0.15); color: var(--gold); }

.award-user-btns {
  display: flex; flex-direction: column; gap: 5px; flex-shrink: 0;
}
.award-user-btn {
  display: flex; align-items: center; gap: 7px;
  background: var(--parchment-mid); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 5px 12px; cursor: pointer;
  font-size: 12px; color: var(--walnut); font-family: var(--font-sans);
  transition: border-color 0.15s;
}
.award-user-btn:hover { border-color: var(--gold); }

.btn-link {
  background: none; border: none; cursor: pointer;
  font-size: 12px; color: var(--walnut-light); text-decoration: underline;
  font-family: var(--font-sans); padding: 0 4px;
}
.btn-link:hover { color: var(--walnut); }

/* ── Phase 4: Awards — Family member ── */
.awards-tabs {
  display: flex; gap: 0; border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
}
.awards-tab {
  padding: 10px 22px; font-size: 13px; color: var(--walnut-light);
  text-decoration: none; border-bottom: 2px solid transparent;
  margin-bottom: -1px; transition: all 0.15s; display: flex; align-items: center; gap: 6px;
}
.awards-tab:hover { color: var(--walnut); }
.awards-tab--active { color: var(--walnut); border-bottom-color: var(--gold); }
.awards-tab__count {
  background: var(--gold); color: var(--walnut);
  font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 100px;
}
.awards-tab__count--confirmed { background: var(--sage); color: white; }

.my-awards-list { display: flex; flex-direction: column; gap: 16px; }
.my-award-row {
  background: var(--parchment); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px 20px;
  display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap;
}
.my-award-row__thumb {
  width: 72px; height: 72px; object-fit: cover;
  border-radius: var(--radius); flex-shrink: 0;
}
.my-award-row__thumb--placeholder {
  width: 72px; height: 72px; background: var(--parchment-deep);
  border-radius: var(--radius); display: flex; align-items: center;
  justify-content: center; font-size: 26px; color: var(--gold-muted); flex-shrink: 0;
}
.my-award-row__info { flex: 1; min-width: 160px; }
.my-award-row__name {
  font-family: var(--font-serif); font-size: 16px; font-weight: 500;
  color: var(--walnut); margin-bottom: 6px;
}
.my-award-row__meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.my-award-row__era { font-size: 12px; color: var(--walnut-light); }
.my-award-row__by { font-size: 12px; color: var(--walnut-light); margin-top: 6px; }
.my-award-row__actions { display: flex; gap: 8px; flex-shrink: 0; align-items: flex-start; }

.my-awards-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px;
}
.my-award-card {
  background: var(--parchment); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden; position: relative;
  box-shadow: var(--shadow-soft);
}
.my-award-card__img {
  width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block;
}
.my-award-card__img--placeholder {
  width: 100%; aspect-ratio: 4/3; background: var(--parchment-deep);
  display: flex; align-items: center; justify-content: center;
  font-size: 40px; color: var(--gold-muted);
}
.my-award-card__badge {
  position: absolute; top: 10px; right: 10px;
  background: var(--sage); color: white;
  font-size: 11px; padding: 3px 10px; border-radius: 100px;
  font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
}
.my-award-card__body { padding: 14px 16px; }
.my-award-card__name {
  font-family: var(--font-serif); font-size: 15px; font-weight: 500;
  color: var(--walnut); margin-bottom: 6px; line-height: 1.3;
}
.my-award-card__meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.my-award-card__tags { display: flex; gap: 5px; flex-wrap: wrap; }

/* ── Item detail modal ── */
.item-modal-overlay { display: none; position: fixed; inset: 0; background: oklch(22% 0.03 60 / 0.50); z-index: 500; align-items: flex-start; justify-content: center; overflow-y: auto; padding: 40px 16px; }
.item-modal-overlay.open { display: flex; }
.item-modal { background: var(--parchment); border-radius: var(--radius-lg); padding: 28px 32px; max-width: 540px; width: 100%; box-shadow: var(--shadow-card); position: relative; }
.item-modal__close { position: absolute; top: 14px; right: 16px; background: none; border: none; font-size: 18px; color: var(--walnut-light); cursor: pointer; line-height: 1; padding: 4px; }
.item-modal__close:hover { color: var(--walnut); }
.item-modal__image { width: 100%; border-radius: var(--radius); object-fit: cover; max-height: 280px; display: block; margin-bottom: 20px; }
.item-modal__name { font-family: var(--font-serif); font-size: 22px; color: var(--walnut); margin-bottom: 10px; line-height: 1.3; }
.item-modal__meta { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.item-modal__era { font-size: 13px; color: var(--walnut-light); }
.item-modal__desc { font-size: 14px; color: var(--ink); line-height: 1.7; margin-bottom: 14px; }
.item-modal__tags { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 4px; }

/* ── Confirm modal ── */
.confirm-modal-overlay { display: none; position: fixed; inset: 0; background: oklch(22% 0.03 60 / 0.45); z-index: 500; align-items: center; justify-content: center; }
.confirm-modal-overlay.open { display: flex; }
.confirm-modal { background: var(--parchment); border-radius: var(--radius-lg); padding: 32px; max-width: 420px; width: 90%; box-shadow: var(--shadow-card); }
.confirm-modal__title { font-family: var(--font-serif); font-size: 20px; color: var(--walnut); margin-bottom: 12px; }
.confirm-modal__body { font-size: 14px; color: var(--walnut-light); line-height: 1.6; margin-bottom: 24px; }
.confirm-modal__actions { display: flex; gap: 12px; justify-content: flex-end; }

/* ── Missing utilities (used across phases) ── */
.page-container { max-width: 1100px; margin: 0 auto; padding: 32px 24px; }
.page-subtitle { color: var(--walnut-light); font-size: 14px; margin-top: 4px; }
.empty-state__title { font-family: var(--font-serif); font-style: italic; font-size: 20px; color: var(--walnut-light); margin-bottom: 8px; }
.empty-state__body { font-size: 14px; color: var(--walnut-light); }
.alert { border-radius: var(--radius); padding: 12px 16px; font-size: 14px; margin-bottom: 20px; }
.alert-error { background: oklch(95% 0.015 20); border: 1px solid var(--rose-dust); color: oklch(35% 0.04 20); }
.btn--danger-text { color: var(--rose-dust); }
.btn--danger-text:hover { color: oklch(35% 0.04 20); border-color: var(--rose-dust); }

/* ── Phase 5: Generic modal ── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: oklch(22% 0.025 60 / 0.55);
  align-items: center; justify-content: center;
  z-index: 500; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--parchment); border-radius: var(--radius-lg);
  width: 100%; max-width: 500px; max-height: 90vh; overflow: auto;
  box-shadow: 0 20px 60px oklch(22% 0.03 60 / 0.30);
  border: 1px solid var(--border);
}
.modal__header {
  padding: 20px 24px 18px; display: flex; align-items: center;
  justify-content: space-between; border-bottom: 1px solid var(--border);
}
.modal__title { font-family: var(--font-serif); font-size: 20px; font-weight: 500; color: var(--walnut); }
.modal__close {
  background: none; border: none; cursor: pointer;
  font-size: 20px; color: var(--walnut-light); line-height: 1; padding: 0 4px;
}
.modal__close:hover { color: var(--walnut); }
.modal__body { padding: 24px; }
.modal__footer {
  padding: 0 24px 24px; display: flex; justify-content: flex-end; gap: 10px;
}

/* ── Phase 5: User management table ── */
.users-table {
  width: 100%; border-collapse: collapse; font-size: 14px;
}
.users-table th {
  text-align: left; font-size: 11px; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--walnut-light); font-weight: 400; padding: 12px 16px;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.users-table td {
  padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle;
}
.users-table tbody tr:last-child td { border-bottom: none; }
.users-table tbody tr:hover { background: var(--parchment-mid); }
.user-row--disabled td { opacity: 0.5; }
.user-row__name { font-weight: 400; color: var(--walnut); display: flex; align-items: center; gap: 8px; }
.user-row__self {
  font-size: 10px; letter-spacing: 0.05em; text-transform: uppercase;
  background: var(--parchment-deep); color: var(--walnut-light);
  padding: 1px 7px; border-radius: 100px;
}
.user-row__email { color: var(--walnut-light); font-size: 13px; }
.user-row__login { font-size: 13px; color: var(--walnut-light); white-space: nowrap; }
.user-row__actions { display: flex; align-items: center; gap: 6px; white-space: nowrap; }

.role-badge {
  font-size: 11px; padding: 2px 10px; border-radius: 100px;
  font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
}
.role-badge--admin { background: oklch(68% 0.095 72 / 0.18); color: var(--walnut); }
.role-badge--familymember { background: var(--parchment-deep); color: var(--walnut-light); }

.status-badge {
  font-size: 11px; padding: 2px 10px; border-radius: 100px;
  font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; white-space: nowrap;
}
.status-badge--active { background: oklch(60% 0.040 155 / 0.15); color: var(--sage); }
.status-badge--disabled { background: oklch(45% 0.07 20 / 0.12); color: oklch(45% 0.07 20); }
.status-badge--never { background: var(--parchment-deep); color: var(--walnut-light); }
