:root {
  --purple: #2a1240;
  --purple-mid: #4a1f6a;
  --rose: #c9a8c0;
  --rose-gold: #d4a574;
  --bg: #140a1f;
  --card: #1f1030;
  --text: #f5eef8;
  --muted: #b9a6c8;
  --ok: #6bcf8e;
  --bad: #e57373;
  --border: #3d2458;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}
a { color: var(--rose-gold); }
header {
  background: linear-gradient(90deg, var(--purple), var(--purple-mid));
  border-bottom: 1px solid var(--rose-gold);
  padding: 0.9rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
header h1 {
  margin: 0;
  font-size: 1.2rem;
  color: var(--rose-gold);
  letter-spacing: 0.04em;
}
nav a {
  margin-right: 1rem;
  text-decoration: none;
  color: var(--text);
  font-size: 0.95rem;
}
nav a:hover { color: var(--rose-gold); }
main { padding: 1.5rem; max-width: 1100px; margin: 0 auto; }
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
}
.stat {
  background: var(--purple);
  border-radius: 8px;
  padding: 1rem;
  border: 1px solid var(--border);
}
.stat .n { font-size: 1.8rem; color: var(--rose-gold); font-weight: 700; }
.stat .l { color: var(--muted); font-size: 0.85rem; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
th, td {
  text-align: left;
  padding: 0.55rem 0.4rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
th { color: var(--rose-gold); font-weight: 600; }
label { display: block; margin: 0.6rem 0 0.25rem; color: var(--muted); font-size: 0.85rem; }
input, select, textarea {
  width: 100%;
  max-width: 480px;
  padding: 0.5rem 0.65rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #12081c;
  color: var(--text);
}
/* Checkbox rows: keep box + label text tight on one line */
label.check,
label:has(> input[type="checkbox"]) {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  width: fit-content;
  max-width: 100%;
  margin: 0.55rem 0 0.2rem;
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.35;
}
input[type="checkbox"] {
  width: auto;
  max-width: none;
  margin: 0;
  padding: 0;
  flex: 0 0 auto;
  accent-color: var(--rose-gold);
  background: transparent;
  border: none;
}
button, .btn {
  display: inline-block;
  margin-top: 1rem;
  background: var(--rose-gold);
  color: #1a0a20;
  border: none;
  border-radius: 6px;
  padding: 0.55rem 1.1rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}
button.secondary, .btn.secondary {
  background: transparent;
  color: var(--rose-gold);
  border: 1px solid var(--rose-gold);
}
.error { color: var(--bad); margin: 0.5rem 0; }
.ok { color: var(--ok); }
.muted { color: var(--muted); font-size: 0.85rem; }
.login-wrap {
  max-width: 380px;
  margin: 4rem auto;
}
code, .mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85em;
  word-break: break-all;
}
.badge {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.75rem;
  background: var(--purple-mid);
}
.badge.ok { background: #1e3d2a; color: var(--ok); }
.badge.bad { background: #3d1e1e; color: var(--bad); }
.badge.warn { background: #3d351e; color: #e6c86e; }

/* --- product pictures & dropbox inventory --- */
.thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); background: #0e0617; display:block; }
.thumb.lg { width: 220px; height: 220px; }
.thumb.empty { display:flex; align-items:center; justify-content:center; color: var(--muted); font-size: .7rem; text-align:center; }
.badge { display:inline-block; padding: .1rem .5rem; border-radius: 999px; font-size: .75rem; border:1px solid var(--rose-gold); color: var(--rose-gold); margin: .1rem .2rem .1rem 0; }
.badge.new { background: var(--rose-gold); color: var(--purple); }
.badge.warn { border-color: var(--bad); color: var(--bad); }
.badge.good { border-color: var(--ok); color: var(--ok); }
.row { display:flex; gap:1.25rem; flex-wrap:wrap; align-items:flex-start; }
.pick-preview { display:flex; gap:1rem; align-items:center; margin:.5rem 0 1rem; }

.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.public-header { text-align: center; margin: 1.5rem 0 1rem; }
.public-header h1 { color: var(--rose-gold); margin: 0; }

/* --- live chat --- */
.staff-status { margin: 0.5rem 0 1rem; }
.staff-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border);
}
.staff-row:last-child { border-bottom: none; }
.chat-start { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.5rem 0 1rem; }
.chat-start .btn, .chat-start button { margin-top: 0; }
.chat-panel { margin-top: 0.75rem; }
.chat-messages {
  max-height: 320px;
  overflow-y: auto;
  background: #0e0617;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
}
.chat-messages.admin-chat { max-height: 420px; }
.chat-bubble {
  margin: 0.4rem 0;
  padding: 0.5rem 0.7rem;
  border-radius: 8px;
  background: var(--purple-mid);
  max-width: 92%;
}
.chat-bubble.customer { background: #1a1028; border-left: 3px solid var(--rose-gold); }
.chat-bubble.staff { background: #231433; border-left: 3px solid var(--ok); margin-left: auto; }
.chat-form { display: flex; gap: 0.5rem; align-items: center; }
.chat-form input { flex: 1; margin: 0; }
.chat-form button { margin-top: 0; }
