/* Оформление в стиле сайта конкурса молодых репортёров «Мир пряника» */
:root {
  --brand: #a71916;
  --brand-2: #7f1210;
  --gold: #c08a3e;
  --bg: #fbf6f0;
  --paper: #ffffff;
  --soft: #f5ebe0;
  --line: #e7d8c7;
  --ink: #2a1a14;
  --muted: #7b665a;
  --ok: #2f6b3a;
  --ok-bg: #e6f2e4;
  --bad: #a2261b;
  --bad-bg: #fbe6e2;
  --warn: #b26a00;
  --warn-bg: #fff1d9;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(60, 25, 10, .06), 0 6px 24px rgba(60, 25, 10, .06);
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); }
a { color: var(--brand-2); }
a:hover { color: var(--brand); }
h1, h2, h3 { font-family: var(--serif); color: var(--brand); line-height: 1.2; margin: 0 0 .6em; font-weight: 700; }
h1 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h2 { font-size: 1.25rem; margin-top: 1.4em; }
h3 { font-size: 1.05rem; }
h1 small, h2 small { font-family: var(--font); font-size: .55em; font-weight: 600; color: var(--muted); vertical-align: middle; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
p { margin: 0 0 1em; }

.wrap { max-width: 1400px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-top: 24px; padding-bottom: 48px; min-height: 60vh; }

/* шапка */
.top { background: var(--brand); color: #fff; }
.top__in { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
.brand { display: flex; gap: 14px; align-items: center; color: #fff; text-decoration: none; }
.brand:hover { color: #fff; }
.brand__logo { height: 48px; width: auto; display: block; }
.brand__text { font-size: .8rem; line-height: 1.25; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; color: #f7f1e7; border-left: 1px solid rgba(247, 241, 231, .35); padding-left: 14px; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.nav a, .linkbtn { color: #fff; text-decoration: none; padding: 6px 10px; border-radius: 8px; font-size: .92rem; opacity: .85; }
.nav a:hover, .nav a.on { opacity: 1; background: rgba(255, 255, 255, .14); }
.nav__user { color: #f7f1e7; opacity: .7; font-size: .85rem; padding: 6px 4px 6px 14px; border-left: 1px solid rgba(247, 241, 231, .35); margin-left: 8px; }
.linkbtn { background: none; border: 0; cursor: pointer; font: inherit; font-size: .92rem; }
.inline { display: inline; margin: 0; }

.foot { color: var(--muted); font-size: .82rem; padding-top: 20px; padding-bottom: 28px; border-top: 1px solid var(--line); }

/* блоки */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); margin-bottom: 18px; min-width: 0; }
.card--soft { background: var(--soft); box-shadow: none; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card__title { font-family: var(--serif); color: var(--brand); font-size: 1.05rem; font-weight: 700; margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.pre { white-space: pre-line; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; color: var(--gold); font-weight: 600; margin: 0 0 .4em; }
.overdue { color: var(--bad); font-weight: 600; }

/* кнопки */
.btn { display: inline-block; background: var(--brand); color: #fff; border: 2px solid var(--brand); border-radius: 10px; padding: 9px 18px; font: 600 .95rem var(--font); text-decoration: none; cursor: pointer; transition: background .15s; white-space: nowrap; }
.btn:hover { background: var(--brand-2); border-color: var(--brand-2); color: #fff; }
.btn--ghost { background: transparent; color: var(--brand); }
.btn--ghost:hover { background: var(--soft); color: var(--brand); border-color: var(--brand); }
.btn--quiet { background: transparent; color: var(--muted); border-color: var(--line); }
.btn--quiet:hover { background: var(--soft); color: var(--ink); border-color: var(--line); }
.btn--on { background: var(--soft); color: var(--brand); border-color: var(--brand); }
.btn--small { padding: 4px 10px; font-size: .8rem; border-radius: 8px; border-width: 1px; }
.btnrow { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.linklike { background: none; border: 0; padding: 0; color: var(--muted); font: inherit; font-size: .8rem; text-decoration: underline; cursor: pointer; }
.linklike:hover { color: var(--bad); }

/* формы */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field__label { font-weight: 600; font-size: .88rem; }
.field__hint { color: var(--muted); font-size: .8rem; }
input[type=text], input[type=email], input[type=tel], input[type=url], input[type=search], input[type=password],
input[type=number], input[type=date], input:not([type]), select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: #fff; border: 1px solid #d6c3b0; border-radius: 9px; padding: 8px 11px;
}
input:focus, select:focus, textarea:focus { border-color: var(--gold); outline: none; box-shadow: 0 0 0 3px rgba(192, 138, 62, .2); }
textarea { resize: vertical; }
select { max-width: 100%; text-overflow: ellipsis; }
select.mini { width: auto; padding: 3px 6px; font-size: .8rem; border-radius: 7px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.check { display: flex; gap: 8px; align-items: center; font-size: .9rem; cursor: pointer; }
.check input { width: 17px; height: 17px; flex: none; accent-color: var(--brand); margin: 0; }
details summary { cursor: pointer; font-weight: 600; color: var(--brand-2); padding: 4px 0; }

/* сообщения, значки */
.note { padding: 11px 15px; border-radius: 10px; background: var(--soft); margin: 0 0 16px; }
.note--ok { background: var(--ok-bg); color: var(--ok); }
.note--warn { background: var(--warn-bg); color: var(--warn); }
.note--error { background: var(--bad-bg); color: var(--bad); }
.badge { display: inline-block; font-size: .74rem; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--soft); color: var(--muted); vertical-align: middle; font-family: var(--font); white-space: nowrap; }
.badge--reply { background: var(--ok-bg); color: var(--ok); }
.badge--stage { background: var(--brand); color: #fff; font-size: .85rem; padding: 3px 12px; }
.badge--A { background: #f7dcd6; color: var(--brand-2); }
.badge--B { background: #f6ead2; color: #8a5a12; }
.badge--C { background: #eee7df; color: var(--muted); }
.progress { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--gold); }

/* заголовок страницы, фильтры */
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.page-head h1 { margin: 0; }
.back { display: inline-block; margin-bottom: 8px; font-size: .88rem; color: var(--muted); text-decoration: none; }
.back:hover { color: var(--brand); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filters select, .filters input[type=search] { width: auto; min-width: 170px; }
.filters input[type=search] { flex: 1; min-width: 240px; }

/* таблицы */
.tbl-wrap { overflow-x: auto; margin-bottom: 16px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--paper); }
.tbl { width: 100%; border-collapse: collapse; font-size: .88rem; }
.tbl th, .tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.tbl th { background: var(--soft); color: var(--brand); font-weight: 600; font-size: .82rem; white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr:hover td { background: #fffaf4; }
.tbl tr.has-reply td:first-child { box-shadow: inset 4px 0 0 var(--ok); }
.tbl tr.muted td { color: var(--muted); }
.tbl .nowrap { white-space: nowrap; }

/* плитки сводки */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.tile { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; text-decoration: none; color: var(--ink); display: block; }
.tile:hover { border-color: var(--gold); color: var(--ink); }
.tile b { display: block; font: 700 1.9rem var(--serif); color: var(--brand); }
.tile span { font-size: .88rem; color: var(--muted); }
.tile--ok b { color: var(--ok); }
.tile--bad b { color: var(--bad); }
.countdown { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.countdown h1 { margin: 0; }
.dash { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 18px; align-items: start; }
.dash .card { margin-bottom: 0; }
.list { list-style: none; padding: 0; margin: 0; }
.list li { padding: 7px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.funnel { display: flex; flex-direction: column; gap: 6px; }
.funnel a { display: grid; grid-template-columns: 110px 1fr 40px; gap: 10px; align-items: center; text-decoration: none; color: var(--ink); font-size: .88rem; }
.funnel a:hover .progress span { background: var(--brand); }
.funnel b { text-align: right; font-variant-numeric: tabular-nums; }

/* канбан */
.board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 14px; align-items: flex-start; }
.board > .note { flex: 0 0 100%; }
.column { background: var(--soft); border-radius: var(--radius); padding: 10px; width: 270px; flex-shrink: 0; }
.column.collapsed { width: 150px; }
.column__head { display: flex; justify-content: space-between; align-items: baseline; font-weight: 600; color: var(--brand); margin: 2px 4px 10px; font-size: .92rem; }
.column__head b { color: var(--muted); font-weight: 600; font-size: .85rem; }
.column__more { display: block; font-size: .8rem; color: var(--muted); margin: 4px; }
.kcard { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 10px 11px; margin-bottom: 8px; font-size: .85rem; box-shadow: 0 1px 2px rgba(60, 25, 10, .05); }
.kcard:hover { border-color: var(--gold); }
.kcard.has-reply { box-shadow: inset 4px 0 0 var(--ok); }
.kcard__title { font-weight: 600; display: block; margin-bottom: 4px; text-decoration: none; color: var(--ink); line-height: 1.3; }
.kcard__title:hover { color: var(--brand); }
.kcard__meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: .78rem; color: var(--muted); margin-top: 3px; }
.kcard__actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; align-items: center; }
.kcard__actions select.mini { flex: 1; min-width: 0; }

/* карточка организации */
.stage-bar { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; margin-bottom: 18px; }
.detail { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.facts { display: grid; grid-template-columns: 170px 1fr; gap: 6px 14px; margin: 0; }
.facts dt { color: var(--muted); font-size: .85rem; }
.facts dd { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.obligations { list-style: none; padding: 0; margin: 0 0 14px; }
.obligation { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.obligation:last-child { border-bottom: 0; }
.obligation input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--brand); margin: 0; }
.obligation__text { flex: 1; min-width: 180px; }
.obligation.done .obligation__text { text-decoration: line-through; color: var(--muted); }
.row-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row-form input, .row-form select { width: auto; }
.row-form .grow { flex: 1; min-width: 180px; }
.log { font-size: .82rem; }
.log td { padding: 5px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }

/* вход */
.login { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); max-width: 920px; margin: 3vh auto 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.login__art { background: var(--brand) url("/static/img/login-art.jpg") center / cover no-repeat; min-height: 380px; }
.login__form { padding: 36px 32px; display: flex; flex-direction: column; justify-content: center; }
.login__form h1 { font-size: 1.6rem; }
.login__form .btn { align-self: flex-start; }

@media (max-width: 900px) {
  .detail { grid-template-columns: 1fr; }
  .grid4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  .login { grid-template-columns: 1fr; }
  .login__art { min-height: 180px; }
  .login__form { padding: 24px 20px; }
  .brand__text { display: none; }
}
@media (max-width: 600px) {
  .grid2, .grid3, .grid4 { grid-template-columns: 1fr; }
  .card { padding: 16px; }
  .facts { grid-template-columns: 1fr; gap: 2px; }
  .facts dd { margin-bottom: 8px; }
  .filters select, .filters input[type=search] { min-width: 0; width: 100%; }
  .dash { grid-template-columns: 1fr; }
}

.mt { margin-top: 12px; margin-bottom: 0; }

/* пространства, входящие, задачи, идеи, документы */
.badge--space { background: #eef0f7; color: #3b4a7a; }
.badge--pr { background: #f7dcd6; color: var(--brand-2); }
.badge--from { background: #fff1d9; color: var(--warn); }
.badge--doc-0 { background: var(--soft); color: var(--muted); }
.badge--doc-1 { background: var(--warn-bg); color: var(--warn); }
.badge--doc-2 { background: var(--ok-bg); color: var(--ok); }
.badge--doc-3 { background: #eee; color: #999; }
.strike { text-decoration: line-through; color: var(--muted); }
.tick { width: 18px; height: 18px; accent-color: var(--brand); margin: 0; cursor: pointer; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.quick { padding: 14px 16px; }
.quick textarea, .quick input[name=title] { background: #fffdfa; }
.tabs { margin-right: 8px; }
.mini-input { width: 220px !important; padding: 4px 8px !important; font-size: .82rem !important; border-radius: 7px !important; }
.inbox-item { padding: 14px 18px; margin-bottom: 12px; }
.inbox-item__meta { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; margin-bottom: 6px; }
.inbox-item__text { overflow-wrap: anywhere; margin-bottom: 10px; }
.inbox-item__actions { gap: 6px; }
.ideas { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.idea { margin: 0; display: flex; flex-direction: column; gap: 8px; padding: 16px 18px; }
.idea__title { font-weight: 600; text-decoration: none; color: var(--ink); font-size: 1rem; line-height: 1.3; }
.idea__title:hover { color: var(--brand); }
.idea__meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: auto; }
.idea--2 { box-shadow: inset 4px 0 0 var(--ok), var(--shadow); }
.idea--3 { opacity: .7; }
.week { margin: 0; padding-left: 22px; }
.week li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.week li:last-child { border-bottom: 0; }
.week li.done .week__title { text-decoration: line-through; color: var(--muted); }
.week__title { font-weight: 600; text-decoration: none; color: var(--ink); }
#tg-text { font-family: Consolas, "Courier New", monospace; font-size: .8rem; background: #fff; }
.plan-progress { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; margin-bottom: 12px; }
.plan { list-style: none; padding: 0; margin: 0; }
.plan__row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.plan__row .tick { margin-top: 3px; }
.plan__body { flex: 1; display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; }
.plan__title { font-weight: 600; text-decoration: none; color: var(--ink); }
.plan__row.done .plan__title { text-decoration: line-through; color: var(--muted); }
.plan__fact { flex-basis: 100%; padding: 5px 9px !important; font-size: .85rem !important; background: #fffdfa !important; }
.versions { list-style: none; padding: 0; margin: 0; }
.versions li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.versions li.current a { color: var(--brand); }
.comments { list-style: none; padding: 0; margin: 0 0 14px; }
.comments li { padding: 8px 0; border-bottom: 1px solid var(--line); }
input.copy { font-size: .8rem; background: var(--soft); }
.space-row { display: grid; grid-template-columns: 140px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
@media (max-width: 600px) {
  .space-row { grid-template-columns: 1fr; }
  .mini-input { width: 100% !important; }
}
.form > .btn { align-self: flex-start; }
