:root {
  --ink: #162019;
  --muted: #68756d;
  --line: #d9e4dc;
  --soft: #f3f7f1;
  --paper: #fbfaf4;
  --white: #ffffff;
  --green: #1d7a4c;
  --green-dark: #143d2b;
  --gold: #f0b429;
  --brick: #b95538;
  --blue: #e3eff7;
  --shadow: 0 18px 55px rgba(21, 44, 31, 0.14);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(29, 122, 76, 0.06) 1px, transparent 1px),
    linear-gradient(0deg, rgba(29, 122, 76, 0.06) 1px, transparent 1px),
    var(--paper);
  background-size: 38px 38px;
}

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

button,
select {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

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

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

h1,
h2,
h3,
p {
  margin-top: 0;
}

.app-shell {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 24px;
  color: #f7fff9;
  background: #153b2a;
  overflow: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.brand-logo {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  color: #153b2a;
  background: var(--gold);
  border-radius: 8px;
  font-weight: 950;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.68);
  line-height: 1.35;
}

.side-nav {
  display: grid;
  gap: 6px;
}

.side-nav a {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  padding: 0 13px;
  color: rgba(255, 255, 255, 0.78);
  border-radius: 8px;
  font-weight: 800;
}

.side-nav a.active,
.side-nav a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.13);
}

.side-nav b {
  min-width: 26px;
  padding: 3px 7px;
  color: #153b2a;
  background: var(--gold);
  border-radius: 999px;
  text-align: center;
}

.supplier-card {
  margin-top: auto;
  padding: 16px;
  background: rgba(255, 255, 255, 0.11);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
}

.supplier-card span,
.supplier-card p {
  color: rgba(255, 255, 255, 0.7);
}

.supplier-card strong {
  display: block;
  margin: 4px 0 8px;
  font-size: 1.3rem;
}

.supplier-card p {
  margin-bottom: 0;
  line-height: 1.45;
}

.main {
  padding: 26px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.topbar h1 {
  margin-bottom: 0;
  font-size: clamp(1.8rem, 3vw, 3.1rem);
  line-height: 1;
}

.eyebrow {
  margin-bottom: 5px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.menu-button {
  display: none;
  width: 44px;
  height: 44px;
  padding: 10px;
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 8px;
}

.menu-button span {
  display: block;
  height: 2px;
  margin: 5px 0;
  background: var(--ink);
}

.primary-button,
.ghost-button,
.remove-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0 17px;
  border-radius: 8px;
  font-weight: 900;
}

.primary-button {
  color: #fff;
  background: var(--green);
  border: 1px solid var(--green);
}

.ghost-button {
  color: var(--green-dark);
  background: #eef6ef;
  border: 1px solid #cfe0d2;
}

.remove-button {
  color: #8e2f1e;
  background: #fff0eb;
  border: 1px solid #f0c8bd;
}

.full {
  width: 100%;
}

.view {
  display: none;
  animation: rise 220ms ease;
}

.view.active {
  display: block;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

.hero,
.stats-grid article,
.category-card,
.product-card,
.category-section,
.form-panel,
.preview-panel,
.summary-panel,
.cart-item,
.confirmation-card,
.order-card,
.admin-grid article,
.data-panel {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 42%);
  min-height: 430px;
  overflow: hidden;
}

.hero-copy {
  display: grid;
  align-content: center;
  padding: clamp(24px, 5vw, 54px);
}

.hero h2 {
  max-width: 760px;
  margin-bottom: 24px;
  font-size: clamp(2.3rem, 4.8vw, 5.4rem);
  line-height: 0.98;
}

.hero-media {
  position: relative;
  min-height: 340px;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-stat {
  position: absolute;
  right: 18px;
  bottom: 18px;
  min-width: 190px;
  padding: 16px;
  color: #fff;
  background: rgba(20, 61, 43, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
}

.hero-stat span,
.hero-stat strong {
  display: block;
}

.hero-stat span {
  color: rgba(255, 255, 255, 0.7);
  font-weight: 800;
}

.hero-stat strong {
  margin-top: 4px;
  font-size: 1.8rem;
}

.search-box {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  max-width: 660px;
  padding: 10px 10px 10px 16px;
  background: #eef6ef;
  border: 1px solid #cfe0d2;
  border-radius: 8px;
}

.search-box label {
  color: var(--muted);
  font-weight: 900;
  white-space: nowrap;
}

.search-box input,
.compact-search,
.section-title select,
.form-panel input,
.form-panel select,
.form-panel textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 13px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
}

.search-box input {
  border: 0;
  background: transparent;
}

.stats-grid,
.category-grid,
.product-grid,
.admin-grid {
  display: grid;
  gap: 16px;
}

.stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 18px 0 28px;
}

.stats-grid article,
.admin-grid article {
  display: grid;
  min-height: 118px;
  align-content: center;
  gap: 6px;
  padding: 20px;
  border-left: 6px solid var(--green);
}

.stats-grid span,
.admin-grid span,
.summary-line span,
.cart-item p,
.product-body p,
.category-heading p,
.form-note,
.order-card p,
.confirmation-grid span {
  color: var(--muted);
}

.stats-grid strong,
.admin-grid strong {
  font-size: clamp(1.7rem, 3vw, 3rem);
}

.section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin: 28px 0 14px;
}

.section-title h2 {
  margin-bottom: 0;
  font-size: clamp(1.45rem, 2.6vw, 2.4rem);
}

.section-title select,
.compact-search {
  max-width: 260px;
}

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

.category-card {
  overflow: hidden;
  padding: 0;
  text-align: left;
}

.category-card img {
  width: 100%;
  height: 140px;
  object-fit: cover;
}

.category-card span,
.category-card strong,
.category-card p,
.category-card b {
  display: block;
  margin-inline: 16px;
}

.category-card span {
  margin-top: 16px;
  color: var(--green);
  font-size: 0.8rem;
  font-weight: 950;
  text-transform: uppercase;
}

.category-card strong {
  margin-top: 4px;
  font-size: 1.4rem;
}

.category-card p {
  min-height: 66px;
  margin-top: 7px;
  color: var(--muted);
  line-height: 1.45;
}

.category-card b {
  margin-bottom: 16px;
}

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

.product-card {
  display: grid;
  overflow: hidden;
}

.product-card img {
  width: 100%;
  height: 170px;
  object-fit: cover;
  background: var(--blue);
}

.product-body {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.tag {
  display: inline-flex;
  width: fit-content;
  padding: 5px 9px;
  color: var(--green-dark);
  background: #e6f3e9;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 950;
}

.product-body h3,
.cart-item h3,
.order-card h3 {
  margin: 8px 0 5px;
  font-size: 1.08rem;
}

.price-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.price-row strong {
  font-size: 1.55rem;
}

.price-row span {
  color: var(--muted);
  font-weight: 800;
}

.card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.category-sections {
  display: grid;
  gap: 20px;
}

.category-section {
  padding: 20px;
}

.category-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.category-heading h2 {
  margin: 8px 0 4px;
}

.split-layout,
.checkout-layout,
.cart-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 18px;
  align-items: start;
}

.stack-panels {
  display: grid;
  gap: 18px;
}

.form-panel,
.preview-panel,
.summary-panel,
.data-panel {
  padding: clamp(18px, 3vw, 30px);
}

.form-panel {
  display: grid;
  gap: 14px;
}

.compact-panel {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.compact-panel h2 {
  margin-bottom: 0;
}

.form-panel label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 900;
}

.form-panel textarea {
  min-height: 110px;
  resize: vertical;
}

.form-note {
  min-height: 24px;
  margin-bottom: 0;
  font-weight: 800;
}

.preview-panel {
  position: sticky;
  top: 24px;
}

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

.cart-item {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 126px 120px auto;
  gap: 14px;
  align-items: center;
  padding: 12px;
}

.cart-item img {
  width: 96px;
  height: 84px;
  object-fit: cover;
  border-radius: 8px;
}

.quantity-control {
  display: grid;
  grid-template-columns: 38px 1fr 38px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.quantity-control button,
.quantity-control strong {
  display: grid;
  min-height: 38px;
  place-items: center;
  border: 0;
  background: #fff;
}

.quantity-control strong {
  border-inline: 1px solid var(--line);
}

.summary-panel {
  position: sticky;
  top: 24px;
}

.summary-line,
.summary-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.summary-line.small {
  font-size: 0.92rem;
}

.summary-total {
  margin: 8px 0 18px;
  border-bottom: 0;
  font-size: 1.3rem;
}

.summary-total strong {
  font-size: 1.8rem;
}

.confirmation-card {
  max-width: 880px;
  margin: 0 auto;
  padding: clamp(24px, 5vw, 52px);
  text-align: center;
}

.success-icon {
  display: grid;
  width: 74px;
  height: 74px;
  place-items: center;
  margin: 0 auto 18px;
  color: #fff;
  background: var(--green);
  border-radius: 50%;
  font-size: 2.6rem;
  font-weight: 950;
}

.confirmation-card h2 {
  margin-bottom: 10px;
  font-size: clamp(2.1rem, 5vw, 4rem);
}

.confirmation-card > p:not(.eyebrow) {
  max-width: 620px;
  margin: 0 auto 22px;
  color: var(--muted);
  line-height: 1.55;
}

.confirmation-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 22px 0;
}

.confirmation-grid div {
  padding: 15px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: left;
}

.confirmation-grid span,
.confirmation-grid strong {
  display: block;
}

.confirmation-grid strong {
  margin-top: 6px;
}

.order-items {
  display: grid;
  gap: 8px;
  max-width: 620px;
  margin: 0 auto 24px;
  text-align: left;
}

.order-items span {
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.tracking-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 24px;
}

.tracking-steps span {
  padding: 12px;
  color: var(--muted);
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 900;
}

.tracking-steps .done {
  color: #fff;
  background: var(--green);
  border-color: var(--green);
}

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

.order-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 18px;
  align-items: center;
  padding: 16px;
}

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

.admin-grid .wide {
  grid-column: span 2;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

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

th {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
}

.empty-state {
  padding: 20px;
  color: var(--muted);
  background: #fff;
  border: 1px dashed #b9c8bd;
  border-radius: 8px;
  font-weight: 800;
}

.hidden {
  display: none;
}

.mobile-nav {
  display: none;
}

.toast {
  position: fixed;
  z-index: 20;
  right: 24px;
  bottom: 24px;
  max-width: min(420px, calc(100vw - 32px));
  padding: 14px 18px;
  color: #fff;
  background: var(--green-dark);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  box-shadow: var(--shadow);
  font-weight: 900;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

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

@media (max-width: 1240px) {
  .product-grid,
  .category-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    z-index: 12;
    inset: 0 auto 0 0;
    width: min(86vw, 330px);
    transform: translateX(-105%);
    transition: transform 190ms ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .menu-button {
    display: block;
  }

  .main {
    padding-bottom: 92px;
  }

  .hero,
  .split-layout,
  .checkout-layout,
  .cart-layout {
    grid-template-columns: 1fr;
  }

  .hero-media {
    order: -1;
    min-height: 280px;
  }

  .summary-panel,
  .preview-panel {
    position: static;
  }

  .cart-item {
    grid-template-columns: 86px minmax(0, 1fr) 112px;
  }

  .cart-item > strong,
  .cart-item .remove-button {
    grid-column: 2 / -1;
  }

  .mobile-nav {
    position: fixed;
    z-index: 10;
    right: 14px;
    bottom: 14px;
    left: 14px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    overflow: hidden;
    background: var(--green-dark);
    border-radius: 8px;
    box-shadow: var(--shadow);
  }

  .toast {
    right: 14px;
    bottom: 84px;
    left: 14px;
    max-width: none;
  }

  .mobile-nav a {
    display: grid;
    min-height: 56px;
    place-items: center;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.86rem;
    font-weight: 900;
  }

  .mobile-nav a.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.14);
  }
}

@media (max-width: 720px) {
  .main {
    padding: 16px 14px 92px;
  }

  .topbar {
    align-items: start;
  }

  .topbar .ghost-button {
    display: none;
  }

  .hero h2 {
    font-size: 2.35rem;
  }

  .search-box,
  .section-title,
  .category-heading {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .section-title,
  .category-heading {
    display: grid;
  }

  .section-title select,
  .compact-search {
    max-width: none;
  }

  .product-grid,
  .category-grid,
  .stats-grid,
  .admin-grid,
  .confirmation-grid,
  .tracking-steps {
    grid-template-columns: 1fr;
  }

  .admin-grid .wide {
    grid-column: auto;
  }

  .cart-item {
    grid-template-columns: 78px minmax(0, 1fr);
  }

  .cart-item .quantity-control,
  .cart-item > strong,
  .cart-item .remove-button {
    grid-column: 1 / -1;
  }

  .order-card {
    grid-template-columns: 1fr;
  }
}
