:root {
  --ink: #16110f;
  --muted: #756b64;
  --wine: #541926;
  --wine-dark: #221018;
  --gold: #b79a67;
  --paper: #f7f4ef;
  --line: #ded7cf;
  --white: #fffdfa;
  --success: #2d6a4f;
  --warning: #a76519;
  --danger: #9b2226;
}

* {
  box-sizing: border-box;
}

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

h1,
h2,
h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  line-height: 1.02;
}

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

img {
  display: block;
  max-width: 100%;
}

main {
  min-height: calc(100vh - 74px);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 14px 28px;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
  background: rgba(34, 16, 24, .96);
  color: var(--white);
}

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

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(183, 154, 103, .7);
  border-radius: 50%;
  color: var(--gold);
  font-family: Georgia, serif;
  letter-spacing: 0;
}

.brand small {
  display: block;
  color: #cbbfb6;
  font-size: 12px;
}

.main-nav {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.main-nav a,
.cart-link {
  padding: 10px 13px;
  border-radius: 6px;
  color: #e8ded8;
  font-size: 14px;
}

.main-nav a.is-active,
.main-nav a:hover,
.cart-link:hover {
  background: rgba(255, 255, 255, .08);
  color: var(--white);
}

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

select,
input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
}

.cart-link span {
  margin-left: 6px;
  color: var(--gold);
  font-weight: 700;
}

.auth-link,
.user-pill {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  border-radius: 6px;
  padding: 0 14px;
  color: #e8ded8;
  font-size: 14px;
}

.auth-link:hover,
.auth-link.is-active {
  background: rgba(255, 255, 255, .08);
  color: var(--white);
}

.user-pill {
  border: 1px solid rgba(183, 154, 103, .28);
  color: var(--gold);
}

.nav-cta {
  min-height: 42px;
  background: var(--white);
  color: var(--wine-dark);
}

.flash {
  margin: 18px auto 0;
  max-width: 1180px;
  padding: 12px 16px;
  border: 1px solid rgba(45, 106, 79, .25);
  border-radius: 6px;
  background: #eff7f1;
  color: var(--success);
}

.auth-shell {
  display: grid;
  width: min(1120px, calc(100% - 36px));
  min-height: calc(100vh - 74px);
  grid-template-columns: minmax(0, 1fr) 430px;
  gap: 48px;
  align-items: center;
  margin-inline: auto;
  padding: 56px 0;
}

.auth-copy h1 {
  max-width: 720px;
  font-size: clamp(46px, 7vw, 86px);
}

.auth-copy p:not(.eyebrow) {
  max-width: 620px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.8;
}

.demo-accounts {
  display: grid;
  max-width: 420px;
  gap: 8px;
  margin-top: 28px;
  padding: 18px;
  border: 1px solid rgba(183, 154, 103, .35);
  border-radius: 8px;
  background: var(--white);
  color: var(--muted);
}

.demo-accounts strong {
  color: var(--ink);
}

.demo-accounts small {
  color: var(--gold);
  font-weight: 800;
}

.auth-card {
  display: grid;
  gap: 16px;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 24px 70px rgba(34, 16, 24, .09);
}

.auth-card h2 {
  margin-bottom: 4px;
  font-size: 38px;
}

.auth-card .button {
  width: 100%;
  margin-top: 4px;
}

.auth-card p {
  margin: 0;
  color: var(--muted);
}

.auth-card a {
  color: var(--wine);
  font-weight: 800;
}

.shop-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 30px;
  align-items: end;
  min-height: 270px;
  padding: 72px min(6vw, 72px);
  background:
    linear-gradient(90deg, rgba(0, 0, 0, .82), rgba(0, 0, 0, .62)),
    radial-gradient(circle at 74% 42%, rgba(183, 154, 103, .24), transparent 32%),
    var(--wine-dark);
  color: var(--white);
}

.shop-hero h1 {
  max-width: 820px;
  font-size: clamp(42px, 7vw, 82px);
}

.shop-hero p:not(.eyebrow) {
  max-width: 680px;
  color: #d7ccc4;
  font-size: 17px;
  line-height: 1.7;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.hero-panel,
.metric {
  padding: 24px;
  border: 1px solid rgba(183, 154, 103, .35);
  border-radius: 8px;
  background: rgba(255, 255, 255, .05);
}

.hero-panel span,
.metric strong {
  display: block;
  color: var(--gold);
  font-family: Georgia, serif;
  font-size: 48px;
  font-weight: 500;
}

.hero-panel small,
.metric span {
  color: #cfc4bd;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: .12em;
}

.section-head,
.dashboard-shell,
.product-grid,
.product-detail {
  width: min(1180px, calc(100% - 36px));
  margin-inline: auto;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding: 54px 0 22px;
}

.section-head h2,
.dash-head h1 {
  font-size: clamp(34px, 5vw, 58px);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  background: var(--white);
}

.product-card {
  display: grid;
  min-height: 620px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #f2f0ed;
}

.product-image {
  display: grid;
  min-height: 360px;
  place-items: center;
  padding: 28px;
}

.product-image img {
  max-height: 330px;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.product-meta {
  align-self: end;
  padding: 0 42px 36px;
  text-align: center;
}

.product-meta span {
  color: var(--gold);
  font-weight: 700;
  letter-spacing: .12em;
}

.product-meta h3 {
  margin-top: 10px;
  font-size: 24px;
}

.product-meta p {
  min-height: 54px;
  color: var(--muted);
  line-height: 1.5;
}

.price-row {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  margin: 18px 0 12px;
}

.price-row strong,
.detail-price {
  color: var(--gold);
  font-family: Georgia, serif;
  font-size: 32px;
  font-weight: 500;
}

.price-row small,
.detail-price span {
  color: #b8afa8;
  font-size: 14px;
}

.card-cart-form {
  display: grid;
  justify-items: center;
  gap: 14px;
}

.button,
button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 4px;
  padding: 0 22px;
  background: var(--wine);
  color: var(--white);
  cursor: pointer;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.button.dark {
  background: #050505;
}

.button.gold {
  background: var(--gold);
}

.button.ghost {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
}

.button.mini {
  min-height: 34px;
  padding: 0 12px;
  font-size: 12px;
}

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

.button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.product-detail {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(360px, 520px);
  gap: 62px;
  align-items: center;
  padding: 48px 0 80px;
}

.product-stage {
  display: grid;
  min-height: 680px;
  place-items: center;
  background: #f2f0ed;
}

.product-stage img {
  max-height: 620px;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.product-info h1 {
  font-size: clamp(46px, 6vw, 76px);
}

.lead {
  margin: 34px 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.85;
}

.product-buy {
  margin: 0 0 46px;
}

.detail-price {
  margin-bottom: 24px;
  color: var(--ink);
  font-size: 56px;
}

.qty-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr);
  gap: 18px;
  max-width: 440px;
}

.quantity-block {
  display: grid;
  gap: 10px;
  justify-items: start;
}

.quantity-block.compact {
  justify-items: center;
}

.quantity-block span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.qty-control {
  display: flex;
  width: 222px;
  height: 74px;
  align-items: stretch;
  border: 1px solid #aaa49d;
  background: var(--white);
}

.quantity-block.compact .qty-control {
  width: 222px;
  height: 74px;
}

.qty-control input {
  width: 74px;
  min-width: 0;
  height: 72px;
  flex: 0 0 74px;
  min-height: 48px;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: var(--white);
  text-align: center;
  font-size: 20px;
  -moz-appearance: textfield;
}

.qty-control input::-webkit-outer-spin-button,
.qty-control input::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.qty-control .qty-btn {
  width: 73px;
  height: 72px;
  min-width: 73px;
  min-height: 72px;
  flex: 0 0 73px;
  border-radius: 0;
  padding: 0;
  background: var(--white);
  color: #5e5751;
  font-size: 24px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.qty-control .qty-btn:hover {
  background: #f1ede7;
}

.qty-form .button {
  width: 100%;
}

.wine-specs {
  display: grid;
  gap: 22px;
  margin: 0;
}

.wine-specs div {
  display: grid;
  grid-template-columns: 150px 42px 1fr;
  align-items: center;
  gap: 22px;
}

.wine-specs div::before {
  content: "";
  grid-column: 2;
  height: 1px;
  background: var(--gold);
}

.wine-specs dt {
  grid-column: 1;
  grid-row: 1;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.wine-specs dd {
  grid-column: 3;
  grid-row: 1;
  margin: 0;
  font-family: Georgia, serif;
  font-style: italic;
  font-size: 17px;
}

.factsheet {
  display: inline-block;
  margin-top: 46px;
  color: var(--gold);
}

.dashboard-shell {
  padding: 42px 0 80px;
}

.dash-head {
  margin-bottom: 28px;
}

.dash-head p:not(.eyebrow) {
  max-width: 760px;
  color: var(--muted);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.metric {
  background: var(--wine-dark);
}

.admin-console {
  width: min(1380px, calc(100% - 36px));
}

.admin-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.admin-alert {
  display: grid;
  min-width: 190px;
  gap: 4px;
  padding: 20px;
  border: 1px solid rgba(183, 154, 103, .35);
  border-radius: 8px;
  background: var(--white);
}

.admin-alert strong {
  color: var(--gold);
  font-family: Georgia, serif;
  font-size: 44px;
  font-weight: 500;
}

.admin-alert span,
.counter-badge {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.admin-tabs {
  position: sticky;
  top: 71px;
  z-index: 5;
  display: flex;
  gap: 8px;
  margin: 24px 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(247, 244, 239, .94);
  backdrop-filter: blur(10px);
}

.admin-tabs a {
  min-height: 40px;
  border-radius: 6px;
  padding: 10px 14px;
  color: var(--muted);
  font-weight: 800;
}

.admin-tabs a:hover {
  background: var(--white);
  color: var(--wine);
}

.admin-metrics {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.admin-section {
  margin-top: 18px;
}

.card-title-row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.card-title-row .eyebrow {
  margin-bottom: 6px;
}

.counter-badge {
  display: inline-flex;
  min-width: 38px;
  min-height: 32px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #eee8dc;
  color: var(--wine);
}

.muted-copy {
  color: var(--muted);
}

.stack-list {
  display: grid;
  gap: 12px;
}

.approval-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf7;
}

.approval-item strong,
.approval-item span {
  display: block;
}

.approval-item span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

.product-approval {
  grid-template-columns: 74px minmax(0, 1fr) auto;
}

.product-approval img {
  width: 58px;
  height: 74px;
  border-radius: 6px;
  object-fit: cover;
}

.table-card,
.editor-card,
.empty-state {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.table-card h2,
.editor-card h2 {
  margin-bottom: 18px;
  font-size: 30px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.status {
  display: inline-flex;
  min-width: 78px;
  justify-content: center;
  border-radius: 999px;
  padding: 5px 10px;
  background: #eee8dc;
  color: var(--warning);
  font-size: 12px;
  font-weight: 800;
}

.status.approved,
.status.paid,
.status.active {
  background: #e6f2ea;
  color: var(--success);
}

.status.rejected,
.status.suspended {
  background: #f8e8e8;
  color: var(--danger);
}

.status.pending {
  background: #f4eee1;
  color: var(--warning);
}

.inline-form {
  display: flex;
  gap: 8px;
}

.taxonomy-create {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf7;
}

.taxonomy-row-form input {
  min-width: 180px;
}

.vendor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, .95fr);
  gap: 22px;
  align-items: start;
}

.vendor-tabs {
  display: flex;
  gap: 8px;
  margin: 0 0 22px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.vendor-tabs a {
  min-height: 40px;
  border-radius: 6px;
  padding: 10px 14px;
  color: var(--muted);
  font-weight: 800;
}

.vendor-tabs a.is-active,
.vendor-tabs a:hover {
  background: var(--wine);
  color: var(--white);
}

.vendor-gate {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
  padding: 24px;
  border: 1px solid rgba(167, 101, 25, .3);
  border-radius: 8px;
  background: #fff8eb;
}

.vendor-gate h2 {
  font-size: 34px;
}

.vendor-gate p:not(.eyebrow) {
  margin-bottom: 0;
  color: var(--muted);
}

.editor-card.is-disabled {
  opacity: .72;
}

.editor-card.is-disabled input,
.editor-card.is-disabled textarea,
.editor-card.is-disabled select {
  pointer-events: none;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.tour-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 22px;
  align-items: start;
}

.tour-editor-main,
.tour-editor-side,
.tour-two-col {
  display: grid;
  gap: 18px;
}

.tour-two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tour-editor-side {
  position: sticky;
  top: 96px;
}

.permalink-wrapper {
  display: flex;
  align-items: stretch;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f7f4ef;
}

.permalink-prefix {
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-right: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}

.permalink-input {
  flex: 1;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.permalink-edit-btn {
  min-height: 44px;
  border-left: 1px solid var(--line);
  border-radius: 0;
  background: var(--white);
  color: var(--wine);
  padding-inline: 12px;
  font-size: 12px;
}

.check-row {
  display: flex;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
}

.check-row input {
  width: auto;
  min-height: auto;
}

.repeater-card .card-title-row {
  align-items: center;
}

.repeater-list {
  display: grid;
  gap: 12px;
}

.repeater-item {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf7;
}

.repeater-item label:first-child,
.repeater-item label:nth-child(2),
.repeater-item label:nth-child(4) {
  grid-column: 1 / -1;
}

.repeater-item .button {
  justify-self: start;
}

.schedule-grid,
.slot-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.weekday-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.weekday-picker legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.weekday-picker .check-row {
  min-width: 72px;
}

.full-button {
  width: 100%;
}

.type-badge {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  background: #eee8dc;
  color: var(--wine);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.tour-detail-list,
.tour-list {
  display: grid;
  gap: 10px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}

.tour-list li,
.tour-detail-list li {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

input,
textarea,
select {
  min-height: 44px;
  padding: 10px 12px;
}

textarea {
  min-height: 92px;
  resize: vertical;
}

.wide {
  grid-column: 1 / -1;
}

.editor-card .button {
  margin-top: 18px;
}

.small-input {
  max-width: 88px;
}

.cart-total {
  display: flex;
  justify-content: flex-end;
  gap: 18px;
  margin: 20px 0;
  font-size: 22px;
}

.cart-total strong {
  color: var(--gold);
}

@media (max-width: 980px) {
  .topbar,
  .shop-hero,
  .product-detail,
  .vendor-layout,
  .tour-editor,
  .tour-two-col,
  .auth-shell,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .tour-editor-side {
    position: static;
  }

  .admin-head,
  .vendor-gate {
    align-items: start;
    flex-direction: column;
  }

  .main-nav {
    justify-content: start;
    overflow-x: auto;
  }

  .admin-tabs {
    overflow-x: auto;
  }

  .product-grid,
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .product-stage {
    min-height: 460px;
  }
}

@media (max-width: 640px) {
  .topbar {
    padding: 12px 16px;
  }

  .top-actions,
  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .top-actions {
    gap: 8px;
  }

  .product-grid,
  .metric-grid,
  .form-grid,
  .repeater-item,
  .taxonomy-create {
    grid-template-columns: 1fr;
  }

  .product-card {
    min-height: auto;
  }

  .product-meta {
    padding: 0 24px 28px;
  }

  .qty-form {
    grid-template-columns: 1fr;
  }

  .qty-form .button {
    grid-column: 1 / -1;
  }

  .wine-specs div {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .wine-specs div::before {
    display: none;
  }

  .wine-specs dd,
  .wine-specs dt {
    grid-column: 1;
    grid-row: auto;
  }

  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}
