@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
  --bg: #060109;
  --bg-alt: #0b0410;
  --card-bg: #100816;
  --red: #ff2596;
  --red-glow: #ff259666;
  --gold: #ffe135;
  --green: #2ee6a6;
  --cyan: #00d4c8;
  --text: #f4eef8;
  --text-dim: #b9a9c9;
  --text-faint: #7a6a8a;
  --border: #2a1a35;
  --radius: 12px;
  --sans: 'Space Grotesk', system-ui, sans-serif;
  --display: 'Bebas Neue', var(--sans);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  min-height: 100vh;
}
.hidden { display: none !important; }

.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background:
    radial-gradient(circle at 20% 20%, var(--red-glow), transparent 45%),
    radial-gradient(circle at 80% 80%, #8b2fff44, transparent 45%),
    var(--bg);
}
.auth-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.4rem;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 60px -20px #000c;
}
.auth-card h1 { font-family: var(--display); font-size: 2rem; margin: 0 0 0.2em; letter-spacing: 0.04em; }
.auth-card .brand-accent { color: var(--red); }
.auth-card p.sub { color: var(--text-dim); font-size: 0.85rem; margin-bottom: 1.6rem; }

label { display: block; font-size: 0.78rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-faint); margin: 0.9rem 0 0.4rem; }
input, textarea, select {
  width: 100%;
  background: #0a0410;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.7rem 0.9rem;
  color: var(--text);
  font-family: var(--sans);
  font-size: 0.92rem;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--red); }
textarea { resize: vertical; min-height: 80px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
}
.btn-primary { background: linear-gradient(135deg, var(--red), #a4002a); color: #fff; width: 100%; margin-top: 1.4rem; }
.btn-primary:hover { box-shadow: 0 0 24px var(--red-glow); }
.btn-outline { border-color: var(--border); color: var(--text); background: transparent; }
.btn-outline:hover { border-color: var(--red); color: var(--red); }
.btn-danger { border-color: #ff2596; color: var(--red); background: transparent; }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.72rem; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.error-msg { color: var(--red); font-size: 0.82rem; margin-top: 0.8rem; min-height: 1em; }
.hint-msg { color: var(--text-faint); font-size: 0.78rem; margin-top: 0.8rem; }

/* ---------- Dashboard shell ---------- */
.dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border);
  background: rgba(6,1,9,0.8);
  position: sticky;
  top: 0;
  z-index: 10;
}
.dash-header .brand { font-family: var(--display); font-size: 1.4rem; }
.dash-header .brand-accent { color: var(--red); }
.dash-header nav { display: flex; gap: 0.6rem; }

.dash-main { max-width: 1200px; margin: 0 auto; padding: 2rem; }
.dash-section { margin-bottom: 3rem; }
.dash-section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.2rem; }
.dash-section-head h2 { font-family: var(--display); font-size: 1.6rem; margin: 0; letter-spacing: 0.03em; }

.product-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
th, td { padding: 0.7rem 0.9rem; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { color: var(--text-faint); text-transform: uppercase; font-size: 0.7rem; letter-spacing: 0.06em; }
tr:last-child td { border-bottom: none; }
td img { width: 42px; height: 58px; object-fit: cover; border-radius: 4px; background: #000; }
.row-actions { display: flex; gap: 0.4rem; }
.pill { display: inline-block; padding: 0.15rem 0.55rem; border-radius: 999px; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.05em; }
.pill-sold { background: #3a0010; color: #ff5470; }
.pill-live { background: #0a2a1c; color: var(--green); }
.pill-featured { background: #3a2c00; color: var(--gold); }

/* ---------- Modal (add/edit product) ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(4,0,6,0.82); backdrop-filter: blur(6px);
  display: none; align-items: center; justify-content: center; z-index: 200; padding: 1.5rem;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius);
  max-width: 640px; width: 100%; max-height: 90vh; overflow-y: auto; padding: 2rem; position: relative;
}
.modal-close { position: absolute; top: 1rem; right: 1rem; background: transparent; border: none; color: var(--text-faint); font-size: 1.6rem; cursor: pointer; }
.modal-close:hover { color: var(--red); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.checkbox-row { display: flex; gap: 1.4rem; align-items: center; margin-top: 1rem; }
.checkbox-row label { display: flex; align-items: center; gap: 0.4rem; text-transform: none; font-size: 0.85rem; color: var(--text); margin: 0; }
.checkbox-row input { width: auto; }
.image-preview { width: 100px; height: 140px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); background: #000; margin-top: 0.6rem; }
.upload-row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }

/* ---------- Print sheet tool ---------- */
.print-tool-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem;
  background: var(--card-bg);
  display: flex;
  flex-wrap: wrap;
  gap: 1.4rem;
  align-items: flex-end;
}
.print-tool-card .field { flex: 1; min-width: 220px; }
.print-preview-thumb { width: 70px; height: 98px; object-fit: cover; border-radius: 4px; border: 1px solid var(--border); background: #000; }

/* ---------- Scanner / cropper ---------- */
.crop-frame {
  width: 100%;
  max-width: 280px;
  aspect-ratio: 5/7;
  margin: 1rem auto 0;
  overflow: hidden;
  border-radius: 8px;
  border: 2px solid var(--red);
  position: relative;
  background: #000;
  touch-action: none;
  cursor: grab;
}
.crop-frame img { position: absolute; top: 0; left: 0; max-width: none; user-select: none; pointer-events: none; }
#scan-crop-area input[type="range"] { width: 100%; margin-top: 0.4rem; }
#scan-crop-area select { margin-top: 0.4rem; }
#crop-confirm-btn { width: 100%; margin-top: 1.2rem; }

/* ---------- Change request notepad ---------- */
.cr-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.8rem 1rem;
  margin-bottom: 0.6rem;
  background: var(--card-bg);
}
.cr-text { flex: 1; font-size: 0.9rem; }
.cr-meta { font-size: 0.72rem; color: var(--text-faint); }
.cr-log {
  margin-top: 0.6rem;
  padding: 0.7rem;
  background: #05010a;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: monospace;
  font-size: 0.75rem;
  white-space: pre-wrap;
  max-height: 240px;
  overflow-y: auto;
}
