/* Общие стили макетов «Тверская грядка» */
:root {
  --red: #c8102e;
  --red-dark: #8f0b20;
  --red-soft: #fde8eb;
  --white: #ffffff;
  --ink: #1b1b1f;
  --muted: #6b6b75;
  --line: #e6e3e3;
  --bg: #f6f3f1;
  --yellow: #ffd400;
  --yellow-soft: #fff7c2;
  --green: #1f8a4c;
  --green-soft: #e6f6ec;
  --blue: #1f5fa8;
}
* { box-sizing: border-box; }
body {
  margin: 0; font-family: Inter, system-ui, sans-serif; color: var(--ink);
  background:
    radial-gradient(circle at 12% 18%, rgba(200,16,46,.05) 0 120px, transparent 121px),
    radial-gradient(circle at 88% 70%, rgba(200,16,46,.05) 0 160px, transparent 161px),
    var(--bg);
}
h1, h2, h3, .brand { font-family: "Russo One", Inter, sans-serif; font-weight: 400; }
a { color: var(--red); }

header { background: var(--red); color: var(--white); position: relative; overflow: hidden; }
header::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(115deg, transparent 0 62%, rgba(255,255,255,.95) 62% 66%, transparent 66% 69%, rgba(255,255,255,.35) 69% 70.5%, transparent 70.5%);
}
.head-inner { position: relative; max-width: 1100px; margin: 0 auto; padding: 18px 16px 0; }
.brand-row { display: flex; align-items: center; gap: 14px; }
.logo { width: 54px; height: 54px; border-radius: 14px; background: var(--white); color: var(--red);
  display: grid; place-items: center; font-family: "Russo One"; font-size: 22px; flex: none; box-shadow: 0 3px 0 var(--red-dark); }
.brand { font-size: 26px; letter-spacing: .5px; line-height: 1; }
.tagline { font-size: 13px; opacity: .85; margin-top: 4px; }
.sports { margin-left: auto; font-size: 22px; letter-spacing: 6px; opacity: .95; }
nav { display: flex; gap: 4px; margin-top: 16px; overflow-x: auto; }
nav a { color: var(--white); text-decoration: none; padding: 10px 16px; border-radius: 10px 10px 0 0; font-weight: 600; font-size: 15px; white-space: nowrap; opacity: .9; }
nav a:hover { background: rgba(255,255,255,.15); }
nav a.active { background: var(--bg); color: var(--red); opacity: 1; }

main { max-width: 1100px; margin: 0 auto; padding: 24px 16px 60px; }
.page-title { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin-bottom: 18px; }
.page-title h1 { margin: 0; font-size: 32px; }
.page-title .sub { color: var(--muted); font-size: 14px; }
.page-title .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

.btn { font: inherit; font-weight: 600; font-size: 14px; border: 0; cursor: pointer; padding: 10px 16px; border-radius: 10px;
  background: var(--red); color: var(--white); box-shadow: 0 3px 0 var(--red-dark); text-decoration: none; display: inline-block; }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--red-dark); }
.btn.ghost { background: var(--white); color: var(--red); box-shadow: 0 0 0 2px var(--red) inset; }
.btn.small { padding: 7px 12px; font-size: 13px; }

.card { background: var(--white); border-radius: 18px; padding: 18px; box-shadow: 0 1px 0 var(--line), 0 8px 24px rgba(0,0,0,.05); }
.card h2 { margin: 0 0 4px; font-size: 20px; }
.hint { color: var(--muted); font-size: 13px; margin: 0 0 14px; }
.note { font-size: 12px; color: var(--muted); }
.pos { color: var(--green); }
.neg { color: var(--red); }

.av { display: inline-grid; place-items: center; border-radius: 50%; color: #fff; font-family: "Russo One"; flex: none;
  border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); vertical-align: middle; }
.who { display: flex; align-items: center; gap: 10px; }
.avs { display: flex; }
.avs .av { margin-left: -8px; }
.avs .av:first-child { margin-left: 0; }
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 20px; background: #f1eeec; color: var(--ink); white-space: nowrap; }
.badge.red { background: var(--red-soft); color: var(--red-dark); }
.badge.yellow { background: var(--yellow-soft); color: #6b5800; }
.badge.green { background: var(--green-soft); color: #145c33; }
.badge.blue { background: #e5eefa; color: var(--blue); }
.photo-ph { background: linear-gradient(135deg, #6aa6c9, #2f6f8f); color: rgba(255,255,255,.9); display: grid; place-items: center; font-size: 34px; }
.demo-note { margin-top: 28px; text-align: center; }

/* ---------- пользователь в шапке ---------- */
.user-box { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 13px; position: relative; }
.user-box .who-am-i { opacity: .9; text-align: right; line-height: 1.2; }
.user-box .who-am-i b { display: block; font-size: 14px; }
.user-box a, .user-box button { color: #fff; background: rgba(255,255,255,.15); border: 0; font: inherit; font-weight: 600; padding: 7px 12px; border-radius: 10px; cursor: pointer; text-decoration: none; }
.user-box a:hover, .user-box button:hover { background: rgba(255,255,255,.28); }
@media (max-width: 1000px) {
  .sports { display: none; }
  .brand-row { flex-wrap: wrap; }
  .user-box { width: 100%; justify-content: flex-end; margin-top: -4px; }
}
@media (max-width: 700px) {
  .user-box .who-am-i { display: none; }
  .brand-row { flex-wrap: wrap; gap: 10px; }
  .brand { font-size: 20px; } .logo { width: 44px; height: 44px; font-size: 18px; } .tagline { font-size: 12px; }
  .user-box { width: 100%; justify-content: flex-end; margin: -4px 0 0; }
  .user-box a, .user-box button { padding: 5px 10px; font-size: 12px; }
  nav a { padding: 9px 12px; font-size: 14px; }
  header::before { background: linear-gradient(115deg, transparent 0 88%, rgba(255,255,255,.95) 88% 91%, transparent 91% 94%, rgba(255,255,255,.35) 94% 95.5%, transparent 95.5%); }
}

/* ---------- формы и окна ---------- */
dialog { border: 0; border-radius: 18px; padding: 0; width: min(620px, calc(100vw - 24px)); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(30,10,14,.45); }
.dlg-head { background: var(--red); color: var(--white); padding: 16px 18px; display: flex; align-items: center; }
.dlg-head h3 { margin: 0; font-size: 20px; }
.dlg-head .x { margin-left: auto; background: none; border: 0; color: #fff; font-size: 26px; cursor: pointer; line-height: 1; }
.dlg-body { padding: 16px 18px; max-height: 68vh; overflow: auto; }
.dlg-foot { padding: 14px 18px; border-top: 1px solid var(--line); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.dlg-foot .grow { flex: 1; }
.field { display: grid; gap: 4px; margin-bottom: 12px; font-size: 13px; color: var(--muted); font-weight: 600; }
.field input, .field select, .field textarea, .inp {
  font: inherit; font-size: 15px; font-weight: 400; color: var(--ink); padding: 9px 12px; border: 2px solid var(--line); border-radius: 10px; background: #fff; width: 100%; }
.field textarea { min-height: 110px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .inp:focus { outline: none; border-color: var(--red); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
@media (max-width: 560px) { .row2, .row3 { grid-template-columns: 1fr; } }
.checks { display: flex; flex-wrap: wrap; gap: 6px; }
.checks label { display: inline-flex; align-items: center; gap: 5px; font-size: 14px; font-weight: 500; color: var(--ink); background: #f6f3f1; padding: 6px 10px; border-radius: 20px; cursor: pointer; }
.checks input { accent-color: var(--red); }
.err { color: var(--red); font-weight: 700; font-size: 14px; }
.btn.danger { background: var(--white); color: var(--red-dark); box-shadow: 0 0 0 2px var(--red-soft) inset; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
body:not(.is-admin) .admin-only { display: none !important; }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; font-size: 15px; }
.empty b { display: block; font-size: 40px; margin-bottom: 6px; }

/* ---------- глазик у пароля ---------- */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 46px !important; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; font-size: 18px; cursor: pointer; padding: 4px 6px; border-radius: 8px; line-height: 1; }
.pw-eye:hover { background: #f1eeec; }

/* ---------- всплывающее сообщение ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px;
  font-weight: 600; z-index: 9999; box-shadow: 0 10px 30px rgba(0,0,0,.3); max-width: calc(100vw - 32px); }
.toast.bad { background: var(--red); }
