:root {
  --bg-1: #070b16;
  --bg-2: #0b1230;
  --bg-3: #14142a;
  --card: #0f1736;
  --card-2: #131b43;
  --text: #e6ecff;
  --muted: #a8b2d9;
  --primary: #4d67ff;
  --primary-dark: #3a4dd3;
  --accent: #8b5cf6;
  --danger: #d04255;
  --border: #2a3770;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", Tahoma, sans-serif;
  background: linear-gradient(160deg, #0d1330 0%, #0a1026 38%, #0a0f1f 72%, #070b16 100%);
  background-attachment: fixed;
  color: var(--text);
}
.container { width: min(1100px, 94%); margin: 0 auto; }

.topbar {
  background: linear-gradient(115deg, #2a3aa9 0%, #3d56e3 45%, #6a43cd 100%);
  color: var(--text);
  padding: 24px 0;
  margin-bottom: 34px;
  box-shadow: 0 10px 26px rgba(61, 86, 227, 0.4);
}
.topbar-inner { display: flex; justify-content: space-between; align-items: center; min-height: 44px; }
.brand {
  color: #f1f5ff;
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0.6px;
  font-size: 2rem;
}
.topbar a {
  color: #dfe7ff;
  text-decoration: none;
  margin-left: 18px;
  font-weight: 700;
  font-size: 1.35rem;
}
.topbar a:hover { color: #ffffff; }

.card {
  background: linear-gradient(180deg, var(--card) 0%, #0c1432 100%);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 18px;
  box-shadow: 0 10px 24px rgba(4, 8, 24, 0.45);
}
.narrow { max-width: 560px; }
.row { display: flex; gap: 10px; align-items: center; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }

h1, h2, h3 { color: #f0f4ff; margin-top: 0; }
p, td, th, label { color: var(--text); }

.form-grid { display: grid; gap: 12px; }
label { display: grid; gap: 6px; font-weight: 600; }
input, textarea, button {
  font: inherit;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
}
input, textarea {
  background: #111a3d;
  color: var(--text);
}
input:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(77, 103, 255, 0.22);
}
textarea { min-height: 90px; }

.btn {
  display: inline-block;
  background: linear-gradient(120deg, var(--primary) 0%, var(--accent) 100%);
  color: #f4f6ff;
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  text-decoration: none;
  cursor: pointer;
  font-weight: 600;
  box-shadow: 0 7px 18px rgba(77, 103, 255, 0.35);
}
.btn:hover { filter: brightness(1.08); }
.btn.secondary {
  background: linear-gradient(120deg, #1e2a64 0%, #27357a 100%);
  color: #dfe7ff;
  box-shadow: none;
  border: 1px solid #34458d;
}
.btn.danger {
  background: linear-gradient(120deg, #d04255 0%, #a62c3b 100%);
  color: #fff;
}
.btn.small { padding: 8px 10px; font-size: .9rem; }

table {
  width: 100%;
  border-collapse: collapse;
  background: #0d1534;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
th {
  background: #16204e;
  color: #dce5ff;
}
th, td {
  border-bottom: 1px solid #243168;
  padding: 9px 8px;
  text-align: left;
  vertical-align: top;
}

.stats {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  margin-bottom: 18px;
}
.stat {
  background: linear-gradient(180deg, var(--card-2) 0%, #10183b 100%);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
}
.stat b { font-size: 1.5rem; display: block; color: #b9c8ff; }
.stat span { color: var(--muted); }

.products {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.product-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: linear-gradient(180deg, #121a40 0%, #0c1430 100%);
}
.product-card img {
  border-radius: 8px;
}
.product-square {
  width: 240px;
  height: 240px;
  object-fit: cover;
  display: block;
  margin: 0 auto 10px;
  border: 1px solid var(--border);
}
.thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; }
.qr { width: 180px; height: auto; border: 1px solid var(--border); border-radius: 8px; }

.flash-zone { margin-bottom: 12px; }
.flash {
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 8px;
}
.flash.success { background: #123025; border: 1px solid #1f6549; color: #bcf4d9; }
.flash.error { background: #3b141d; border: 1px solid #6f2633; color: #ffd7dd; }
.hint { color: var(--muted); font-size: .95rem; }

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  background: #10183b;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.check:hover {
  border-color: #4459b2;
  background: #121d48;
}
.themed-checkbox {
  width: 20px;
  height: 20px;
  margin: 0;
  cursor: pointer;
  accent-color: #6b57f5;
}
.themed-checkbox:focus {
  box-shadow: 0 0 0 3px rgba(77, 103, 255, 0.22);
}
.check-label {
  color: var(--text);
  font-weight: 600;
}

code {
  background: #17204a;
  color: #cfd9ff;
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid #2b3b79;
}

a { color: #98abff; }
a:hover { color: #c1ceff; }

@media (max-width: 700px) {
  .row { flex-wrap: wrap; }
}

.action-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}
