:root {
  --bg: #f5f1e8;
  --panel: rgba(255, 252, 245, 0.9);
  --panel-strong: #fffaf0;
  --line: rgba(87, 66, 43, 0.14);
  --ink: #1f1c16;
  --muted: #6d604f;
  --accent: #0f766e;
  --accent-soft: #d2f3eb;
  --danger: #b91c1c;
  --warning: #c47e00;
  --shadow: 0 22px 50px rgba(62, 42, 21, 0.12);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.14), transparent 28%),
    radial-gradient(circle at top right, rgba(216, 152, 34, 0.16), transparent 24%),
    linear-gradient(180deg, #f8f5ef 0%, #efe4d0 100%);
  color: var(--ink);
  min-height: 100vh;
}

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

.shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px;
}

.hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 20px;
  margin-bottom: 22px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.hero-card {
  padding: 26px;
}

.hero h1,
.auth-panel h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.6rem);
  letter-spacing: -0.03em;
}

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

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.metric {
  padding: 18px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.metric strong {
  display: block;
  font-size: 1.8rem;
  margin-top: 6px;
}

.app-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 18px;
}

.sidebar {
  padding: 18px;
  position: sticky;
  top: 24px;
  height: fit-content;
}

.brand {
  font-size: 1.5rem;
  margin: 0 0 8px;
}

.nav {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.nav button,
.ghost-button,
.primary-button,
.danger-button {
  border: 0;
  border-radius: 999px;
  padding: 12px 16px;
  cursor: pointer;
  transition: transform 160ms ease, opacity 160ms ease, background 160ms ease;
}

.nav button:hover,
.ghost-button:hover,
.primary-button:hover,
.danger-button:hover {
  transform: translateY(-1px);
}

.nav button {
  text-align: left;
  background: rgba(255, 255, 255, 0.66);
  color: var(--ink);
}

.nav button.active,
.primary-button {
  background: var(--accent);
  color: white;
}

.ghost-button {
  background: white;
  color: var(--ink);
  border: 1px solid var(--line);
}

.danger-button {
  background: #fee2e2;
  color: var(--danger);
}

.panel {
  padding: 20px;
}

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

.section-head h2 {
  margin: 0;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  font-size: 0.95rem;
  color: var(--muted);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(87, 66, 43, 0.18);
  background: #fffdf8;
}

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

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

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

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

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

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

.pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  background: #ebe6dd;
}

.pill.wholesale {
  background: #d8f0ec;
  color: #0d5b55;
}

.pill.retail {
  background: #fde9cf;
  color: #9a5b00;
}

.pill.warning {
  background: #fff1c5;
  color: #835100;
}

.pill.danger {
  background: #fee2e2;
  color: var(--danger);
}

.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-panel {
  width: min(960px, 100%);
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  overflow: hidden;
}

.auth-copy,
.auth-form {
  padding: 34px;
}

.auth-copy {
  background:
    linear-gradient(150deg, rgba(15, 118, 110, 0.94), rgba(15, 66, 76, 0.95)),
    linear-gradient(180deg, rgba(255,255,255,0.12), transparent);
  color: white;
}

.auth-form {
  background: var(--panel-strong);
}

.banner {
  padding: 14px 16px;
  border-radius: 14px;
  margin-bottom: 12px;
}

.banner.error {
  background: #fee2e2;
  color: var(--danger);
}

.banner.success {
  background: var(--accent-soft);
  color: #0f5b55;
}

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

.row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.hint {
  font-size: 0.92rem;
  color: var(--muted);
}

.empty {
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 960px) {
  .hero,
  .auth-panel,
  .app-grid,
  .split {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }
}
