
@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Playfair+Display:wght@500;600;700&display=swap");

:root {
  --ink: #26231f;
  --muted: #77716a;
  --paper: #f7f4ee;
  --white: #fffefa;
  --line: #e8e1d7;
  --terra: #a85f45;
  --terra-dark: #82452f;
  --sage: #75816a;
  --soft-sage: #edf0e8;
  --soft-terra: #f4e9e3;
  --shadow: 0 12px 36px rgba(45, 35, 25, .07);
  --radius: 18px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "DM Sans", sans-serif;
  font-size: 14px;
  line-height: 1.55;
}

h1, h2, h3 {
  margin: 0;
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 600;
  line-height: 1.15;
}

h1 { font-size: clamp(30px, 4vw, 44px); }
h2 { font-size: 27px; }
h3 { font-size: 19px; }

p { margin: 8px 0; }
a { color: var(--terra-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
small { display: block; color: var(--muted); font-size: 11px; }
.muted { color: var(--muted); }
.eyebrow {
  color: var(--terra);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 50%;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 21px;
  letter-spacing: -.06em;
}
.brand-mark.small {
  width: 38px;
  height: 38px;
  border-color: var(--line);
  color: var(--terra);
  font-size: 16px;
}

/* Authentication pages */

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(circle at 15% 15%, rgba(168,95,69,.12), transparent 32%),
    var(--paper);
}

.auth-shell {
  width: min(1040px, 100%);
  display: grid;
  grid-template-columns: 1fr 440px;
  gap: 70px;
  align-items: center;
}
.auth-shell.single { display: block; max-width: 760px; }
.auth-brand { padding: 36px 20px; }
.auth-brand .brand-mark { margin-bottom: 30px; background: var(--terra); color: white; }
.auth-brand h1 { font-size: clamp(42px, 6vw, 66px); margin: 12px 0 18px; }
.auth-brand > p:last-child { max-width: 380px; color: var(--muted); font-size: 16px; }

.auth-card {
  padding: 38px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--white);
  box-shadow: var(--shadow);
}
.auth-card.wide { padding: 42px; }
.auth-card h2 { margin: 8px 0; }
.auth-footer { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); }
.auth-footer a { margin-left: 5px; font-weight: 700; }
.back-link { display: inline-block; margin-bottom: 28px; }

/* Forms */

label {
  display: grid;
  gap: 7px;
  color: #4d4740;
  font-size: 12px;
  font-weight: 600;
}
input, select, textarea {
  width: 100%;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid #ded6cb;
  border-radius: 9px;
  outline: none;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 400;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--terra);
  box-shadow: 0 0 0 3px rgba(168,95,69,.12);
}
textarea { resize: vertical; }
.stack { display: grid; gap: 17px; }
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.form-grid.compact { gap: 13px; }
.form-grid .full { grid-column: 1 / -1; }
.auth-card .stack { margin-top: 26px; }

.form-message { min-height: 20px; margin: 10px 0; color: var(--muted); font-size: 13px; }
.form-message.error { color: #a13e32; }
.form-message.success { color: #4e6c45; }

/* Buttons */

.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  border: 1px solid transparent;
  border-radius: 9px;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  transition: .18s ease;
}
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.button.primary { background: var(--terra); color: white; }
.button.primary:hover { background: var(--terra-dark); }
.button.secondary { border-color: var(--line); background: white; color: var(--ink); }
.button.ghost { border-color: rgba(255,255,255,.2); background: transparent; color: inherit; }
.button.tiny { padding: 7px 10px; font-size: 11px; }
.full-width { width: 100%; }
.text-button { padding: 0; border: 0; background: none; color: var(--terra); cursor: pointer; font: inherit; font-size: 11px; }

/* App layout */

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 34px;
  padding: 26px 18px;
  background: #292722;
  color: #f8f3eb;
}
.sidebar-brand { display: flex; align-items: center; gap: 11px; color: white; font-weight: 700; }
.sidebar-brand small { color: #bdb5a9; font-weight: 400; }
.side-nav { display: grid; gap: 5px; }
.nav-link {
  padding: 12px 13px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #d5cec3;
  text-align: left;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
}
.nav-link:hover, .nav-link.active { background: rgba(255,255,255,.1); color: white; }
.sidebar > .button { margin-top: auto; }

.main-content { min-width: 0; padding: 34px clamp(20px, 4vw, 56px) 60px; }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 30px;
}
.topbar h1 { font-size: 34px; }
.user-chip {
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: var(--white);
  color: var(--muted);
  font-size: 11px;
}
.view { display: none; }
.view.active { display: block; }
.section-heading, .panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}
.panel {
  margin-bottom: 20px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: 0 5px 20px rgba(45,35,25,.025);
}
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 12px; }
th { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
th, td { padding: 13px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
td small { margin-top: 3px; max-width: 240px; overflow-wrap: anywhere; }
tr:last-child td { border-bottom: 0; }
td select { min-width: 110px; padding: 7px; }
td .button { margin-top: 4px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.stat-card { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
.stat-card span { display: block; color: var(--muted); font-size: 11px; }
.stat-card strong { display: block; margin-top: 10px; font-family: "Playfair Display", Georgia, serif; font-size: 34px; }

.status {
  display: inline-block;
  padding: 5px 9px;
  border-radius: 20px;
  background: #efede8;
  color: #615a50;
  font-size: 10px;
  font-weight: 700;
  text-transform: capitalize;
}
.status.active, .status.paid, .status.completed { background: var(--soft-sage); color: #4d6845; }
.status.pending, .status.awaiting_payment, .status.submitted { background: var(--soft-terra); color: #96583e; }

.pricing-card { margin: 16px 0; padding: 18px; border: 1px solid var(--line); border-radius: 13px; }
.pricing-title { display: flex; justify-content: space-between; margin-bottom: 15px; }
.pricing-title small { margin-top: 4px; }

.catalog-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; }
.product-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.product-card { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
.product-image-placeholder {
  display: grid;
  place-items: center;
  min-height: 115px;
  background: linear-gradient(135deg, #e9dfd1, #f2e9dd);
  color: #a28d78;
  font-family: "Playfair Display", Georgia, serif;
  letter-spacing: .2em;
}
.product-card-body { padding: 18px; }
.product-card h3 { margin: 5px 0; }
.product-price { margin-top: 15px; font-size: 20px; font-weight: 700; }
.product-price small { display: inline; font-size: 11px; font-weight: 400; }
.minimum-note { color: var(--muted); font-size: 11px; }
.add-row { display: flex; gap: 8px; margin-top: 13px; }
.add-row input { max-width: 90px; }
.cart-panel { position: sticky; top: 20px; }
.cart-panel h2 { margin-bottom: 18px; }
.cart-panel > label { margin-top: 18px; }
.cart-panel > small { margin-top: 12px; line-height: 1.5; }
.cart-total { color: var(--terra); font-size: 24px; font-weight: 700; }
.cart-line { display: flex; justify-content: space-between; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cart-line-actions { text-align: right; }
.billing-summary { max-width: 600px; }
.billing-summary h2 { margin: 8px 0 22px; }
.detail-row { display: flex; justify-content: space-between; gap: 20px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.detail-row span { color: var(--muted); }
.detail-row p { max-width: 60%; text-align: right; }
.notice { margin-top: 20px; padding: 13px; border-radius: 10px; background: var(--soft-terra); color: #754a39; font-size: 12px; }

@media (max-width: 1000px) {
  .catalog-layout { grid-template-columns: 1fr; }
  .cart-panel { position: static; }
}
@media (max-width: 760px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; gap: 16px; padding: 16px; }
  .side-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sidebar > .button { margin-top: 0; }
  .main-content { padding: 24px 16px 40px; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .product-grid { grid-template-columns: 1fr; }
  .auth-shell { grid-template-columns: 1fr; gap: 15px; max-width: 480px; }
  .auth-brand { padding: 12px 4px; }
  .auth-brand h1 { font-size: 42px; }
  .auth-card, .auth-card.wide { padding: 24px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
  .section-heading { align-items: flex-start; flex-direction: column; }
}
