:root {
  --bg: #f4efe7;
  --bg-accent: #e3d6c1;
  --panel: rgba(255, 250, 243, 0.9);
  --panel-strong: #fffaf2;
  --ink: #1f1a17;
  --muted: #69584b;
  --line: rgba(56, 38, 24, 0.12);
  --primary: #204c43;
  --accent: #bb5d34;
  --accent-soft: #f5d8ca;
  --success: #3b7a57;
  --warning: #8c6a1f;
  --shadow: 0 24px 60px rgba(49, 32, 19, 0.12);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --font-ui: "Segoe UI Variable Display", "Aptos", "Trebuchet MS", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-ui);
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.75), transparent 30%),
    radial-gradient(circle at right, rgba(187, 93, 52, 0.18), transparent 28%),
    linear-gradient(160deg, var(--bg) 0%, #efe4d2 48%, #e4d6c6 100%);
}

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

.page-shell {
  width: min(80vw, calc(100vw - 32px));
  margin: 0 auto;
  padding: 32px 0 56px;
  position: relative;
  z-index: 1;
}

.hero {
  display: grid;
  grid-template-columns: 1.5fr 0.9fr;
  gap: 24px;
  align-items: stretch;
  margin-bottom: 24px;
}

.hero-copy,
.hero-card,
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.hero-copy {
  padding: 36px;
}

.hero-card {
  padding: 28px;
  background:
    linear-gradient(180deg, rgba(32, 76, 67, 0.94), rgba(17, 40, 35, 0.94)),
    var(--panel);
  color: #f7efe7;
}

.eyebrow,
.section-kicker,
.hero-card-label {
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.76rem;
  color: var(--muted);
}

.hero-card-label {
  color: rgba(247, 239, 231, 0.72);
}

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

h1 {
  font-size: clamp(2.4rem, 5vw, 4.6rem);
  line-height: 0.96;
  max-width: 12ch;
  margin-bottom: 20px;
}

h2 {
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  margin-bottom: 0;
}

h3 {
  font-size: 1.25rem;
  margin-bottom: 18px;
}

.hero-text {
  max-width: 55ch;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 0;
}

.hero-steps {
  padding-left: 20px;
  margin: 0;
  display: grid;
  gap: 12px;
  font-size: 1rem;
}

.main-grid,
.app-shell,
.stack-grid {
  display: grid;
  gap: 24px;
}

.app-content {
  display: grid;
  gap: 24px;
  min-width: 0;
}

.panel {
  padding: 28px;
}

#authPanel {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  align-items: start;
  width: min(100%, 980px);
  margin: 0 auto;
  gap: 34px;
}

#authPanel > .section-head {
  width: 100%;
  align-self: end;
}

#authPanel > .section-head {
  margin-bottom: 0;
}

#authPanel > .auth-single {
  width: 100%;
  grid-column: 2;
  align-self: start;
}

.auth-info {
  grid-row: 1 / span 2;
  align-self: start;
}

.auth-watermark {
  position: fixed;
  left: 18px;
  bottom: 12px;
  z-index: 0;
  pointer-events: none;
  display: inline-flex;
  align-items: baseline;
  gap: 0;
  font-size: clamp(1.8rem, 2vw, 2.4rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.06em;
  user-select: none;
}

.auth-watermark__word {
  color: var(--primary);
}

.auth-watermark__suffix {
  color: var(--accent);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  margin: 0 0 18px;
  padding: 8px 12px;
  border: 1px solid rgba(32, 76, 67, 0.16);
  border-radius: 999px;
  background: rgba(32, 76, 67, 0.08);
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.78rem;
  font-weight: 800;
}

.auth-info h1 {
  max-width: 11ch;
  margin-bottom: 18px;
}

.auth-lead {
  max-width: 48ch;
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 22px;
}

.auth-benefits {
  display: grid;
  gap: 10px;
}

.auth-benefits span {
  width: fit-content;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 13px;
  background: rgba(255, 255, 255, 0.46);
  color: var(--primary);
  font-weight: 650;
}

.section-head,
.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 20px;
}

.accordion-panel {
  padding: 22px 24px;
}

.accordion-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0;
  background: transparent;
  border: 1px solid transparent;
  appearance: none;
  box-shadow: none;
  color: inherit;
  border-radius: 0;
  text-align: left;
}

.accordion-copy {
  display: grid;
  gap: 6px;
}

.accordion-copy .section-kicker {
  margin-bottom: 0;
}

.accordion-title {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.25;
}

.accordion-icon {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border-right: 2px solid rgba(31, 26, 23, 0.58);
  border-bottom: 2px solid rgba(31, 26, 23, 0.58);
  transform: rotate(45deg) translateY(-2px);
  transition: transform 220ms ease;
}

.accordion-body {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 240ms ease, opacity 180ms ease;
}

.accordion-body-inner {
  min-height: 0;
  overflow: hidden;
  padding-top: 0;
  transition: padding-top 240ms ease;
}

.accordion-panel.is-open .accordion-body {
  grid-template-rows: 1fr;
  opacity: 1;
}

.accordion-panel.is-open .accordion-body-inner {
  padding-top: 18px;
}

.accordion-panel.is-open .accordion-icon {
  transform: rotate(-135deg) translateY(2px);
}

.toolbar-actions,
.menu-switcher {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.toolbar-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

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

.auth-single {
  margin: 0;
}

.two-columns {
  align-items: start;
}

.auth-card {
  width: 100%;
  padding: 20px;
}

.auth-helper {
  margin: 12px 0 0;
  color: var(--muted);
}

.text-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.16em;
}

.text-link:hover {
  transform: none;
  opacity: 0.82;
}

.form-card {
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 22px;
  display: grid;
  gap: 14px;
}

.form-card.compact {
  padding: 0;
  border: 0;
  background: transparent;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.95rem;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid rgba(44, 34, 26, 0.14);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: rgba(32, 76, 67, 0.6);
  box-shadow: 0 0 0 4px rgba(32, 76, 67, 0.12);
  transform: translateY(-1px);
}

.button {
  border: 0;
  border-radius: 999px;
  padding: 14px 18px;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

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

.button-primary {
  background: var(--primary);
  color: #f7efe7;
  box-shadow: 0 12px 24px rgba(32, 76, 67, 0.22);
}

.button-accent {
  background: var(--accent);
  color: #fff5f0;
  box-shadow: 0 12px 24px rgba(187, 93, 52, 0.2);
}

.button-ghost {
  background: rgba(32, 76, 67, 0.1);
  color: var(--primary);
}

.button-ghost.is-active {
  background: var(--primary);
  color: #f7efe7;
}

.button-muted {
  background: rgba(44, 34, 26, 0.08);
  color: var(--ink);
}

.stats-grid,
.dashboard-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.stat-card {
  padding: 22px;
  border-radius: var(--radius-md);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.76), rgba(255, 247, 239, 0.94));
  border: 1px solid var(--line);
}

.stat-card-action {
  width: 100%;
  text-align: left;
  color: inherit;
  box-shadow: none;
}

.stat-card-action:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 26px rgba(49, 32, 19, 0.08);
}

.stat-card-action:not(:disabled) {
  cursor: pointer;
}

.stat-card-action:disabled {
  opacity: 1;
  cursor: default;
}

.stat-card-action.is-active {
  border-color: rgba(32, 76, 67, 0.28);
  box-shadow: 0 16px 30px rgba(32, 76, 67, 0.08);
}

.stat-card strong {
  display: block;
  font-size: 2.1rem;
  margin-top: 12px;
}

.stat-label {
  color: var(--muted);
}

.panel-compact {
  padding: 20px;
}

.button-compact {
  padding: 10px 14px;
}

.section-head-compact {
  margin-bottom: 14px;
}

.section-head-compact h3 {
  margin-bottom: 0;
  font-size: 1.05rem;
}

.offer-list,
.timeline-list {
  display: grid;
  gap: 14px;
}

.offer-card,
.timeline-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel-strong);
  padding: 18px;
}

.offer-card {
  display: grid;
  gap: 14px;
}

.offer-meta,
.timeline-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 0.92rem;
}

.offer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.admin-user-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel-strong);
  padding: 18px;
  display: grid;
  gap: 12px;
}

.admin-reset-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.admin-reset-input {
  width: 100%;
}

.offer-note {
  margin: 0;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: #623221;
}

.empty-state {
  border: 1px dashed rgba(56, 38, 24, 0.18);
  border-radius: var(--radius-md);
  padding: 18px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.38);
}

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

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

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

th {
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

th:nth-child(1),
td:nth-child(1) {
  width: 26%;
}

th:nth-child(2),
td:nth-child(2) {
  width: 13%;
}

th:nth-child(3),
td:nth-child(3),
th:nth-child(4),
td:nth-child(4) {
  width: 19%;
}

th:nth-child(5),
td:nth-child(5) {
  width: 13%;
}

th:nth-child(6),
td:nth-child(6) {
  width: 10%;
}

th:nth-child(5),
th:nth-child(6) {
  text-align: center;
}

.product-cell {
  line-height: 1.35;
}

.product-name {
  display: block;
  max-width: 28ch;
  font-weight: 750;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-note {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.4;
}

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

.status-cell {
  text-align: center;
}

.status-cell .badge {
  justify-content: center;
  width: min(132px, 100%);
  margin: 0 auto;
  white-space: normal;
  text-align: center;
  line-height: 1.25;
}

.action-cell {
  text-align: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}

.badge-success {
  background: rgba(59, 122, 87, 0.15);
  color: var(--success);
}

.badge-warning {
  background: rgba(140, 106, 31, 0.16);
  color: var(--warning);
}

.hidden {
  display: none !important;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(420px, calc(100vw - 36px));
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(31, 26, 23, 0.92);
  color: #fbf6ef;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

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

@media (max-width: 920px) {
  .hero,
  .auth-grid,
  .two-columns,
  .stats-grid,
  .dashboard-summary-grid {
    grid-template-columns: 1fr;
  }

  .page-shell {
    width: min(100vw - 20px, 1180px);
    padding-top: 20px;
  }

  #authPanel {
    grid-template-columns: 1fr;
  }

  #authPanel > .auth-single,
  .auth-info {
    grid-column: auto;
    grid-row: auto;
  }

  .auth-info h1 {
    max-width: 14ch;
  }

  .hero-copy,
  .hero-card,
  .panel {
    padding: 22px;
  }

  .accordion-panel {
    padding: 20px;
  }

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

  .auth-watermark {
    left: 16px;
    bottom: 12px;
    font-size: clamp(1.2rem, 6vw, 1.6rem);
  }
}
