:root {
  --ink: #1c1915;
  --muted: #6d655b;
  --paper: #f4f0e7;
  --card: #fffdf8;
  --line: #e4d9c8;
  --side: #14211c;
  --side-text: #d7e4dc;
  --accent: #0f6b52;
  --accent-ink: #e7f6f0;
  --bad: #8d2e2e;
  --warn: #8a5a12;
  color-scheme: light;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font: 15px/1.45 "Avenir Next", "Segoe UI", sans-serif;
}
a { color: var(--accent); }
h1, h2 { font-family: Palatino, "Palatino Linotype", Georgia, serif; font-weight: 600; }
h1 { font-size: 32px; margin: 0 0 8px; }

.shell { display: flex; min-height: 100vh; }
.side {
  width: 232px;
  flex: none;
  background: var(--side);
  color: var(--side-text);
  padding: 22px 16px;
}
.brand { display: block; color: white; text-decoration: none; font-family: Palatino, Georgia, serif; font-size: 22px; margin-bottom: 6px; }
.side .mode { color: #9eb5aa; font-size: 12px; margin-bottom: 22px; }
.side nav { display: flex; flex-direction: column; gap: 4px; }
.side nav a {
  color: var(--side-text);
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 8px;
}
.side nav a.active, .side nav a:hover { background: #234237; color: white; }
.logout { margin-top: 28px; }
.logout button {
  width: 100%;
  background: transparent;
  color: #d7e4dc;
  border: 1px solid #3d5c50;
  border-radius: 8px;
  padding: 8px;
}

.main { flex: 1; padding: 28px 32px 48px; min-width: 0; }
.flash {
  background: #e7f6ef;
  border: 1px solid #b7dccb;
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 16px;
}
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 16px 0 22px; }
.card, .panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
}
.card b { display: block; font-size: 13px; color: var(--muted); font-weight: 600; }
.card strong { font-size: 22px; font-family: Palatino, Georgia, serif; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
input, select, textarea, button {
  font: inherit;
  color: inherit;
}
input, select, textarea {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
}
textarea { width: 100%; min-height: 120px; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.fields label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.fields .wide { grid-column: 1 / -1; }
fieldset.block {
  border: 1px solid var(--line);
  border-radius: 12px;
  margin: 0 0 14px;
  padding: 8px 14px 14px;
}
fieldset.block legend {
  font-family: Palatino, Georgia, serif;
  padding: 0 6px;
  color: var(--ink);
}
.add-offer { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; margin-top: 12px; }
.add-offer label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
h2 { margin: 18px 0 8px; font-size: 22px; }
.fields input, .fields select, .fields textarea { width: 100%; }
.check { flex-direction: row; align-items: center; color: var(--ink); }
.check input { width: auto; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
button, .button {
  background: var(--accent);
  color: white;
  border: 0;
  border-radius: 8px;
  padding: 8px 12px;
  text-decoration: none;
  display: inline-block;
  cursor: pointer;
}
button.ghost, .button.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.bad { color: var(--bad); }
table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: 14px; overflow: hidden; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.pager { display: flex; gap: 12px; align-items: center; margin-top: 14px; }
.muted { color: var(--muted); }
.score { font-size: 22px; font-family: Palatino, Georgia, serif; margin: 8px 0; }
.meter { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; max-width: 220px; margin: 6px 0; }
.meter span { display: block; height: 100%; background: var(--accent); }
.meter.soft span { background: #b7a48a; }
pre { white-space: pre-wrap; margin: 0; font: 12px/1.4 ui-monospace, monospace; }
.auth {
  max-width: 420px;
  margin: 10vh auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px;
}
.auth input { width: 100%; margin: 8px 0 14px; }
.split { display: grid; grid-template-columns: 1.4fr 0.8fr; gap: 16px; }
@media (max-width: 980px) {
  .shell { display: block; }
  .side { width: auto; }
  .grid, .split, .fields { grid-template-columns: 1fr; }
}
