:root {
  --bg: #f8f1e7;
  --panel: #fffaf1;
  --green: #59613a;
  --green-dark: #2f3523;
  --orange: #e79418;
  --terracotta: #b76542;
  --ink: #211d17;
  --muted: #746c60;
  --line: rgba(47, 53, 35, 0.16);
  --shadow: 0 18px 44px rgba(47, 53, 35, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin: 0;
}

a {
  color: var(--green);
  text-underline-offset: 0.18em;
}

.topbar {
  align-items: center;
  background: var(--green-dark);
  color: #fffaf1;
  display: flex;
  justify-content: space-between;
  min-height: 68px;
  padding: 0 32px;
}

.brand {
  color: #fffaf1;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.nav {
  display: flex;
  gap: 18px;
}

.nav a {
  color: rgba(255, 250, 241, 0.82);
  font-weight: 700;
  text-decoration: none;
}

.nav a.active,
.nav a:hover {
  color: #fffaf1;
}

.shell {
  margin: 0 auto;
  max-width: 1180px;
  padding: 36px 24px 72px;
}

.auth-shell {
  display: grid;
  min-height: calc(100vh - 68px);
  padding: 24px;
  place-items: center;
}

.panel,
.table-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.panel {
  padding: 28px;
}

.setup-panel,
.login-panel {
  max-width: 520px;
  width: 100%;
}

.page-head {
  align-items: end;
  display: flex;
  gap: 20px;
  justify-content: space-between;
  margin-bottom: 24px;
}

.section-head {
  align-items: start;
  display: flex;
  gap: 20px;
  justify-content: space-between;
}

h1,
h2,
h3 {
  line-height: 1.08;
  margin: 0 0 12px;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.6rem);
}

h2 {
  font-size: 1.35rem;
}

p {
  color: var(--muted);
  line-height: 1.6;
}

.grid {
  display: grid;
  gap: 20px;
}

.grid-2 {
  grid-template-columns: minmax(0, 1.6fr) minmax(300px, 0.9fr);
}

.filters,
.status-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.status-tabs {
  margin-bottom: 18px;
}

.tab,
.button,
button {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  font-weight: 800;
  gap: 8px;
  min-height: 42px;
  padding: 10px 16px;
  text-decoration: none;
}

.button,
button {
  background: var(--green);
  color: #fff;
}

.button.secondary {
  background: transparent;
  color: var(--green-dark);
}

.tab {
  background: rgba(255, 250, 241, 0.7);
  color: var(--green-dark);
}

.tab.active {
  background: var(--green-dark);
  color: #fff;
}

.table-panel {
  overflow: auto;
}

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

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

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

tr:last-child td {
  border-bottom: 0;
}

.badge {
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.76rem;
  font-weight: 900;
  padding: 6px 10px;
}

.status-new {
  background: #fff3cd;
  color: #7a4b00;
}

.status-progress {
  background: #dfe7ff;
  color: #253c7a;
}

.status-approved {
  background: #e5f3dd;
  color: #315d22;
}

.status-sent {
  background: #f5e2d6;
  color: #854725;
}

.status-done {
  background: #dfe8dd;
  color: #344c2b;
}

.status-muted {
  background: #eee8dc;
  color: #5b554c;
}

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

.meta-list {
  display: grid;
  gap: 12px;
  margin: 0;
}

.meta-list div {
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.meta-list dt {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.meta-list dd {
  margin: 4px 0 0;
}

.form-row {
  margin-bottom: 16px;
}

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

.bakeit-panel {
  margin-top: 20px;
}

.bakeit-panel h3 {
  border-top: 1px solid var(--line);
  font-size: 1rem;
  margin: 22px 0 14px;
  padding-top: 18px;
}

.export-info {
  background: rgba(255, 250, 241, 0.8);
  border: 1px solid var(--line);
  border-radius: 14px;
  font-size: 0.9rem;
  margin: 0;
  padding: 12px 14px;
}

.error-list {
  background: #fde4dc;
  border: 1px solid rgba(138, 45, 24, 0.22);
  border-radius: 14px;
  color: #8a2d18;
  margin: 16px 0;
  padding: 14px 16px;
}

.error-list ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

label {
  display: block;
  font-weight: 800;
  margin-bottom: 7px;
}

input,
select,
textarea {
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  font: inherit;
  min-height: 44px;
  padding: 10px 12px;
  width: 100%;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

.inline-form {
  align-items: end;
  display: flex;
  gap: 12px;
}

.form-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

.flash {
  border-bottom: 1px solid var(--line);
  font-weight: 800;
  padding: 14px 24px;
}

.flash-success {
  background: #e5f3dd;
  color: #315d22;
}

.flash-error {
  background: #fde4dc;
  color: #8a2d18;
}

.timeline {
  display: grid;
  gap: 12px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.timeline li {
  background: rgba(255, 250, 241, 0.72);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
}

.empty {
  color: var(--muted);
  padding: 28px;
  text-align: center;
}

@media (max-width: 820px) {
  .topbar,
  .page-head,
  .section-head,
  .inline-form {
    align-items: stretch;
    flex-direction: column;
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }
}
