:root {
  /* Primary */
  --white: #ffffff;
  --black: #000000;

  /* Secondary brand */
  --rose: #ce857e;
  --slate: #7892a4;
  --sage: #719c8b;
  --charcoal: #636569;

  --bg: #000000;
  --bg-elevated: #111111;
  --card: #141414;
  --ink: #ffffff;
  --muted: #a0a2a5;
  --line: #2a2b2d;
  --line-strong: #636569;

  --brand: #ffffff;
  --accent: #ce857e;
  --accent-2: #7892a4;
  --accent-3: #719c8b;

  --ok: #719c8b;
  --err: #ce857e;
  --info: #7892a4;

  --shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  --radius: 14px;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
}

a { color: var(--slate); }
a:hover { color: var(--white); }

.wrap { width: min(1100px, calc(100% - 2rem)); margin: 0 auto; }

.top {
  background: rgba(0, 0, 0, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.top-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 0;
}

.brand {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  text-decoration: none;
  color: var(--white);
}

.brand-mark {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 0.7rem;
  display: grid;
  place-items: center;
  background: var(--sage);
  color: var(--black);
  font-weight: 700;
}

.brand strong { color: var(--white); }
.brand small { display: block; color: var(--charcoal); }

nav { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
nav a {
  color: var(--slate);
  text-decoration: none;
  font-weight: 600;
}
nav a:hover { color: var(--white); }

.user-email { font-size: 0.9rem; color: var(--charcoal); }
main { padding: 1.75rem 0 3rem; }
.footer { padding: 1rem 0 2.5rem; color: var(--charcoal); }
.footer p { margin: 0.25rem 0; }
.muted { color: var(--muted); }
.tiny { font-size: 0.82rem; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.35rem;
  margin-bottom: 1rem;
}

.login-card {
  max-width: 460px;
  margin: 2rem auto;
  border-top: 3px solid var(--rose);
}
.success-card {
  max-width: 640px;
  border-top: 3px solid var(--sage);
}

.page-head { margin-bottom: 1rem; }
.page-head h1,
.card h1,
.card h2,
h1,
h2 {
  margin: 0 0 0.35rem;
  letter-spacing: -0.02em;
  color: var(--white);
}
.lede { line-height: 1.5; color: var(--muted); }
.eyebrow { margin: 0 0 0.4rem; font-size: 0.9rem; }
.eyebrow a { color: var(--slate); }

.stack { display: grid; gap: 0.9rem; }
.grid-2 {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

label {
  display: grid;
  gap: 0.35rem;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--muted);
}

input[type="email"],
input[type="text"],
input[type="number"],
input[type="date"],
input[type="file"],
select,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
  font: inherit;
  background: var(--bg-elevated);
  color: var(--white);
}
input[type="date"] {
  color-scheme: dark;
}
select {
  appearance: auto;
  cursor: pointer;
}
.ordering-contact-field {
  border: 1px solid var(--slate);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  background: rgba(120, 146, 164, 0.08);
}
.ordering-contact-label {
  display: block;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 0.4rem;
}
.ordering-contact-select {
  font-size: 1.05rem;
  margin-bottom: 0.35rem;
}
input[type="file"] { color: var(--muted); }
input::placeholder,
textarea::placeholder { color: #6a6c70; }
input:focus,
textarea:focus {
  outline: 2px solid var(--slate);
  outline-offset: 1px;
  border-color: var(--slate);
}
textarea { resize: vertical; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1px solid var(--white);
  background: transparent;
  color: var(--white);
  border-radius: 999px;
  padding: 0.65rem 1.1rem;
  font: inherit;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: #1a1a1a; }
.btn.primary {
  background: var(--white);
  color: var(--black);
  border-color: var(--white);
}
.btn.primary:hover {
  background: var(--slate);
  border-color: var(--slate);
  color: var(--black);
}
.btn.small { padding: 0.4rem 0.85rem; font-size: 0.9rem; }
.btn.danger {
  border-color: var(--rose);
  color: var(--rose);
  background: transparent;
}
.btn.danger:hover { background: rgba(206, 133, 126, 0.12); }

.linkish {
  background: none;
  border: none;
  color: var(--slate);
  font: inherit;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}
.linkish:hover { color: var(--white); }
.inline { display: inline; margin: 0; }

.flash {
  border-radius: 12px;
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  border: 1px solid var(--line);
}
.flash-info {
  background: rgba(120, 146, 164, 0.15);
  color: #b8c9d5;
  border-color: rgba(120, 146, 164, 0.45);
}
.flash-success {
  background: rgba(113, 156, 139, 0.15);
  color: #b5d4c8;
  border-color: rgba(113, 156, 139, 0.45);
}
.flash-error {
  background: rgba(206, 133, 126, 0.15);
  color: #e8b8b3;
  border-color: rgba(206, 133, 126, 0.45);
}

.table-wrap { overflow-x: auto; padding: 0; }
table { width: 100%; border-collapse: collapse; }
th, td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--charcoal);
}
tr:last-child td { border-bottom: 0; }
.right { text-align: right; }

.pill {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(120, 146, 164, 0.2);
  color: var(--slate);
  font-size: 0.82rem;
}

.line-block {
  border-top: 1px solid var(--line);
  padding: 1rem 0;
}
.line-block:first-of-type { border-top: 0; }
.line-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.size-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 0.5rem;
}
.size-cell {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--charcoal);
}
.size-upcharge {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--rose);
  margin-top: 0.1rem;
}
.size-cell input {
  padding: 0.5rem;
  text-align: center;
  background: var(--bg-elevated);
  color: var(--white);
  border-color: var(--line-strong);
}

.row-between {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}
.sticky-bar {
  position: sticky;
  bottom: 0.75rem;
  background: rgba(20, 20, 20, 0.96);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
  padding-top: 0.75rem;
}
.total {
  font-size: 1.6rem;
  font-weight: 750;
  letter-spacing: -0.03em;
  color: var(--white);
}

.meta-list { display: grid; gap: 0.65rem; margin: 1.25rem 0; }
.meta-list div {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 0.5rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--line);
}
.meta-list dt { color: var(--charcoal); font-weight: 600; }
.meta-list dd { margin: 0; font-weight: 650; color: var(--white); }
.success-label {
  color: var(--sage);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
code {
  font-size: 0.9rem;
  background: #1c1d1f;
  color: var(--slate);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

/* Exactly 3 product columns on desktop */
.product-grid,
.product-grid.cols-3 {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 1.15rem;
}

.product-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--white);
  overflow: hidden;
  min-height: 180px;
  transition: transform 0.12s ease, border-color 0.12s ease;
}
.product-card:hover {
  transform: translateY(-2px);
  border-color: var(--slate);
}

.product-proof {
  aspect-ratio: 1 / 1;
  background: #0c0c0c;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  display: grid;
  place-items: center;
}
.product-proof img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #0a0a0a;
  display: block;
}

.proof-placeholder {
  width: 100%;
  height: 100%;
  min-height: 160px;
  display: grid;
  place-items: center;
  color: var(--charcoal);
  font-size: 0.9rem;
  font-weight: 600;
  background:
    linear-gradient(45deg, #1a1a1a 25%, transparent 25%),
    linear-gradient(-45deg, #1a1a1a 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #1a1a1a 75%),
    linear-gradient(-45deg, transparent 75%, #1a1a1a 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-color: #111;
}
.proof-placeholder.tall { min-height: 320px; }

.product-card-body { padding: 1.1rem 1.15rem 0.5rem; flex: 1; }
.product-card h2 { font-size: 1.1rem; margin: 0 0 0.35rem; color: var(--white); }
.product-meta { margin-top: 0.75rem; display: grid; gap: 0.25rem; }
.price { font-weight: 700; color: var(--sage); }

.product-card-cta {
  padding: 0.75rem 1.15rem;
  border-top: 1px solid var(--line);
  font-weight: 650;
  color: var(--black);
  background: var(--slate);
}

.order-layout {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(320px, 1.2fr);
  gap: 1rem;
  align-items: start;
}
.proof-panel h2 { margin-bottom: 0.75rem; }
.proof-full {
  display: block;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #0a0a0a;
}
.proof-full img {
  width: 100%;
  height: auto;
  display: block;
  max-height: 520px;
  object-fit: contain;
}

.admin-proof-preview {
  max-width: 280px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #0a0a0a;
  margin-bottom: 0.75rem;
}
.admin-proof-preview img { width: 100%; height: auto; display: block; }

.cart-proof-cell { width: 72px; }
.cart-proof-thumb {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0a0a0a;
  display: block;
}

.size-grid.large {
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 0.65rem;
}
.size-grid.large .size-cell input {
  padding: 0.7rem;
  font-size: 1.05rem;
}

.fieldset {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.9rem 1rem 1rem;
}
.fieldset legend {
  font-weight: 700;
  padding: 0 0.35rem;
  color: var(--slate);
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.45rem 0.75rem;
  margin-top: 0.5rem;
}
.check {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 550;
  font-size: 0.92rem;
  color: var(--muted);
}
.check-row {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  padding-top: 1.5rem;
}

@media (max-width: 900px) {
  .product-grid,
  .product-grid.cols-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .order-layout { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .product-grid,
  .product-grid.cols-3 {
    grid-template-columns: 1fr !important;
  }
}
@media (max-width: 640px) {
  .meta-list div { grid-template-columns: 1fr; }
  th:nth-child(4), td:nth-child(4),
  th:nth-child(5), td:nth-child(5) { display: none; }
}

/* Admin client dashboard */
.client-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}
.client-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem 0;
  text-decoration: none;
  color: var(--white);
  box-shadow: var(--shadow);
  transition: border-color 0.12s ease, transform 0.12s ease;
  overflow: hidden;
}
.client-card:hover {
  border-color: var(--slate);
  transform: translateY(-2px);
  color: var(--white);
}
.client-card-top {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
}
.client-card h2 { font-size: 1.15rem; margin: 0; }
.client-card-cta {
  margin-top: 0.75rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--line);
  color: var(--slate);
  font-weight: 650;
}
.client-card-wrap { display: grid; gap: 0.35rem; }
.client-delete { padding: 0 0.25rem 0.5rem; }
.danger-text { color: var(--rose) !important; }

.admin-product-list { display: grid; gap: 1rem; }
.admin-product-card { padding: 0; overflow: hidden; }
.admin-product-card.is-inactive { opacity: 0.72; }
.admin-product-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 0;
}
.admin-product-proof {
  background: #0c0c0c;
  border-right: 1px solid var(--line);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.admin-product-proof img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background: #0a0a0a;
  border-radius: 8px;
  border: 1px solid var(--line);
}
.proof-upload-form label { color: var(--charcoal); }
.admin-product-body { padding: 1.1rem 1.2rem 1.2rem; }
.price-form .price-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.price-form .price-row input { max-width: 140px; }

@media (max-width: 720px) {
  .admin-product-layout { grid-template-columns: 1fr; }
  .admin-product-proof { border-right: 0; border-bottom: 1px solid var(--line); }
}
