/* ── Enrichment Panel ── */
.enrich-layout {
  display: flex;
  gap: 1.5rem;
  min-height: 60vh;
}
.enrich-sidebar {
  width: 280px;
  flex-shrink: 0;
  border: 2px solid var(--black);
  border-radius: 6px;
  box-shadow: 4px 4px 0 var(--black);
  background: var(--white);
  overflow-y: auto;
  max-height: 80vh;
  position: sticky;
  top: 1rem;
}
.enrich-sidebar-title {
  font-family: 'Space Mono', monospace;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.75rem 1rem;
  background: var(--black);
  color: var(--white);
}
.enrich-event-item {
  padding: 0.6rem 1rem;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  transition: background 0.12s;
  font-size: 0.8rem;
}
.enrich-event-item:hover { background: rgba(168,85,247,0.05); }
.enrich-event-item.active { background: rgba(168,85,247,0.1); border-left: 3px solid var(--purple); }
.enrich-event-due { border-left: 3px solid #f59e0b !important; background: rgba(245,158,11,0.05); }
.enrich-event-urgent { border-left: 3px solid #dc2626 !important; background: rgba(220,38,38,0.06); animation: enrich-shake 0.5s ease-in-out infinite; }
.enrich-event-done { border-left: 3px solid #16a34a !important; }
.enrich-event-past { opacity: 0.5; }
@keyframes enrich-shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-2px); } 75% { transform: translateX(2px); } }
.enrich-due-badge { font-family: 'Space Mono', monospace; font-size: 0.5rem; font-weight: 700; padding: 1px 5px; border-radius: 3px; background: #fef3c7; color: #92400e; text-transform: uppercase; white-space: nowrap; flex-shrink: 0; }
.enrich-due-urgent { background: #dc2626; color: white; animation: enrich-pulse-badge 1s ease-in-out infinite; }
@keyframes enrich-pulse-badge { 0%,100% { opacity: 1; } 50% { opacity: 0.6; } }
.enrich-done-badge { font-family: 'Space Mono', monospace; font-size: 0.5rem; font-weight: 700; padding: 1px 5px; border-radius: 3px; background: #dcfce7; color: #166534; text-transform: uppercase; white-space: nowrap; flex-shrink: 0; }
.enrich-event-name {
  font-weight: 700;
  font-size: 0.78rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.enrich-event-meta {
  font-family: 'Space Mono', monospace;
  font-size: 0.6rem;
  color: #888;
  margin-top: 0.15rem;
}
.enrich-progress {
  height: 4px;
  background: #e5e5e5;
  border-radius: 2px;
  margin-top: 0.35rem;
  overflow: hidden;
}
.enrich-progress-bar {
  height: 100%;
  background: var(--purple);
  border-radius: 2px;
  transition: width 0.3s;
}

/* Main content */
.enrich-content { flex: 1; min-width: 0; }
.enrich-filters {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  align-items: center;
}
.enrich-filter-btn {
  padding: 0.4rem 0.8rem;
  border: 2px solid var(--black);
  border-radius: 4px;
  background: var(--white);
  font-family: 'Space Mono', monospace;
  font-size: 0.65rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.12s;
  text-transform: uppercase;
}
.enrich-filter-btn:hover { background: #f0f0f0; }
.enrich-filter-btn.active { background: var(--black); color: var(--white); }
.enrich-count {
  margin-left: auto;
  font-family: 'Space Mono', monospace;
  font-size: 0.65rem;
  color: #888;
}

/* Item cards */
.enrich-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}
.enrich-card {
  border: 2px solid #e5e5e5;
  border-radius: 6px;
  padding: 1rem;
  background: var(--white);
  transition: all 0.15s;
}
.enrich-card:hover { border-color: #ccc; }
.enrich-card.enriched { border-color: rgba(22,163,41,0.3); background: rgba(22,163,41,0.02); }
.enrich-card.missing { border-color: rgba(220,38,38,0.2); }
.enrich-card-header {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.enrich-card-img {
  width: 90px;
  height: 120px;
  object-fit: contain;
  border-radius: 4px;
  background: #f5f5f5;
  flex-shrink: 0;
}
.enrich-card-info { flex: 1; min-width: 0; }
.enrich-card-title {
  font-weight: 700;
  font-size: 0.8rem;
  margin-bottom: 0.25rem;
  word-break: break-word;
}
.enrich-card-price {
  font-family: 'Space Mono', monospace;
  font-size: 0.75rem;
  color: #888;
}
.enrich-card-status {
  font-family: 'Space Mono', monospace;
  font-size: 0.6rem;
  font-weight: 700;
  margin-top: 0.3rem;
}
.enrich-card-status.complete { color: #16a34a; }
.enrich-card-status.incomplete { color: #dc2626; }
.enrich-input-group { margin-bottom: 0.5rem; }
.enrich-input-label {
  font-family: 'Space Mono', monospace;
  font-size: 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #888;
  margin-bottom: 0.2rem;
}
.enrich-input {
  width: 100%;
  padding: 0.4rem 0.5rem;
  border: 2px solid #ddd;
  border-radius: 4px;
  font-family: 'Space Mono', monospace;
  font-size: 0.7rem;
  transition: border-color 0.12s;
  box-sizing: border-box;
}
.enrich-input:focus { border-color: var(--purple); outline: none; }
.enrich-actions {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.5rem;
}
.enrich-save-btn {
  padding: 0.35rem 0.75rem;
  background: var(--black);
  color: white;
  border: none;
  border-radius: 4px;
  font-family: 'Space Mono', monospace;
  font-size: 0.65rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.12s;
}
.enrich-save-btn:hover { background: #333; }
.enrich-save-btn.saved { background: #16a34a; }

/* Responsive */
@media (max-width: 768px) {
  .enrich-layout { flex-direction: column; }
  .enrich-sidebar { width: 100%; max-height: 200px; position: static; box-shadow: 2px 2px 0 var(--black); }
  .enrich-grid { grid-template-columns: 1fr; }
  .admin-action-bar { flex-wrap: wrap; padding: 0.6rem 0.75rem; gap: 0.5rem; font-size: 0.65rem; }
  .admin-action-bar button { font-size: 0.6rem; padding: 0.35rem 0.6rem; }
  .diff-summary { box-shadow: 2px 2px 0 var(--black); }
}

/* ── Diff View ── */
.diff-summary {
  display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 1rem;
  border: 2px solid var(--black); border-radius: 6px; box-shadow: 4px 4px 0 var(--black);
  background: var(--white); margin-bottom: 1.25rem; flex-wrap: wrap;
  font-family: 'Space Mono', monospace; font-size: 0.7rem;
}
.diff-summary-time { color: #888; margin-right: auto; }
.diff-badge { padding: 0.2rem 0.6rem; border-radius: 3px; font-weight: 700; font-size: 0.65rem; }
.diff-badge-added { background: #dcfce7; color: #166534; }
.diff-badge-removed { background: #fee2e2; color: #991b1b; }
.diff-badge-changed { background: #fef9c3; color: #854d0e; }

.diff-row {
  border: 2px solid #e5e5e5; border-radius: 6px; padding: 1rem;
  margin-bottom: 0.75rem; background: var(--white); transition: border-color 0.15s;
}
.diff-row:hover { border-color: #ccc; }
.diff-added { border-left: 4px solid #16a34a; background: rgba(22,163,41,0.02); }
.diff-removed { border-left: 4px solid #dc2626; background: rgba(220,38,38,0.02); }
.diff-changed { border-left: 4px solid #eab308; background: rgba(234,179,8,0.02); }

.diff-row-header { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.diff-type-badge {
  font-family: 'Space Mono', monospace; font-size: 0.6rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em; padding: 0.2rem 0.5rem; border-radius: 3px;
}
.diff-type-added { background: #16a34a; color: white; }
.diff-type-removed { background: #dc2626; color: white; }
.diff-type-changed { background: #eab308; color: #422006; }
.diff-warning { font-family: 'Space Mono', monospace; font-size: 0.6rem; color: #dc2626; font-weight: 700; }

.diff-row-title { font-weight: 700; font-size: 0.85rem; margin-bottom: 0.25rem; }
.diff-strikethrough { text-decoration: line-through; opacity: 0.5; }
.diff-row-price { font-family: 'Space Mono', monospace; font-size: 0.75rem; color: #888; }

.diff-price-change {
  display: flex; align-items: center; gap: 0.5rem;
  font-family: 'Space Mono', monospace; font-size: 0.75rem; flex-wrap: wrap;
}
.diff-old-price { text-decoration: line-through; color: #dc2626; background: #fee2e2; padding: 0.15rem 0.4rem; border-radius: 2px; }
.diff-new-price { color: #16a34a; background: #dcfce7; padding: 0.15rem 0.4rem; border-radius: 2px; font-weight: 700; }
.diff-arrow { color: #888; font-size: 0.85rem; }
.diff-delta { font-size: 0.65rem; font-weight: 700; }
.diff-delta.down { color: #16a34a; }
.diff-delta.up { color: #dc2626; }
.diff-row-actions { margin-top: 0.5rem; }
.diff-empty { text-align: center; padding: 3rem; color: #aaa; font-family: 'Space Mono', monospace; font-size: 0.8rem; }

@media (max-width: 768px) {
  .diff-summary { flex-direction: column; align-items: flex-start; }
  .diff-summary-time { margin-right: 0; }
}

/* ── Audit Log ── */
.audit-stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.audit-stat-card { border: 2px solid var(--black); border-radius: 6px; box-shadow: 4px 4px 0 var(--black); background: var(--white); padding: 1rem; }
.audit-stat-header { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; padding-bottom: 0.5rem; border-bottom: 2px solid #eee; }
.audit-avatar, .audit-avatar-sm { width: 32px; height: 32px; border-radius: 50%; background: var(--purple); color: white; display: flex; align-items: center; justify-content: center; font-family: 'Space Mono', monospace; font-weight: 700; font-size: 0.75rem; flex-shrink: 0; }
.audit-avatar-sm { width: 24px; height: 24px; font-size: 0.6rem; }
.audit-stat-name { font-weight: 700; font-size: 0.85rem; }
.audit-stat-row { display: flex; justify-content: space-between; font-family: 'Space Mono', monospace; font-size: 0.7rem; padding: 0.2rem 0; }
.audit-stat-value { font-weight: 700; }
.audit-stat-breakdown { display: flex; gap: 0.4rem; margin-top: 0.5rem; flex-wrap: wrap; }
.audit-badge { padding: 0.15rem 0.4rem; border-radius: 3px; font-family: 'Space Mono', monospace; font-size: 0.6rem; font-weight: 700; }
.audit-badge-image { background: #dcfce7; color: #166534; }
.audit-badge-link { background: #dbeafe; color: #1e40af; }
.audit-badge-both { background: #f3e8ff; color: #7c3aed; }
.audit-stat-last-active { font-family: 'Space Mono', monospace; font-size: 0.6rem; color: #888; margin-top: 0.5rem; }
.audit-filters { display: flex; gap: 0.5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.audit-entry { border: 2px solid #e5e5e5; border-radius: 6px; padding: 1rem; margin-bottom: 0.75rem; background: var(--white); transition: border-color 0.15s; }
.audit-entry:hover { border-color: #ccc; }
.audit-entry.audit-image { border-left: 4px solid #16a34a; }
.audit-entry.audit-link { border-left: 4px solid #3b82f6; }
.audit-entry.audit-both { border-left: 4px solid #a855f7; }
.audit-entry-header { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.4rem; }
.audit-entry-admin { font-weight: 700; font-size: 0.8rem; }
.audit-entry-time { margin-left: auto; font-family: 'Space Mono', monospace; font-size: 0.6rem; color: #888; }
.audit-entry-title { font-weight: 600; font-size: 0.85rem; margin-bottom: 0.15rem; }
.audit-entry-event { font-family: 'Space Mono', monospace; font-size: 0.6rem; color: #888; margin-bottom: 0.5rem; text-transform: capitalize; }
.audit-diff { font-family: 'Space Mono', monospace; font-size: 0.65rem; margin-bottom: 0.3rem; border: 1px solid #e5e5e5; border-radius: 4px; overflow: hidden; }
.audit-diff-label { background: #f5f5f5; padding: 0.2rem 0.5rem; font-weight: 700; font-size: 0.6rem; text-transform: uppercase; color: #888; border-bottom: 1px solid #e5e5e5; }
.audit-diff-old { background: #fef2f2; color: #991b1b; padding: 0.25rem 0.5rem; word-break: break-all; }
.audit-diff-new { background: #f0fdf4; color: #166534; padding: 0.25rem 0.5rem; word-break: break-all; }
@media (max-width: 768px) { .audit-stats-grid { grid-template-columns: 1fr; } .audit-filters { flex-direction: column; } }

/* ── 3-Dot Card Menu ── */
.enrich-card-menu { position: relative; flex-shrink: 0; margin-left: auto; }
.enrich-dots-btn {
  background: none; border: none; cursor: pointer;
  font-size: 1.2rem; color: #999; padding: 0.2rem 0.4rem;
  line-height: 1; transition: color 0.12s;
}
.enrich-dots-btn:hover { color: var(--black); }
.enrich-dots-dropdown {
  display: none; position: absolute; top: calc(100% + 2px); right: -4px; z-index: 100;
  background: white; border: 2px solid var(--black); box-shadow: 4px 4px 0 var(--black);
  min-width: 140px; padding: 0.25rem 0; border-radius: 4px;
}
.enrich-dots-dropdown.open { display: block; }
.enrich-dots-dropdown button {
  display: block; width: 100%; text-align: left; padding: 0.4rem 0.75rem;
  background: none; border: none; cursor: pointer;
  font-family: 'Space Mono', monospace; font-size: 0.65rem; font-weight: 600;
  transition: background 0.1s;
}
.enrich-dots-dropdown button:hover { background: #f0f0f0; }

/* ── Edit Details Button ── */
.enrich-edit-details-btn {
  padding: 0.45rem 0.75rem; background: none; border: 2px solid var(--purple);
  color: var(--purple); font-family: 'Space Mono', monospace; font-size: 0.65rem;
  font-weight: 700; cursor: pointer; border-radius: 4px; text-transform: uppercase;
  transition: all 0.12s;
}
.enrich-edit-details-btn:hover { background: var(--purple); color: white; }

/* ── Selection State ── */
.enrich-card.selected { outline: 3px solid var(--purple); outline-offset: -3px; }
.enrich-card.selected .enrich-tool-btn:first-child { background: var(--purple); color: white; border-color: var(--purple); }

/* ── Hidden / Pinned States ── */
.enrich-hidden { opacity: 0.4; }
.enrich-hidden .enrich-card-title { text-decoration: line-through; }
.enrich-pinned { border-left: 4px solid var(--orange); }

/* ── Group Badge ── */
.enrich-group-badge {
  display: inline-block; padding: 1px 6px; font-size: 0.5rem;
  font-family: 'Space Mono', monospace; font-weight: 700;
  background: rgba(168,85,247,0.1); color: var(--purple);
  border-radius: 3px; cursor: pointer; text-transform: uppercase;
}
.enrich-group-badge:hover { background: rgba(168,85,247,0.2); }

/* ── Notes ── */
.enrich-notes { padding: 0.5rem 0.75rem; }
.enrich-notes-input {
  width: 100%; padding: 0.4rem; border: 1px solid #ddd; border-radius: 3px;
  font-family: 'Space Mono', monospace; font-size: 0.65rem;
  resize: vertical; min-height: 40px; box-sizing: border-box;
}
.enrich-notes-input:focus { border-color: var(--purple); outline: none; }

/* ── Floating Action Bar ── */
.admin-action-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 9998;
  background: var(--black); color: white; padding: 0.75rem 1.5rem;
  display: flex; align-items: center; gap: 1rem; justify-content: center;
  font-family: 'Space Mono', monospace; font-size: 0.75rem;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.2);
  animation: slideUp 0.2s ease;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.admin-action-bar button {
  padding: 0.4rem 1rem; border: 2px solid white; background: transparent;
  color: white; font-family: 'Space Mono', monospace; font-size: 0.7rem;
  font-weight: 700; cursor: pointer; border-radius: 4px; text-transform: uppercase;
  transition: all 0.12s;
}
.admin-action-bar button:hover { background: white; color: var(--black); }

/* ── Inline Edit ── */
.enrich-inline-edit {
  width: 100%; padding: 0.3rem; border: 2px solid var(--purple);
  font-family: 'Space Grotesk', sans-serif; font-size: inherit;
  border-radius: 3px; box-sizing: border-box; outline: none;
}

/* ── Super Admin Panel ── */
.super-admin-panel { padding: 0.5rem 0; }
.super-section {
  padding: 1rem 1.25rem; border-bottom: 1px solid #eee;
}
.super-section:last-child { border-bottom: none; }
.super-section-title {
  font-family: 'Space Mono', monospace; font-size: 0.7rem;
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  margin-bottom: 0.75rem; color: var(--black);
}

@media (max-width: 768px) {
  .super-admin-panel { padding: 0; }
  .super-section { padding: 0.75rem; }
}
