:root {
  --ink: #172026;
  --muted: #5f6f78;
  --line: #d9e1e4;
  --paper: #f7f7f4;
  --panel: #ffffff;
  --teal: #087c7a;
  --teal-dark: #075b5a;
  --red: #be3f32;
  --yellow: #f2bd3d;
  --green: #3a7d44;
  --shadow: 0 16px 50px rgba(23, 32, 38, 0.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

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

button {
  border: 0;
  border-radius: 6px;
  background: var(--teal);
  color: white;
  font-weight: 750;
  padding: 0.78rem 1rem;
  cursor: pointer;
}

button:hover { background: var(--teal-dark); }
button:disabled { background: #aab5ba; cursor: not-allowed; }

.secondary {
  background: white;
  color: var(--ink);
  border: 1px solid var(--line);
}

.secondary:hover { background: #eef4f4; }

.hidden { display: none !important; }

.site-home {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
  background:
    linear-gradient(90deg, rgba(247, 247, 244, 0.96), rgba(247, 247, 244, 0.78)),
    url("assets/merch-banner.png") center / cover;
}

.home-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 3rem);
  border-bottom: 1px solid rgba(23, 32, 38, 0.12);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(8px);
}

.home-hero {
  width: min(780px, 100%);
  align-self: center;
  padding: clamp(2rem, 7vw, 6rem);
}

.home-hero h1 {
  margin: 0;
  max-width: 12ch;
  font-size: clamp(2.4rem, 5vw, 5rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.home-hero p:not(.eyebrow) {
  max-width: 52ch;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.6;
}

.portal-url {
  display: inline-flex;
  width: auto;
  margin: 0.25rem 0 0;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink) !important;
  font-weight: 800;
}

.home-hero button { margin-top: 1rem; }

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem;
  background:
    linear-gradient(rgba(247, 247, 244, 0.84), rgba(247, 247, 244, 0.94)),
    url("assets/merch-banner.png") center / cover;
}

.auth-grid {
  width: min(1180px, 100%);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
}

.login-panel {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 2rem;
  box-shadow: var(--shadow);
}

.login-panel h1, .hero-copy h1, h2 { margin: 0; letter-spacing: 0; }
.login-panel p { color: var(--muted); line-height: 1.5; }

label {
  display: grid;
  gap: 0.45rem;
  color: #314249;
  font-size: 0.92rem;
  font-weight: 700;
}

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 0.72rem 0.78rem;
}

textarea { resize: vertical; }

.login-panel button { width: 100%; margin-top: 1rem; }
.login-panel small { display: block; margin-top: 1rem; color: var(--muted); }

.approval-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
  box-shadow: var(--shadow);
}

.approval-panel .compact { padding: 0; margin-bottom: 1rem; }

.pending-list {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.pending-account {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.8rem;
  display: grid;
  gap: 0.55rem;
}

.pending-account strong { line-height: 1.25; }

.pending-actions {
  display: flex;
  gap: 0.5rem;
}

.pending-actions button { flex: 1; padding: 0.55rem 0.7rem; }

.danger {
  background: var(--red);
}

.danger:hover {
  background: #983125;
}

.status-note {
  padding: 0.75rem;
  border-radius: 8px;
  background: #eef4f4;
  color: var(--muted);
  line-height: 1.45;
}

.hero {
  min-height: 420px;
  position: relative;
  overflow: hidden;
  display: grid;
  align-items: end;
  padding: 1rem clamp(1rem, 4vw, 3rem) 2rem;
  background: #dde6e3;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(8, 42, 44, 0.78), rgba(8, 42, 44, 0.35) 46%, rgba(8, 42, 44, 0.08));
}

.hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.topbar {
  position: absolute;
  z-index: 2;
  top: 1rem;
  left: clamp(1rem, 4vw, 3rem);
  right: clamp(1rem, 4vw, 3rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: white;
}

.topbar div { display: grid; gap: 0.15rem; }
.topbar span { color: rgba(255, 255, 255, 0.78); font-size: 0.88rem; }

.hero-copy {
  position: relative;
  z-index: 2;
  width: min(720px, 100%);
  color: white;
}

.hero-copy h1 {
  font-size: clamp(2rem, 4vw, 4.2rem);
  line-height: 1.02;
  max-width: 13ch;
}

.hero-copy p:last-child {
  max-width: 54ch;
  color: rgba(255, 255, 255, 0.86);
  font-size: 1.05rem;
  line-height: 1.55;
}

.eyebrow {
  margin: 0 0 0.45rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--teal);
  font-size: 0.76rem;
  font-weight: 850;
}

.hero .eyebrow { color: var(--yellow); }

.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--line);
  background: white;
}

.summary-strip div {
  padding: 1rem clamp(1rem, 3vw, 2rem);
  border-right: 1px solid var(--line);
  display: grid;
  gap: 0.15rem;
}

.summary-strip span { font-size: 1.35rem; font-weight: 850; }
.summary-strip small { color: var(--muted); }

.layout {
  display: grid;
  grid-template-columns: minmax(210px, 250px) minmax(0, 1fr) minmax(300px, 380px);
  gap: 1rem;
  padding: 1rem;
  align-items: start;
}

.controls, .cart-panel, .orders-section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.controls {
  position: sticky;
  top: 1rem;
  padding: 1rem;
  display: grid;
  gap: 1rem;
}

.control-row label {
  display: flex;
  grid-template-columns: auto 1fr;
  align-items: center;
  font-weight: 700;
}

.control-row input { width: auto; }

.help-text {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.catalog {
  min-width: 0;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  margin-bottom: 1rem;
}

.section-head h2 { font-size: 1.45rem; }
.section-head > span { color: var(--muted); font-weight: 700; }
.compact { align-items: start; margin: 0; padding: 1rem 1rem 0; }

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 0.9rem;
}

.product-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  display: grid;
  grid-template-rows: 210px 1fr;
  min-height: 388px;
}

.product-art {
  height: 210px;
  min-height: 0;
  display: grid;
  place-items: center;
  background: #f5f7f6;
  border-bottom: 1px solid var(--line);
  padding: 1.1rem;
  overflow: hidden;
}

.product-art img {
  display: block;
  max-width: 92%;
  max-height: 92%;
  width: auto;
  height: auto;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.product-info {
  padding: 0.85rem;
  display: grid;
  gap: 0.55rem;
}

.product-info h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.25;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.2rem 0.45rem;
  background: #f8faf9;
}

.price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}

.price { font-size: 1.08rem; font-weight: 850; }
.stock { color: var(--green); font-weight: 800; }
.low { color: var(--red); }

.cart-panel {
  position: sticky;
  top: 1rem;
  overflow: hidden;
}

.icon-button {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 6px;
  background: #eef4f4;
  color: var(--ink);
  font-size: 1.5rem;
  line-height: 1;
}

.cart-items {
  display: grid;
  gap: 0.6rem;
  padding: 1rem;
  max-height: 290px;
  overflow: auto;
}

.cart-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.6rem;
}

.cart-line h3 {
  margin: 0 0 0.18rem;
  font-size: 0.92rem;
}

.qty {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.qty button {
  width: 28px;
  height: 28px;
  padding: 0;
  background: #eef4f4;
  color: var(--ink);
}

.cart-empty {
  padding: 1rem;
  color: var(--muted);
}

.totals {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 0.9rem 1rem;
  display: grid;
  gap: 0.45rem;
}

.totals div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.grand { font-size: 1.12rem; }

.checkout {
  padding: 1rem;
  display: grid;
  gap: 0.85rem;
}

.orders-section {
  margin: 0 1rem 2rem;
  padding: 1rem;
}

.orders-table-wrap { overflow: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
  background: white;
}

th, td {
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 0.75rem;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  max-width: min(420px, calc(100vw - 2rem));
  background: var(--ink);
  color: white;
  border-radius: 8px;
  padding: 0.9rem 1rem;
  box-shadow: var(--shadow);
  transform: translateY(140%);
  transition: transform 0.22s ease;
  z-index: 5;
}

.toast.show { transform: translateY(0); }

@media (max-width: 1100px) {
  .layout { grid-template-columns: 230px minmax(0, 1fr); }
  .cart-panel { grid-column: 1 / -1; position: static; }
}

@media (max-width: 760px) {
  .hero { min-height: 480px; }
  .topbar { align-items: flex-start; }
  .summary-strip { grid-template-columns: repeat(2, 1fr); }
  .layout { grid-template-columns: 1fr; padding: 0.75rem; }
  .controls { position: static; }
  .section-head { align-items: start; flex-direction: column; }
  .orders-section { margin: 0 0.75rem 1.5rem; }
  .hero-copy h1 { max-width: 12ch; }
  .auth-grid { grid-template-columns: 1fr; }
  .home-nav { align-items: flex-start; flex-direction: column; }
}
