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

:root {
  --sidebar-w: 220px;
  --gold: #c9a227;
  --gold-dark: #a8821a;
  --sidebar-bg: #0f172a;
  --sidebar-text: rgba(255,255,255,0.65);
  --sidebar-active: #c9a227;
  --bg: #f1f5f9;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-muted: #64748b;
  --danger: #ef4444;
  --danger-dark: #dc2626;
  --success: #22c55e;
  --radius: 10px;
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

html, body {
  height: 100%;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
}

/* ── LOGIN ───────────────────────────────────────── */

.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

.login-box {
  background: #fff;
  border-radius: 18px;
  padding: 44px 40px 40px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.35);
}

.login-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 8px;
}

.login-brand svg {
  width: 26px; height: 26px;
  color: var(--gold);
  fill: var(--gold);
}

.login-brand h1 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--gold);
}

.login-box h2 {
  text-align: center;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.login-error {
  background: #fef2f2;
  color: var(--danger);
  border: 1px solid #fecaca;
  border-radius: 7px;
  padding: 9px 12px;
  font-size: 0.875rem;
  margin-bottom: 14px;
}

/* ── SHARED FORM ELEMENTS ────────────────────────── */

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.form-group label {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-group small {
  font-size: 0.78rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-muted);
  opacity: 0.75;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group select,
.inline-search {
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: var(--font);
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
  width: 100%;
}

.form-group input:focus,
.form-group select:focus,
.inline-search:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,162,39,0.15);
}

.req { color: var(--danger); }

.form-row { margin-bottom: 4px; }
.form-row.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ── BUTTONS ─────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  border: none;
  transition: all 0.16s;
  white-space: nowrap;
}

.btn-primary {
  background: var(--gold);
  color: #0f172a;
}
.btn-primary:hover { background: var(--gold-dark); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-secondary {
  background: #e2e8f0;
  color: var(--text);
}
.btn-secondary:hover { background: #cbd5e1; }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover { background: var(--bg); color: var(--text); }

.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover { background: var(--danger-dark); }

.btn-icon {
  padding: 6px;
  border-radius: 6px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.15s;
  line-height: 1;
}
.btn-icon:hover { background: var(--bg); color: var(--text); }
.btn-icon.danger:hover { background: #fef2f2; color: var(--danger); }

.btn-sm { padding: 5px 12px; font-size: 0.82rem; }

.btn-full { width: 100%; justify-content: center; }

.btn-group { display: flex; gap: 8px; }

/* ── FILE INPUT ──────────────────────────────────── */

.file-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.file-input-label {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 7px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--text);
  white-space: nowrap;
  transition: border-color 0.15s;
}
.file-input-label:hover { border-color: var(--gold); }
.file-input-label input[type="file"] { display: none; }

.file-name {
  font-size: 0.82rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 160px;
}

.img-preview {
  margin-top: 10px;
  max-width: 140px;
  max-height: 100px;
  border-radius: 8px;
  border: 1px solid var(--border);
  object-fit: contain;
  display: block;
  background: #f1f5f9;
}
.img-preview[hidden] { display: none; }

/* ── LAYOUT ──────────────────────────────────────── */

.admin-app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.admin-app[hidden] { display: none; }

/* ── SIDEBAR ─────────────────────────────────────── */

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 18px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.sidebar-brand svg {
  width: 20px; height: 20px;
  fill: var(--gold);
  flex-shrink: 0;
}

.sidebar-brand span {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.02em;
}

.sidebar-nav {
  flex: 1;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: var(--sidebar-text);
  font-size: 0.9rem;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: all 0.16s;
}

.nav-item svg {
  width: 18px; height: 18px;
  flex-shrink: 0;
}

.nav-item:hover {
  background: rgba(255,255,255,0.07);
  color: #fff;
}

.nav-item.active {
  background: rgba(201,162,39,0.18);
  color: var(--gold);
}

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,0.07);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sidebar-user {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.4);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-logout {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.45);
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  white-space: nowrap;
  font-family: var(--font);
  transition: all 0.15s;
}
.btn-logout:hover { color: #fff; border-color: rgba(255,255,255,0.35); }

/* ── MAIN CONTENT ────────────────────────────────── */

.admin-main {
  flex: 1;
  overflow-y: auto;
  background: var(--bg);
}

.admin-section {
  display: none;
  padding: 28px 32px 40px;
  max-width: 1100px;
}

#section-placement {
  max-width: none;
}

.admin-section.active { display: block; }

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  gap: 12px;
  flex-wrap: wrap;
}

.section-header h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
}

/* ── CARDS ───────────────────────────────────────── */

.card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 22px 24px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.card[hidden] { display: none; }

.card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 18px;
  color: var(--text);
}

.card-note {
  font-size: 0.87rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.5;
}

/* ── WALL LIST ───────────────────────────────────── */

.card-list { display: flex; flex-direction: column; gap: 12px; }

.wall-list-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  transition: box-shadow 0.15s, opacity 0.15s, border-color 0.15s;
}

.wall-list-item:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.1); }

.wall-list-item.dragging { opacity: 0.45; }

.wall-list-item.drag-over {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(201,162,39,0.25);
}

.drag-handle {
  cursor: grab;
  color: var(--text-muted);
  flex-shrink: 0;
  padding: 2px 4px;
  opacity: 0.5;
  transition: opacity 0.15s;
}

.drag-handle:active { cursor: grabbing; }

.wall-list-item:hover .drag-handle { opacity: 1; }

.wall-thumb {
  width: 72px; height: 48px;
  border-radius: 6px;
  object-fit: cover;
  background: linear-gradient(135deg, #1a1a2e, #0f3460);
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.wall-thumb-default {
  width: 72px; height: 48px;
  border-radius: 6px;
  background: linear-gradient(135deg, #1a1a2e, #0f3460);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
}

.wall-list-info { flex: 1; min-width: 0; }

.wall-list-name {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wall-list-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  gap: 14px;
  align-items: center;
}

.icon-thumb {
  width: 24px; height: 24px;
  object-fit: contain;
}

.wall-list-actions { display: flex; gap: 6px; }

/* ── TRIBUTES ────────────────────────────────────── */

.tributes-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.filter-tabs {
  display: flex;
  background: var(--bg);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}

.filter-tab {
  padding: 5px 14px;
  border-radius: 6px;
  border: none;
  background: transparent;
  font-size: 0.85rem;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.15s;
}

.filter-tab.active {
  background: #fff;
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.inline-search {
  flex: 1;
  max-width: 240px;
  padding: 7px 12px;
}

.tributes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}

.tribute-card {
  border: 1.5px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  transition: box-shadow 0.15s, border-color 0.15s;
  position: relative;
}

.tribute-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.1); }

.tribute-card.unplaced { border-color: #fde68a; background: #fffbeb; }

.tribute-card-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  display: block;
  background: #f8f9fb;
}

.tribute-card-body {
  padding: 8px 10px;
}

.tribute-card-name {
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tribute-card-name input {
  border: none;
  outline: none;
  width: 100%;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: var(--font);
  color: var(--text);
  background: transparent;
  padding: 0;
}

.tribute-card-name input:focus {
  border-bottom: 1.5px solid var(--gold);
}

.tribute-card-meta {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.tribute-card-actions {
  display: flex;
  gap: 4px;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 11px;
  background: var(--gold);
  color: #0f172a;
  font-size: 0.75rem;
  font-weight: 700;
}

.badge-placed {
  position: absolute;
  top: 6px; right: 6px;
  background: #22c55e;
  color: #fff;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}

/* ── DROP ZONE ───────────────────────────────────── */

.drop-zone {
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
  margin-bottom: 14px;
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--gold);
  background: #fffbeb;
}

.drop-zone svg {
  width: 40px; height: 40px;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: block;
  margin: 0 auto 10px;
}

.drop-zone p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.drop-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.batch-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.batch-thumb {
  aspect-ratio: 1;
  border-radius: 6px;
  object-fit: contain;
  border: 1px solid var(--border);
  width: 100%;
  background: #f1f5f9;
}

.batch-thumb-wrap {
  position: relative;
}

.batch-thumb-name {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── PLACEMENT EDITOR ────────────────────────────── */

.placement-wall-selector {
  display: flex;
  align-items: center;
  gap: 10px;
}

.placement-wall-selector label {
  font-size: 0.87rem;
  font-weight: 600;
  color: var(--text-muted);
}

.placement-wall-selector select {
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: var(--font);
  outline: none;
  cursor: pointer;
  background: #fff;
}

.placement-wall-selector select:focus { border-color: var(--gold); }

.placement-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 18px;
  height: calc(100vh - 160px);
}

.placement-sidebar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.placement-sidebar-header {
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.placement-sidebar-header h4 {
  font-size: 0.9rem;
  font-weight: 700;
}

.placement-hint {
  padding: 8px 14px;
  font-size: 0.78rem;
  color: var(--text-muted);
  background: #fffbeb;
  border-bottom: 1px solid #fde68a;
  line-height: 1.4;
}

.unplaced-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.unplaced-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 8px;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all 0.14s;
  background: var(--bg);
}

.unplaced-item:hover { background: #fffbeb; border-color: #fde68a; }

.unplaced-item.selected {
  background: #fef9c3;
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(201,162,39,0.2);
}

.unplaced-item img {
  width: 38px; height: 38px;
  border-radius: 6px;
  object-fit: contain;
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: #f1f5f9;
}

.unplaced-item-name {
  font-size: 0.83rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Canvas */

.placement-canvas-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.placement-canvas {
  flex: 1;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  position: relative;
  overflow: auto;
  background: linear-gradient(135deg, #1a1a2e, #0f3460);
  cursor: default;
}

.canvas-inner {
  position: absolute;
  top: 0;
  left: 0;
  /* width and height set by applyCanvasZoom() */
}

.placement-canvas.placing {
  cursor: crosshair;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,162,39,0.25);
}

.canvas-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.3);
  font-size: 0.95rem;
  pointer-events: none;
}

.canvas-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.canvas-icon {
  position: absolute;
  transform: translate(-50%, -50%);
  cursor: grab;
  text-align: center;
  user-select: none;
  transition: box-shadow 0.15s;
}

.canvas-icon:active { cursor: grabbing; }

.canvas-icon.selected-icon .icon-img-wrap {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
  border-radius: 50%;
}

.icon-img-wrap {
  width: 28px; height: 28px;
  border-radius: 50%;
  overflow: visible;
  margin: 0 auto;
}

.canvas-icon img {
  width: 28px; height: 28px;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.7));
  display: block;
}

.canvas-icon-default {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0f172a;
  font-size: 13px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.5);
  margin: 0 auto;
}

.canvas-icon-label {
  display: block;
  color: #fff;
  font-size: 8px;
  font-weight: 600;
  text-shadow: 0 1px 4px rgba(0,0,0,1);
  max-width: 56px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 3px;
}

.selection-rect {
  position: absolute;
  border: 1.5px dashed #818cf8;
  background: rgba(129, 140, 248, 0.12);
  pointer-events: none;
  z-index: 95;
  display: none;
}

.zoom-controls {
  display: flex;
  align-items: center;
  gap: 5px;
}

.btn-zoom {
  width: 24px;
  height: 24px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  padding: 0;
  transition: border-color 0.15s, color 0.15s;
}

.btn-zoom:hover { border-color: var(--gold); color: var(--gold); }

#zoom-label {
  font-size: 0.76rem;
  color: var(--text-muted);
  min-width: 36px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.canvas-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 14px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.canvas-toolbar[hidden] { display: none; }

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.mode-label {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Alignment tools strip */
.align-tools {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 3px 7px;
}

.tool-group-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0 4px;
  white-space: nowrap;
}

.btn-align {
  width: 26px; height: 26px;
  border-radius: 5px;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: background 0.12s, color 0.12s;
  padding: 0;
  flex-shrink: 0;
}

.btn-align:hover { background: var(--border); color: var(--text); }
.btn-align:disabled { opacity: 0.3; cursor: not-allowed; }
.btn-align svg { width: 16px; height: 16px; pointer-events: none; }

.tool-group-sep {
  width: 1px;
  height: 16px;
  background: var(--border);
  margin: 0 3px;
  flex-shrink: 0;
}

.tool-divider {
  width: 1px;
  height: 20px;
  background: var(--border);
  flex-shrink: 0;
}

/* Snap / grid controls */
.snap-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.81rem;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.snap-label input[type="checkbox"] { cursor: pointer; accent-color: var(--gold); }
.snap-label:hover { color: var(--text); }

.grid-size-wrap {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 0.81rem;
  color: var(--text-muted);
}

.grid-size-wrap input[type="number"] {
  width: 42px;
  padding: 3px 6px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-size: 0.81rem;
  font-family: var(--font);
  text-align: center;
  outline: none;
  -moz-appearance: textfield;
}
.grid-size-wrap input[type="number"]::-webkit-inner-spin-button { opacity: 0.4; }
.grid-size-wrap input[type="number"]:focus { border-color: var(--gold); }

/* Guide lines SVG overlay */
.guides-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 90;
  overflow: visible;
}

/* Grid dot overlay (CSS pseudo-element, toggled via .show-grid class) */
.canvas-inner.show-grid::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, rgba(255,255,255,0.55) 1.5px, transparent 1.5px);
  background-size: var(--grid-size, 5%) var(--grid-size, 5%);
  z-index: 5;
}

/* ── CONFIRM DIALOG ──────────────────────────────── */

.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(3px);
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.confirm-overlay[hidden] { display: none; }

.confirm-box {
  background: #fff;
  border-radius: 12px;
  padding: 28px 28px 24px;
  max-width: 360px;
  width: 90%;
  box-shadow: 0 16px 48px rgba(0,0,0,0.25);
}

.confirm-box p {
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 20px;
  line-height: 1.5;
}

.confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ── TOAST ───────────────────────────────────────── */

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1e293b;
  color: #fff;
  padding: 11px 20px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  z-index: 700;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.22s, transform 0.22s;
  pointer-events: none;
  max-width: 320px;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.error { background: var(--danger); }
.toast.success { background: #15803d; }

/* ── ADMIN USERS ─────────────────────────────────── */

.user-avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #0f172a;
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

/* ── EMPTY STATES ────────────────────────────────── */

.empty-state {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ── TOGGLE LABEL (checkbox with description) ────── */

.toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
}

.toggle-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--gold);
  flex-shrink: 0;
  cursor: pointer;
}

/* ── TRIBUTE TEXT in card ────────────────────────── */

.tribute-card-tribute {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.tribute-card-tribute textarea {
  border: none;
  outline: none;
  width: 100%;
  font-size: 0.74rem;
  font-family: var(--font);
  color: var(--text-muted);
  background: transparent;
  resize: vertical;
  padding: 0;
  min-height: 38px;
}

.tribute-card-tribute textarea:focus {
  border-bottom: 1.5px solid var(--gold);
  color: var(--text);
}

/* ── ROLE BADGES ─────────────────────────────────── */

.role-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.role-badge.full {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
}

.role-badge.limited {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #cbd5e1;
}

/* ── ROLE SELECTOR (create user form) ────────────── */

.role-selector {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

.role-option {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  transition: border-color 0.15s, background 0.15s;
}

.role-option:hover { border-color: var(--gold); background: #fffbeb; }

.role-option input[type="radio"] {
  margin-top: 2px;
  accent-color: var(--gold);
  flex-shrink: 0;
}

.role-label { font-size: 0.88rem; color: var(--text); line-height: 1.4; }
.role-label strong { color: var(--text); }

/* ── SETTINGS SECTION ────────────────────────────── */

.color-picker-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}

.color-swatch {
  width: 42px;
  height: 36px;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  padding: 2px 3px;
  cursor: pointer;
  background: none;
  flex-shrink: 0;
}

.color-text-input {
  flex: 1;
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.2s;
}

.color-text-input:focus { border-color: var(--gold); }

.form-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.4;
}

.settings-logo-preview {
  max-width: 160px;
  max-height: 80px;
  object-fit: contain;
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px;
  background: #f8fafc;
}

/* ── TRIBUTE CARD — family name ──────────────────── */

.tribute-card-family {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 3px;
}

.tribute-card-family input {
  border: none;
  outline: none;
  width: 100%;
  font-size: 0.76rem;
  font-style: italic;
  font-family: var(--font);
  color: var(--text-muted);
  background: transparent;
  padding: 0;
}

.tribute-card-family input:focus {
  border-bottom: 1.5px solid var(--gold);
  font-style: normal;
}

.tribute-card-edit-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 0.76rem;
  transition: color 0.15s, background 0.15s;
}

.tribute-card-edit-btn:hover { color: var(--gold); background: #fffbeb; }

/* ── SCROLLBARS ──────────────────────────────────── */

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
