:root {
  --bg: #040404;
  --bg-2: #0b0b0c;
  --panel: rgba(20, 20, 22, 0.94);
  --panel-2: rgba(10, 10, 12, 0.98);
  --ink: #f3f3f5;
  --muted: #a6a6ad;
  --line: rgba(255, 255, 255, 0.09);
  --accent: #f5f5f7;
  --accent-2: #d8d8de;
  --accent-dark: #94949b;
  --success: #d8d8de;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", "Helvetica Neue", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.08), transparent 28%),
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.05), transparent 24%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
}
a { color: inherit; }
button, .link-button {
  background: linear-gradient(180deg, #f7f7f8, #dadade);
  color: #09090a;
  border: 0;
  border-radius: 12px;
  padding: 0.8rem 1.1rem;
  text-decoration: none;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  letter-spacing: 0.02em;
}

input, select, textarea {
  width: 100%;
  padding: 0.8rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(7, 7, 9, 0.94);
  font: inherit;
  color: var(--ink);
}
textarea { min-height: 88px; resize: vertical; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.8rem; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; }

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  padding: 2rem 2rem 1rem;
}
.topbar h1 { margin: 0 0 0.4rem; font-size: clamp(2rem, 4vw, 3.4rem); letter-spacing: 0.03em; }
.topbar p { margin: 0; color: var(--muted); max-width: 60ch; }
.top-actions { display: flex; gap: 0.8rem; align-items: center; flex-wrap: wrap; }

.hero-ribbon {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--accent-2);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.9rem;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  padding: 0 2rem 1rem;
}
.card, .panel, .login-card, .mini-card {
  background: linear-gradient(180deg, rgba(24, 24, 26, 0.96), rgba(9, 9, 11, 0.98));
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 24px 40px rgba(0, 0, 0, 0.34);
}
.card {
  padding: 1.2rem;
  position: relative;
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, #ffffff, #74747d);
}
.card span, .mini-card span { display: block; color: var(--muted); margin-bottom: 0.4rem; }
.card strong, .mini-card strong { font-size: 1.6rem; }

.layout {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1rem;
  padding: 1rem 2rem 2rem;
}
.panel { padding: 1.2rem; overflow-x: auto; }
.panel.wide { grid-column: 1 / -1; }
.panel h2 { margin-top: 0; letter-spacing: 0.02em; }
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.stack { display: grid; gap: 0.8rem; }
.set-block + .set-block { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.set-title {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.8rem;
}
.item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.7rem;
}
.mini-card { padding: 0.9rem; background: var(--panel-2); }
.mini-card strong { color: var(--accent); }

.dashboard-grid {
  display: grid;
  gap: 1rem;
}

.supplier-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  padding: 0 2rem 2rem;
}

.inventory-table td:nth-child(3),
.inventory-table td:nth-child(4),
.inventory-table td:nth-child(5) {
  font-variant-numeric: tabular-nums;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.62rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--success);
  font-size: 0.82rem;
  font-weight: 700;
}

.traffic-badge {
  display: inline-flex;
  align-items: center;
  min-width: 78px;
  justify-content: center;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-align: center;
}

.traffic-urgent {
  background: rgba(255, 67, 67, 0.2);
  border: 1px solid rgba(255, 67, 67, 0.34);
  color: #ffd8d8;
}

.traffic-red {
  background: rgba(255, 92, 92, 0.15);
  border: 1px solid rgba(255, 92, 92, 0.28);
  color: #ff8a8a;
}

.traffic-amber {
  background: rgba(255, 191, 87, 0.14);
  border: 1px solid rgba(255, 191, 87, 0.26);
  color: #ffc66a;
}

.traffic-green {
  background: rgba(170, 170, 176, 0.14);
  border: 1px solid rgba(170, 170, 176, 0.24);
  color: #ededf0;
}

.traffic-slate {
  background: rgba(126, 126, 134, 0.16);
  border: 1px solid rgba(126, 126, 134, 0.26);
  color: #d3d3d8;
}

.prestige-set {
  background: linear-gradient(180deg, rgba(15, 15, 17, 0.98), rgba(8, 8, 10, 0.98));
  border-radius: 18px;
  padding: 1rem 1.1rem;
}

.set-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--accent-2);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.set-subtitle {
  display: block;
  margin-top: 0.28rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.set-visual-list {
  display: grid;
  gap: 0.85rem;
}

.set-bar-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 0.75rem;
  align-items: center;
}

.item-thumb {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  padding: 4px;
}

.set-bar-body {
  display: grid;
  gap: 0.42rem;
  min-width: 0;
}

.set-bar-copy {
  display: grid;
  gap: 0.32rem;
}

.set-bar-headline {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.set-bar-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.set-bar-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.set-bar-fill {
  height: 100%;
  border-radius: 999px;
}

.fill-red {
  background: linear-gradient(90deg, rgba(255, 99, 99, 0.86), rgba(255, 143, 143, 0.92));
}

.fill-urgent {
  background: linear-gradient(90deg, rgba(255, 67, 67, 0.92), rgba(255, 151, 151, 0.98));
}

.fill-amber {
  background: linear-gradient(90deg, rgba(255, 191, 87, 0.86), rgba(255, 219, 154, 0.92));
}

.fill-green {
  background: linear-gradient(90deg, rgba(140, 140, 148, 0.84), rgba(245, 245, 247, 0.96));
}

.fill-slate {
  background: linear-gradient(90deg, rgba(115, 115, 122, 0.82), rgba(168, 168, 174, 0.9));
}

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1rem;
}
.login-card {
  padding: 2rem;
  width: min(420px, 100%);
}
.error {
  margin: 0.8rem 0;
  color: #ff9b9b;
}

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .supplier-split { grid-template-columns: 1fr; }
  .topbar { flex-direction: column; }
}
