
:root {
  --bg: #f4f4f1;
  --surface: #ffffff;
  --text: #1c1c1a;
  --muted: #65655f;
  --line: #d9d9d2;
  --accent: #1f5f3f;
  --accent-text: #ffffff;
  --danger: #a1352b;
  --warn: #8a5a00;
  --soft: #eef3ef;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  font-size: 16px;
}
a { color: var(--accent); }
header.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.top-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 8px 16px;
  min-height: 56px;
  flex-wrap: wrap;
}
.brand { font-weight: 700; text-decoration: none; color: var(--text); padding: 12px 0; }
nav.main { display: flex; gap: 4px; overflow-x: auto; flex: 1 1 auto; }
nav.main a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  color: var(--text);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
nav.main a.active { border-bottom-color: var(--accent); font-weight: 600; }
.logout { margin-left: auto; }
.logout button { min-height: 44px; }
main { max-width: 1100px; margin: 0 auto; padding: 16px; }
h1 { font-size: 24px; margin: 8px 0 16px; }
h2 { font-size: 18px; margin: 24px 0 8px; }
h3 { font-size: 16px; margin: 16px 0 8px; }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 16px;
  margin-bottom: 16px;
}
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 12px 16px; }
.stat .value { font-size: 24px; font-weight: 700; }
.stat .label { color: var(--muted); font-size: 14px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { border-color: var(--accent); }
.btn-primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.btn-danger { color: var(--danger); border-color: var(--danger); }
.btn-small { min-height: 40px; padding: 0 12px; font-size: 14px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.muted { color: var(--muted); }
.flash { background: var(--soft); border: 1px solid #bcd5c6; padding: 10px 12px; border-radius: 6px; margin-bottom: 16px; }
.error { background: #fbeceb; border: 1px solid #e3b8b4; color: var(--danger); padding: 10px 12px; border-radius: 6px; margin-bottom: 16px; }
.offer { display: grid; grid-template-columns: 72px 1fr; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.offer:first-of-type { border-top: none; }
.offer-thumb { display: block; width: 72px; height: 72px; border-radius: 4px; background: var(--bg); overflow: hidden; }
.offer-thumb img { width: 72px; height: 72px; object-fit: cover; display: block; }
.offer-title { font-weight: 600; margin-bottom: 4px; }
.offer-title a { color: var(--text); text-decoration: none; }
.offer-title a:hover { text-decoration: underline; }
.meta { color: var(--muted); font-size: 14px; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.price { font-weight: 700; font-size: 18px; color: var(--text); }
.badge {
  display: inline-block;
  font-size: 12px;
  line-height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
}
.badge-strong { border-color: var(--accent); color: var(--accent); }
.badge-weak { border-color: var(--warn); color: var(--warn); }
.badge-over { border-color: var(--danger); color: var(--danger); }
.badge-deal { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
.badge-discount { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.offer-deal .offer-title a { color: var(--accent); }
.reasons { font-size: 13px; color: var(--muted); margin-top: 4px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.actions form { display: flex; gap: 8px; flex-wrap: wrap; }
form .field { margin-bottom: 14px; }
form label { display: block; font-weight: 600; margin-bottom: 4px; }
form .hint { color: var(--muted); font-size: 13px; margin-top: 4px; }
input[type="text"], input[type="password"], textarea, select {
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  background: var(--surface);
  color: var(--text);
}
textarea { min-height: 96px; resize: vertical; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 400; }
.check input { width: 20px; height: 20px; }
.radio-group { display: flex; flex-direction: column; gap: 4px; }
.radio-group label { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 400; }
.radio-group input { width: 20px; height: 20px; }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; align-items: end; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-top: 1px solid var(--line); vertical-align: top; }
th { border-top: none; color: var(--muted); font-weight: 600; font-size: 13px; }
.login { max-width: 400px; margin: 48px auto; }
.empty { color: var(--muted); padding: 16px 0; }
@media (max-width: 600px) {
  nav.main { order: 3; flex: 1 1 100%; margin: 0 -16px; padding: 0 12px; }
  main { padding: 12px; }
  .btn-block { width: 100%; }
  .actions .btn { flex: 1 1 auto; }
  .offer { grid-template-columns: 56px 1fr; }
  .offer-thumb, .offer-thumb img { width: 56px; height: 56px; }
}
