:root {
  --cream: #fff8ee;
  --cream-2: #f6e7d0;
  --butter: #f0bd6c;
  --apricot: #dd7c55;
  --berry: #9d414f;
  --cocoa: #352118;
  --coffee: #6f4e37;
  --pistachio: #849d6a;
  --sage: #5f704f;
  --ink: #211915;
  --muted: #75665d;
  --line: rgba(53, 33, 24, 0.14);
  --card: rgba(255, 252, 246, 0.84);
  --shadow: 0 24px 80px rgba(53, 33, 24, 0.14);
  --radius: 28px;
  --sans: "Trebuchet MS", "Gill Sans", "Segoe UI", sans-serif;
  --serif: "Palatino Linotype", "Book Antiqua", Georgia, serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 10%, rgba(240, 189, 108, 0.34), transparent 32rem),
    radial-gradient(circle at 82% 4%, rgba(132, 157, 106, 0.24), transparent 24rem),
    linear-gradient(135deg, #fff7eb 0%, #f9ead4 48%, #f5d8c4 100%);
  font-family: var(--sans);
}

body::before {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
  opacity: 0.18;
  background-image:
    linear-gradient(90deg, rgba(53, 33, 24, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(53, 33, 24, 0.08) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(to bottom, #000, transparent 72%);
}

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

button,
a.button {
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  color: #fffaf2;
  background: linear-gradient(135deg, var(--cocoa), var(--berry));
  box-shadow: 0 12px 32px rgba(80, 39, 31, 0.2);
  padding: 0.9rem 1.15rem;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

button:hover,
a.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 36px rgba(80, 39, 31, 0.26);
}

button.secondary,
a.secondary {
  color: var(--cocoa);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  box-shadow: none;
}

button.subtle {
  color: var(--cocoa);
  background: transparent;
  border: 1px solid var(--line);
  box-shadow: none;
}

button.danger {
  background: linear-gradient(135deg, #8f2f2f, #c35a47);
}

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

.app-shell {
  position: relative;
  z-index: 1;
}

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

.site-nav,
.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 0;
}

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

.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid rgba(53, 33, 24, 0.18);
  border-radius: 18px;
  background: linear-gradient(135deg, #fff4df, #eebd84);
  color: var(--cocoa);
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 700;
  box-shadow: 0 14px 40px rgba(89, 53, 30, 0.16);
}

.brand-name {
  display: block;
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.brand-sub {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.nav-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 2rem;
  align-items: stretch;
  padding: 3.2rem 0 2.4rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border: 1px solid rgba(53, 33, 24, 0.12);
  border-radius: 999px;
  color: var(--coffee);
  background: rgba(255, 255, 255, 0.46);
  padding: 0.38rem 0.72rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1,
.section-title h2,
.login-card h1 {
  margin: 0;
  color: var(--cocoa);
  font-family: var(--serif);
  font-weight: 700;
  letter-spacing: -0.06em;
}

.hero h1 {
  max-width: 11ch;
  margin-top: 1rem;
  font-size: clamp(3.3rem, 9vw, 8rem);
  line-height: 0.88;
}

.hero p {
  max-width: 58ch;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.5rem;
}

.hero-panel,
.card,
.order-builder,
.login-card,
.modal-card,
.admin-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-panel {
  position: relative;
  overflow: hidden;
  min-height: 520px;
  padding: 1.2rem;
}

.cake-poster {
  display: grid;
  position: relative;
  height: 100%;
  min-height: 480px;
  place-items: center;
  border-radius: 24px;
  background:
    radial-gradient(circle at 50% 38%, rgba(255, 255, 255, 0.86), transparent 9rem),
    radial-gradient(circle at 42% 52%, #8f4435 0 5rem, transparent 5.1rem),
    radial-gradient(circle at 56% 52%, #c06052 0 6rem, transparent 6.1rem),
    radial-gradient(circle at 50% 62%, #f1d5b4 0 8.6rem, transparent 8.7rem),
    linear-gradient(155deg, #f8c37d, #f7e5c8 48%, #b7c194);
}

.cake-poster::before,
.cake-poster::after {
  position: absolute;
  content: "";
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
}

.cake-poster::before {
  width: 72%;
  height: 2.8rem;
  bottom: 7rem;
}

.cake-poster::after {
  width: 56%;
  height: 1.6rem;
  bottom: 9.2rem;
  background: rgba(90, 46, 32, 0.14);
}

.poster-note {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  left: 1rem;
  border-radius: 24px;
  color: #fff8ef;
  background: rgba(53, 33, 24, 0.78);
  padding: 1rem;
}

.poster-note strong {
  display: block;
  font-family: var(--serif);
  font-size: 1.45rem;
}

.section {
  padding: 2.6rem 0;
}

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

.section-title h2 {
  font-size: clamp(2rem, 5vw, 4.2rem);
  line-height: 0.98;
}

.section-title p {
  max-width: 46rem;
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.catalogue-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.product-card {
  display: flex;
  min-height: 340px;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: 1rem;
}

.product-art {
  height: 120px;
  border-radius: 22px;
  background:
    radial-gradient(circle at 28% 44%, rgba(255, 255, 255, 0.8), transparent 2.6rem),
    radial-gradient(circle at 50% 64%, rgba(90, 42, 29, 0.5), transparent 4.2rem),
    linear-gradient(135deg, var(--apricot), var(--butter));
}

.product-card:nth-child(2n) .product-art {
  background:
    radial-gradient(circle at 62% 44%, rgba(255, 255, 255, 0.8), transparent 2.8rem),
    radial-gradient(circle at 48% 62%, rgba(60, 34, 25, 0.52), transparent 4.6rem),
    linear-gradient(135deg, #cda276, #7f4938);
}

.product-card:nth-child(3n) .product-art {
  background:
    radial-gradient(circle at 36% 40%, rgba(255, 255, 255, 0.74), transparent 2.2rem),
    radial-gradient(circle at 55% 58%, rgba(157, 65, 79, 0.42), transparent 4.8rem),
    linear-gradient(135deg, #d9a5a8, #f4d7bb);
}

.product-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  margin-top: 1rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border: 1px solid rgba(53, 33, 24, 0.12);
  border-radius: 999px;
  color: var(--coffee);
  background: rgba(255, 255, 255, 0.58);
  padding: 0.32rem 0.58rem;
  font-size: 0.78rem;
  font-weight: 700;
}

.product-card h3,
.admin-panel h2,
.modal-card h2 {
  margin: 0.7rem 0 0.4rem;
  color: var(--cocoa);
  font-family: var(--serif);
  font-size: 1.45rem;
  line-height: 1.05;
}

.product-card p,
.muted,
.empty {
  color: var(--muted);
  line-height: 1.55;
}

.price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.8rem;
  margin-top: 1rem;
  color: var(--cocoa);
}

.price {
  font-family: var(--serif);
  font-size: 1.7rem;
  font-weight: 700;
}

.order-layout {
  display: grid;
  grid-template-columns: 0.78fr 1.22fr;
  gap: 1rem;
  align-items: start;
}

.order-builder {
  padding: 1.2rem;
}

.order-summary {
  position: sticky;
  top: 1rem;
  padding: 1.2rem;
}

.summary-line {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
  padding: 0.75rem 0;
}

.summary-line.total {
  border-bottom: 0;
  color: var(--cocoa);
  font-family: var(--serif);
  font-size: 1.8rem;
  font-weight: 700;
}

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

.form-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.38rem;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  color: var(--coffee);
  font-size: 0.82rem;
  font-weight: 800;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  padding: 0.86rem 0.95rem;
  outline: none;
}

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

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: rgba(157, 65, 79, 0.45);
  box-shadow: 0 0 0 4px rgba(157, 65, 79, 0.1);
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1rem;
}

.footer {
  padding: 2.8rem 0;
  color: var(--muted);
}

.login-wrap {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 1rem;
}

.login-card {
  width: min(460px, 100%);
  padding: 1.4rem;
}

.login-card h1 {
  margin-top: 1rem;
  font-size: 3.2rem;
  line-height: 0.9;
}

.login-card form {
  display: grid;
  gap: 0.8rem;
  margin-top: 1.2rem;
}

.admin-layout {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 280px minmax(0, 1fr);
}

.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--line);
  background: rgba(255, 248, 238, 0.74);
  padding: 1rem;
  backdrop-filter: blur(18px);
}

.admin-nav {
  display: grid;
  gap: 0.45rem;
  margin-top: 1.4rem;
}

.admin-nav button {
  justify-content: flex-start;
  width: 100%;
  color: var(--cocoa);
  background: transparent;
  border: 1px solid transparent;
  box-shadow: none;
  text-align: left;
}

.admin-nav button.active {
  background: rgba(255, 255, 255, 0.78);
  border-color: var(--line);
}

.admin-main {
  padding: 1rem min(3vw, 2rem) 3rem;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
}

.metric {
  padding: 1rem;
}

.metric span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-top: 0.4rem;
  color: var(--cocoa);
  font-family: var(--serif);
  font-size: 2.3rem;
}

.admin-panel {
  margin-top: 1rem;
  padding: 1rem;
}

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

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

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

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

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

tr:hover td {
  background: rgba(255, 255, 255, 0.34);
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.row-actions button {
  padding: 0.48rem 0.68rem;
  font-size: 0.86rem;
}

.status {
  border-radius: 999px;
  padding: 0.25rem 0.55rem;
  color: #fffaf2;
  background: var(--coffee);
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.status.to_confirm {
  background: var(--apricot);
}

.status.confirmed,
.status.in_progress {
  background: var(--sage);
}

.status.ready {
  background: var(--pistachio);
}

.status.delivered {
  background: var(--cocoa);
}

.status.cancelled {
  background: #8e8a84;
}

.modal-backdrop {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: center;
  overflow-y: auto;
  background: rgba(33, 25, 21, 0.34);
  padding: 1rem;
}

.modal-card {
  width: min(900px, 100%);
  max-height: min(92vh, 980px);
  overflow-y: auto;
  padding: 1.1rem;
}

.modal-actions {
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
  margin-top: 1rem;
}

.toast {
  position: fixed;
  z-index: 40;
  right: 1rem;
  bottom: 1rem;
  max-width: min(420px, calc(100% - 2rem));
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 18px;
  color: #fffaf2;
  background: rgba(53, 33, 24, 0.92);
  box-shadow: var(--shadow);
  padding: 0.9rem 1rem;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

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

.split-list {
  display: grid;
  gap: 0.7rem;
}

.mini-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.48);
  padding: 0.85rem;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.filters input,
.filters select {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  padding: 0.7rem 0.9rem;
}

.hidden {
  display: none !important;
}

@media (max-width: 980px) {
  .hero,
  .order-layout {
    grid-template-columns: 1fr;
  }

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

  .order-summary {
    position: static;
  }

  .admin-layout {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: relative;
    height: auto;
  }

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

@media (max-width: 680px) {
  .site-nav,
  .section-title,
  .admin-topbar,
  .panel-head,
  .mini-card {
    align-items: stretch;
    flex-direction: column;
  }

  .hero {
    padding-top: 1.2rem;
  }

  .hero h1 {
    font-size: clamp(3rem, 19vw, 5rem);
  }

  .catalogue-grid,
  .admin-grid,
  .form-grid,
  .form-grid.three {
    grid-template-columns: 1fr;
  }

  .hero-panel,
  .cake-poster {
    min-height: 360px;
  }

  .nav-actions,
  .hero-actions,
  .contact-actions,
  .modal-actions {
    flex-direction: column;
  }

  button,
  a.button {
    width: 100%;
    text-align: center;
  }
}
