:root {
  color-scheme: light;
  --ink: #151515;
  --muted: #626a70;
  --line: #d8ded8;
  --paper: #fbfaf6;
  --white: #ffffff;
  --green: #1f6f4a;
  --green-dark: #12482f;
  --amber: #d99628;
  --rose: #b24a58;
  --sky: #337ca0;
  --danger: #a83246;
  --shadow: 0 18px 50px rgba(24, 36, 30, 0.16);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
textarea {
  width: 100%;
  min-height: 96px;
  resize: vertical;
  color: var(--ink);
  background: #f9faf7;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  outline-color: var(--green);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px clamp(18px, 4vw, 54px);
  background: rgba(251, 250, 246, 0.94);
  border-bottom: 1px solid rgba(216, 222, 216, 0.85);
  backdrop-filter: blur(16px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}
.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: white;
  background: var(--green);
  border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--amber);
}
.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.nav-actions a {
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.icon-button, .primary-button, .ghost-button, .hero-search button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  font-weight: 800;
}
.icon-button, .primary-button, .hero-search button {
  color: white;
  background: var(--green);
  box-shadow: 0 10px 22px rgba(31, 111, 74, 0.22);
}
.icon-button, .primary-button, .ghost-button, .danger-button {
  padding: 0 16px;
}
.primary-button { width: fit-content; }
.ghost-button {
  color: var(--green-dark);
  background: #e8f0ea;
}
.danger-button {
  min-height: 38px;
  color: #fff;
  background: var(--danger);
  border: 0;
  border-radius: 8px;
  font-weight: 800;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(340px, 1.12fr);
  gap: clamp(28px, 5vw, 70px);
  align-items: center;
  min-height: calc(100vh - 72px);
  padding: clamp(36px, 7vw, 86px) clamp(18px, 4vw, 54px) 44px;
  background:
    linear-gradient(90deg, rgba(251, 250, 246, 0.98), rgba(251, 250, 246, 0.72)),
    url("https://images.unsplash.com/photo-1555529669-e69e7aa0ba9a?auto=format&fit=crop&w=1800&q=80") center / cover;
}
.eyebrow {
  margin: 0 0 10px;
  color: var(--rose);
  font-size: 0.77rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}
h1, h2, h3, p { margin-top: 0; }
h1 {
  margin-bottom: 18px;
  max-width: 760px;
  font-size: clamp(3.1rem, 9vw, 7.4rem);
  line-height: 0.88;
  letter-spacing: 0;
}
.hero-text {
  max-width: 620px;
  color: #343a3d;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  line-height: 1.55;
}
.hero-search {
  display: flex;
  gap: 10px;
  max-width: 650px;
  margin-top: 28px;
  padding: 8px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.hero-search input {
  min-width: 0;
  flex: 1;
  border: 0;
  padding: 0 14px;
  outline: none;
}
.hero-search button { padding: 0 24px; }
.hero-window {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.display-item {
  position: relative;
  overflow: hidden;
  min-height: 220px;
  border: 4px solid var(--ink);
  border-radius: 8px;
  background: #ece9df;
  box-shadow: 8px 8px 0 rgba(21, 21, 21, 0.14);
}
.display-large {
  grid-row: span 2;
  min-height: 464px;
}
.display-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.display-item div {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  color: white;
  background: rgba(21, 21, 21, 0.78);
  border-radius: 8px;
}
.display-item span {
  color: #ffd88b;
  font-weight: 800;
  white-space: nowrap;
}

.search-band, .owner-band {
  padding: clamp(42px, 7vw, 82px) clamp(18px, 4vw, 54px);
}
.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}
.section-heading h2 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1;
}
.filters {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr 0.8fr;
  gap: 12px;
  padding: 16px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
}
label span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}
input, select {
  width: 100%;
  min-height: 46px;
  color: var(--ink);
  background: #f9faf7;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  outline-color: var(--green);
}
.results-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 18px 0;
  color: var(--muted);
  font-weight: 800;
}
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.product-card, .plan-card, .status-card, .payment-box {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 34px rgba(20, 28, 24, 0.08);
}
.product-card { overflow: hidden; }
.product-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #e8ece8;
}
.product-body { padding: 16px; }
.product-title-row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}
.product-title-row h3 {
  margin-bottom: 8px;
  font-size: 1.02rem;
}
.category-pill, .badge {
  flex: 0 0 auto;
  max-width: 44%;
  overflow: hidden;
  padding: 5px 8px;
  color: var(--green-dark);
  text-overflow: ellipsis;
  white-space: nowrap;
  background: #e8f0ea;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
}
.badge.pending { color: #865700; background: #fff2cf; }
.badge.approved, .badge.active { color: var(--green-dark); background: #dff0e5; }
.badge.suspended, .badge.expired { color: #8d1f33; background: #fae6ea; }
.price {
  display: block;
  margin-bottom: 10px;
  color: var(--rose);
  font-size: 1.18rem;
}
.description {
  color: #4b5357;
  font-size: 0.92rem;
  line-height: 1.45;
}
dl {
  display: grid;
  gap: 9px;
  margin: 0;
}
dl div {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 10px;
}
dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}
dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.owner-band { background: #eef4ee; }
.plan-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}
.plan-card { padding: 18px; }
.plan-card span {
  display: block;
  color: var(--muted);
  font-weight: 800;
}
.plan-card strong {
  display: block;
  margin: 8px 0;
  color: var(--green-dark);
  font-size: 1.55rem;
}
.plan-card p {
  margin-bottom: 0;
  color: #47504a;
  line-height: 1.45;
}
.featured-plan {
  border-color: var(--amber);
  box-shadow: 0 12px 34px rgba(217, 150, 40, 0.16);
}
.owner-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
}
.owner-copy p {
  max-width: 760px;
  margin-bottom: 0;
  color: #3f4842;
  font-size: 1.05rem;
  line-height: 1.6;
}

.panel {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  justify-content: flex-end;
  background: rgba(17, 24, 20, 0.5);
}
.panel.open {
  display: flex;
}
.panel-card {
  width: min(100%, 620px);
  height: 100%;
  overflow: auto;
  padding: 22px;
  background: var(--paper);
  box-shadow: var(--shadow);
}
.admin-card { width: min(100%, 980px); }
.dashboard-head, .shop-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.dashboard-head h2 {
  margin-bottom: 0;
  font-size: 2rem;
}
.close-button {
  width: 44px;
  height: 44px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 1.25rem;
  font-weight: 800;
}
.tabs, .owner-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 22px 0;
  padding: 6px;
  background: #e8eee9;
  border-radius: 8px;
}
.owner-actions {
  grid-template-columns: repeat(3, 1fr);
}
.tab {
  min-height: 42px;
  color: var(--green-dark);
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-weight: 800;
}
.tab.active {
  background: var(--white);
  box-shadow: 0 8px 20px rgba(20, 28, 24, 0.08);
}
.auth-form, .item-form, .admin-login {
  display: grid;
  gap: 14px;
}
.form-note {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}
.hidden { display: none !important; }
.payment-step, .owner-dashboard, .admin-dashboard {
  display: grid;
  gap: 18px;
}
.status-card, .payment-box {
  padding: 16px;
}
.status-card span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}
.status-card strong {
  display: block;
  margin: 4px 0 8px;
  font-size: 1.25rem;
}
.status-card p { margin-bottom: 0; line-height: 1.45; }
.status-card.warning { border-color: #f0cf79; background: #fffaf0; }
.status-card.danger { border-color: #efb3bf; background: #fff2f4; }
.payment-box h3 { margin-bottom: 14px; }
.shop-status {
  padding: 14px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.shop-status span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.owner-products h3, .profile-view h3, .admin-products h3 { margin-bottom: 12px; }
.owner-mini {
  display: grid;
  grid-template-columns: 76px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  margin-bottom: 10px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.owner-mini img {
  width: 76px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
}
.owner-mini strong, .owner-mini span { display: block; }
.owner-mini span {
  color: var(--muted);
  font-size: 0.86rem;
}
.mini-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.mini-actions button, .table-actions button {
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  font-weight: 800;
}
.edit-button { color: var(--green-dark); background: #e8f0ea; }
.delete-button { color: #7b1f2e; background: #f8e8eb; }
.profile-view dl {
  padding: 16px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.stat {
  padding: 14px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.stat span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}
.stat strong {
  display: block;
  margin-top: 8px;
  font-size: 1.7rem;
}
.admin-filter {
  grid-template-columns: 1.2fr 0.8fr;
}
.admin-table-wrap {
  overflow: auto;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
}
table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}
th, td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th {
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
}
.table-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.empty-state {
  padding: 28px;
  color: var(--muted);
  text-align: center;
  background: var(--white);
  border: 1px dashed var(--line);
  border-radius: 8px;
}

@media (max-width: 900px) {
  .hero, .owner-layout { grid-template-columns: 1fr; }
  .hero { min-height: auto; }
  .filters, .product-grid, .plan-grid, .stats-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }
  .nav-actions {
    width: 100%;
    justify-content: space-between;
  }
  .hero-search, .section-heading, .form-row {
    grid-template-columns: 1fr;
    flex-direction: column;
  }
  .hero-search { display: grid; }
  .hero-search input { min-height: 44px; }
  .hero-window, .filters, .product-grid, .plan-grid, .stats-grid, .admin-filter, .owner-actions {
    grid-template-columns: 1fr;
  }
  .display-large, .display-item { min-height: 250px; }
  .owner-layout .primary-button, .primary-button { width: 100%; }
  .owner-mini {
    grid-template-columns: 64px 1fr;
  }
  .owner-mini img {
    width: 64px;
    height: 58px;
  }
  .mini-actions {
    grid-column: 1 / -1;
    justify-content: stretch;
  }
  .mini-actions button { flex: 1; }
}
#forgotPasswordBtn {
  position: relative;
  z-index: 9999;
  pointer-events: auto !important;
}