:root {
  --ink: #151515;
  --paper: #f4f5f9;
  --card: #ffffff;
  --line: #d8dae3;
  --brand: #5b21b6;
  --brand-soft: #ede9fe;
  --yellow: #ffd43b;
  --green: #16a34a;
  --amber: #d97706;
  --muted: #6b7280;
  --shadow: 6px 6px 0 var(--ink);
  --radius: 10px;
  --sidebar: 260px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  font-size: 14px;
  color: var(--ink);
  background:
    radial-gradient(circle at 0% 0%, #ede9fe 0%, transparent 42%),
    radial-gradient(circle at 100% 100%, #fff7d6 0%, transparent 38%),
    var(--paper);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.shell {
  display: grid;
  grid-template-columns: var(--sidebar) 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 18px;
  background: var(--ink);
  color: #fff;
  border-right: 4px solid var(--yellow);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--yellow);
  color: var(--ink);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 18px;
  border: 2px solid #fff;
}

.brand h1 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.brand p {
  margin: 2px 0 0;
  font-size: 11px;
  color: #a3a3a3;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 8px;
  font-weight: 700;
  color: #d4d4d4;
  border: 1px solid transparent;
  transition: 0.15s ease;
}

.nav a:hover,
.nav a.active {
  background: var(--brand);
  color: #fff;
  border-color: #fff;
}

.nav a .icon {
  width: 22px;
  text-align: center;
  opacity: 0.9;
}

.sidebar-foot {
  margin-top: auto;
  font-size: 11px;
  color: #737373;
  line-height: 1.45;
}

.main {
  padding: 24px 28px 80px;
  max-width: 1480px;
}

.view {
  display: none;
  animation: fade 0.25s ease;
}

.view.active {
  display: block;
}

@keyframes fade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.page-head h2 {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.page-head p {
  margin: 6px 0 0;
  color: var(--muted);
  max-width: 560px;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  border: 2px solid var(--ink);
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 800;
  cursor: pointer;
  background: var(--card);
  color: var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--ink);
}

.btn:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 var(--ink);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: 3px 3px 0 var(--ink);
}

.btn-primary {
  background: var(--yellow);
}

.btn-brand {
  background: var(--brand);
  color: #fff;
  border-color: var(--ink);
}

.btn-ghost {
  background: transparent;
  color: #fff;
  border-color: #525252;
  box-shadow: none;
}

.btn-ghost:hover {
  border-color: #fff;
  box-shadow: none;
  transform: none;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.card {
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}

.stat .num {
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
}

.stat .lbl {
  margin-top: 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 700;
}

.panel {
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border-bottom: 2px solid var(--ink);
  background: #fffdf2;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: #fafafa;
  position: sticky;
  top: 0;
  z-index: 3;
}

.toolbar input[type="search"],
.toolbar select,
.toolbar input[type="number"],
.toolbar input[type="file"] {
  border: 2px solid var(--ink);
  border-radius: 8px;
  padding: 9px 11px;
  background: #fff;
}

.toolbar input[type="search"] {
  min-width: 260px;
  flex: 1;
}

.toolbar label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  white-space: nowrap;
}

.table-wrap {
  overflow: auto;
  max-height: calc(100vh - 280px);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1180px;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--brand-soft);
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 11px 10px;
  border-bottom: 2px solid var(--ink);
  white-space: nowrap;
}

td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

tbody tr:hover {
  background: #faf8ff;
}

.thumb {
  width: 46px;
  height: 46px;
  object-fit: cover;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: #eee;
}

.name {
  font-weight: 800;
  max-width: 300px;
}

.sub {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.tag {
  display: inline-block;
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 800;
  background: #fff;
}

.tag.active {
  color: var(--green);
}

.tag.paused {
  color: #525252;
}

.tag.out_of_stock {
  color: var(--amber);
}

.price-in {
  width: 96px;
  border: 2px solid var(--ink);
  border-radius: 6px;
  padding: 8px;
}

.price-in.changed {
  background: #fff9d8;
}

.empty {
  padding: 56px 24px;
  text-align: center;
  color: var(--muted);
}

.empty h3 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 20px;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.step {
  border: 2px dashed var(--line);
  border-radius: 10px;
  padding: 14px;
  text-align: left;
  background: #fafafa;
}

.step strong {
  display: block;
  margin-bottom: 6px;
}

.form-grid {
  display: grid;
  gap: 14px;
  max-width: 520px;
}

.form-grid label {
  display: grid;
  gap: 6px;
  font-weight: 700;
}

.form-grid input {
  border: 2px solid var(--ink);
  border-radius: 8px;
  padding: 10px 12px;
}

.hint {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}

.scan-list {
  display: grid;
  gap: 10px;
}

.scan-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #fafafa;
}

.scan-item:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: #ecfdf5;
  color: var(--green);
  border: 1px solid #86efac;
}

.status-pill.warn {
  background: #fffbeb;
  color: var(--amber);
  border-color: #fcd34d;
}

.status-pill.err {
  background: #fef2f2;
  color: var(--red, #dc2626);
  border-color: #fca5a5;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(12px);
  padding: 12px 18px;
  background: var(--ink);
  color: #fff;
  border-radius: 8px;
  border: 2px solid var(--yellow);
  opacity: 0;
  pointer-events: none;
  transition: 0.2s ease;
  z-index: 100;
  font-weight: 700;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%);
}

.footer-bar {
  position: fixed;
  left: var(--sidebar);
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 28px;
  background: var(--ink);
  color: #fff;
  border-top: 4px solid var(--yellow);
  z-index: 50;
}

.footer-bar strong {
  color: var(--yellow);
}

.hidden {
  display: none !important;
}

@media (max-width: 1024px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
    border-right: none;
    border-bottom: 4px solid var(--yellow);
  }

  .nav {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .footer-bar {
    left: 0;
  }

  .grid-3,
  .steps {
    grid-template-columns: 1fr;
  }
}
