/* ── Perfectly Paced Journeys · Seller Dashboard ─────────────────────── */
:root {
  --deep:   #111009;
  --panel:  #201e1a;
  --raised: #2a2723;
  --border: #3a3733;
  --gold:   #c8a97e;
  --cream:  #f5f1eb;
  --stone:  #8a8278;
  --muted:  #5a5650;
  --good:   #8db48e;
  --warn:   #c4826e;
  --caution:#c8a97e;
  --info:   #7ea8c4;
  --font-head: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Jost', system-ui, sans-serif;
  --radius: 6px;
}

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

html, body {
  height: 100%;
  background: var(--deep);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
}

/* ── Setup Overlay ─── */
#setup-overlay {
  position: fixed; inset: 0;
  background: var(--deep);
  display: flex; align-items: center; justify-content: center;
  z-index: 200;
}
#setup-overlay.hidden { display: none; }

.setup-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 2.5rem;
  width: 100%; max-width: 480px;
}
.setup-logo {
  font-family: var(--font-head);
  font-size: 1.5rem;
  color: var(--gold);
  margin-bottom: 0.25rem;
}
.setup-sub {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--stone);
  margin-bottom: 2rem;
}
.setup-step {
  margin-bottom: 1.25rem;
}
.setup-step label {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--stone);
  margin-bottom: 0.35rem;
}
.setup-step input, .setup-step select {
  width: 100%;
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 0.55rem 0.75rem;
  outline: none;
  transition: border-color 0.15s;
}
.setup-step input:focus, .setup-step select:focus {
  border-color: var(--gold);
}
.setup-hint {
  font-size: 0.75rem;
  color: var(--stone);
  margin-top: 0.35rem;
}
.setup-hint a { color: var(--gold); }
.setup-hint code {
  background: var(--raised);
  padding: 0.1em 0.35em;
  border-radius: 3px;
  font-size: 0.8em;
}
.setup-actions {
  display: flex; gap: 0.75rem; margin-top: 1.75rem;
}

/* ── Buttons ─── */
.btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: opacity 0.15s, background 0.15s;
}
.btn:hover { opacity: 0.85; }
.btn:active { opacity: 0.7; }
.btn-primary { background: var(--gold); color: var(--deep); font-weight: 600; }
.btn-ghost   { background: transparent; border-color: var(--border); color: var(--stone); }
.btn-danger  { background: transparent; border-color: var(--warn); color: var(--warn); }
.btn-sm { padding: 0.3rem 0.6rem; font-size: 0.75rem; }

/* ── App Shell ─── */
#app {
  display: grid;
  grid-template-columns: 200px 1fr;
  grid-template-rows: auto 1fr;
  min-height: 100vh;
}
#app.hidden { display: none; }

/* ── Top Bar ─── */
.topbar {
  grid-column: 1 / -1;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.5rem;
  height: 52px;
}
.topbar-brand {
  font-family: var(--font-head);
  font-size: 1.1rem;
  color: var(--gold);
}
.topbar-brand span {
  font-family: var(--font-body);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--stone);
  margin-left: 0.75rem;
  vertical-align: middle;
}
.topbar-actions { display: flex; gap: 0.5rem; align-items: center; }

/* ── Sidebar ─── */
.sidebar {
  background: var(--panel);
  border-right: 1px solid var(--border);
  padding: 1.5rem 0;
}
.nav-section {
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 1.25rem 0.5rem;
  margin-top: 1rem;
}
.nav-section:first-child { margin-top: 0; }
.nav-item {
  display: block;
  padding: 0.55rem 1.25rem;
  color: var(--stone);
  cursor: pointer;
  font-size: 0.85rem;
  border-left: 2px solid transparent;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
  user-select: none;
}
.nav-item:hover { color: var(--cream); background: var(--raised); }
.nav-item.active {
  color: var(--gold);
  border-left-color: var(--gold);
  background: var(--raised);
}

/* ── Main Content ─── */
.main-content {
  padding: 2rem;
  overflow-y: auto;
}

/* ── Views ─── */
.view { display: none; }
.view.active { display: block; }

.view-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 1.75rem; gap: 1rem;
}
.view-title {
  font-family: var(--font-head);
  font-size: 1.6rem;
  color: var(--cream);
  line-height: 1.2;
}
.view-subtitle {
  font-size: 0.78rem;
  color: var(--stone);
  margin-top: 0.2rem;
}
.view-actions { display: flex; gap: 0.5rem; flex-shrink: 0; }

/* ── Stats Row ─── */
.stats-row {
  display: flex; gap: 1rem; margin-bottom: 1.75rem; flex-wrap: wrap;
}
.stat-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  min-width: 130px;
}
.stat-value {
  font-family: var(--font-head);
  font-size: 2rem;
  color: var(--gold);
  line-height: 1;
}
.stat-label {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--stone);
  margin-top: 0.25rem;
}

/* ── Search / Filter Bar ─── */
.toolbar {
  display: flex; gap: 0.75rem; margin-bottom: 1rem; flex-wrap: wrap;
}
.toolbar input, .toolbar select {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 0.85rem;
  padding: 0.45rem 0.75rem;
  outline: none;
  transition: border-color 0.15s;
}
.toolbar input:focus, .toolbar select:focus { border-color: var(--gold); }
.toolbar input { flex: 1; min-width: 200px; }

/* ── Table ─── */
.table-wrap {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
table {
  width: 100%; border-collapse: collapse;
}
thead th {
  background: var(--raised);
  padding: 0.65rem 1rem;
  text-align: left;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--stone);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody td {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--raised); }
.col-actions { display: flex; gap: 0.4rem; }
.empty-row td {
  text-align: center;
  color: var(--stone);
  padding: 3rem 1rem;
  font-size: 0.85rem;
}

/* ── Status Badges ─── */
.badge {
  display: inline-block;
  padding: 0.15em 0.55em;
  border-radius: 3px;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
}
.badge-active   { background: rgba(141,180,142,0.15); color: var(--good); border: 1px solid rgba(141,180,142,0.3); }
.badge-revoked  { background: rgba(196,130,110,0.15); color: var(--warn); border: 1px solid rgba(196,130,110,0.3); }
.badge-refunded { background: rgba(90,86,80,0.3);     color: var(--stone); border: 1px solid var(--border); }
.badge-transferred { background: rgba(126,168,196,0.15); color: var(--info); border: 1px solid rgba(126,168,196,0.3); }

/* ── Modal ─── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(17,16,9,0.85);
  display: none; align-items: center; justify-content: center;
  z-index: 100;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%; max-width: 540px;
  max-height: 90vh;
  display: flex; flex-direction: column;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-title {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--stone);
}
.modal-close {
  background: none; border: none;
  color: var(--stone); font-size: 1.2rem;
  cursor: pointer; line-height: 1;
  transition: color 0.15s;
}
.modal-close:hover { color: var(--cream); }
.modal-body {
  padding: 1.25rem;
  overflow-y: auto;
  flex: 1;
}
.modal-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 0.5rem;
  flex-shrink: 0;
}

/* ── Form Fields ─── */
.field { margin-bottom: 1rem; }
.field:last-child { margin-bottom: 0; }
.field label {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--stone);
  margin-bottom: 0.35rem;
}
.field input, .field select, .field textarea {
  width: 100%;
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 0.88rem;
  padding: 0.55rem 0.75rem;
  outline: none;
  transition: border-color 0.15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--gold);
}
.field textarea { resize: vertical; min-height: 80px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.field-hint {
  font-size: 0.72rem;
  color: var(--stone);
  margin-top: 0.3rem;
}
.field-hint code {
  background: var(--raised);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}
.computed-id {
  font-family: monospace;
  font-size: 0.9rem;
  color: var(--gold);
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.55rem 0.75rem;
  letter-spacing: 0.05em;
}

/* ── DRM View ─── */
.drm-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}
@media (max-width: 760px) { .drm-grid { grid-template-columns: 1fr; } }

.drm-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.drm-card-title {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.75rem;
}
.drm-result {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
}
.drm-result.ok     { background: rgba(141,180,142,0.1); border: 1px solid rgba(141,180,142,0.3); }
.drm-result.mismatch { background: rgba(200,169,126,0.1); border: 1px solid rgba(200,169,126,0.3); }
.drm-result.pirated  { background: rgba(196,130,110,0.1); border: 1px solid rgba(196,130,110,0.3); }
.drm-result.unknown  { background: var(--raised); border: 1px solid var(--border); }
.drm-result-label {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 0.4rem;
}
.drm-result.ok .drm-result-label       { color: var(--good); }
.drm-result.mismatch .drm-result-label { color: var(--caution); }
.drm-result.pirated .drm-result-label  { color: var(--warn); }
.drm-result.unknown .drm-result-label  { color: var(--stone); }

.dork-box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.dork-box-title {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--stone);
  margin-bottom: 0.75rem;
}
.dork-query {
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.65rem 1rem;
  font-family: monospace;
  font-size: 0.85rem;
  color: var(--gold);
  margin-bottom: 0.75rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.bulk-ids {
  width: 100%;
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--cream);
  font-family: monospace;
  font-size: 0.82rem;
  padding: 0.65rem 0.75rem;
  outline: none;
  resize: vertical;
  min-height: 90px;
}
.bulk-ids:focus { border-color: var(--gold); }
.bulk-results { margin-top: 1rem; }
.bulk-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
  gap: 0.75rem;
}
.bulk-row:last-child { border-bottom: none; }
.bulk-id { font-family: monospace; color: var(--gold); }

/* ── Outreach View ─── */
.outreach-panel {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.5rem;
}
@media (max-width: 760px) { .outreach-panel { grid-template-columns: 1fr; } }

.outreach-filters {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.outreach-filters-title {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--stone);
  margin-bottom: 1rem;
}
.outreach-results {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.outreach-count {
  font-size: 0.8rem;
  color: var(--stone);
  margin-bottom: 1rem;
  display: flex; align-items: center; justify-content: space-between;
}
.email-list {
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
  font-family: monospace;
  font-size: 0.8rem;
  color: var(--cream);
  min-height: 120px;
  white-space: pre-wrap;
  word-break: break-all;
  margin-bottom: 0.75rem;
}
.outreach-list { list-style: none; margin-top: 1rem; }
.outreach-buyer-row {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.83rem;
}
.outreach-buyer-row:last-child { border-bottom: none; }
.ob-name { color: var(--cream); flex: 1; }
.ob-email { color: var(--stone); font-size: 0.8rem; }
.ob-product { font-size: 0.7rem; }

/* ── Settings View ─── */
.settings-section {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
}
.settings-section-title {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1rem;
}

/* ── Toast ─── */
#toast-container {
  position: fixed;
  bottom: 1.5rem; right: 1.5rem;
  display: flex; flex-direction: column; gap: 0.5rem;
  z-index: 300;
}
.toast {
  padding: 0.65rem 1.1rem;
  border-radius: var(--radius);
  font-size: 0.82rem;
  animation: slideIn 0.2s ease;
  max-width: 320px;
}
.toast-success { background: #1f3220; border: 1px solid var(--good); color: var(--good); }
.toast-error   { background: #321f1f; border: 1px solid var(--warn); color: var(--warn); }
.toast-info    { background: var(--raised); border: 1px solid var(--border); color: var(--cream); }
@keyframes slideIn { from { opacity: 0; transform: translateX(1rem); } to { opacity: 1; transform: none; } }

/* ── Loading ─── */
.loading-spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Field Guide ─── */
.field-guide summary::-webkit-details-marker { display: none; }
.field-guide summary::before { content: '▸ '; }
details[open].field-guide summary::before { content: '▾ '; }
.field-guide dl dt { margin-top: 0.4rem; }
.field-guide dl dt:first-child { margin-top: 0; }
.field-guide code {
  background: var(--deep);
  padding: 0.1em 0.35em;
  border-radius: 3px;
  font-size: 0.82em;
}

/* ── Responsive ─── */
@media (max-width: 600px) {
  #app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main-content { padding: 1.25rem; }
}
