:root {
  /* палитра закатного неба; основной цвет — тёмный серо-голубой */
  --plum: #5e5d78;
  --pink: #8e7189;
  --blush: #f5c3a6;
  --lavender: #c9aec8;
  --steel: #8ea4c6;
  --bg: #e9e8f0;
  --panel: rgba(255, 255, 255, .72);
  --card: rgba(255, 255, 255, .5);
  --line: rgba(94, 93, 120, .16);
  --ink: #34334a;
  --muted: #6c6a82;
  --accent: #5e5d78;
  --accent-soft: rgba(255, 255, 255, .5);
  --velvet: #5e5d78;
  --side-green: linear-gradient(175deg, rgba(110, 108, 140, .92) 0%, rgba(94, 93, 120, .92) 50%, rgba(79, 79, 104, .94) 100%);
  --side-ink: #f7f4fa;
  --side-muted: rgba(247, 244, 250, .72);
  --side-line: rgba(247, 244, 250, .2);
  --glass: transparent;
  --glass-line: rgba(94, 93, 120, .45);
  --chip: rgba(201, 174, 200, .35);
  --ok: #e3eddc; --ok-ink: #3f5e2c;
  --warn: #f6ead0; --warn-ink: #7a5414;
  --bad: #f3dddb; --bad-ink: #8a2f2a;
  --radius: 16px;
  --serif: Georgia, "Times New Roman", serif;
  --sans: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--ink); font: 15px/1.5 var(--sans); min-height: 100vh;
  background: var(--bg);
}
a { color: var(--accent); }
h1, h2 { font-family: var(--serif); font-weight: 700; line-height: 1.2; }
h1 { font-size: 28px; margin: 4px 0 8px; }
h2 { font-size: 21px; margin: 0 0 14px; }
h3 { font-size: 15px; margin: 0 0 6px; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.pre { white-space: pre-wrap; }

/* каркас */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 240px; background: var(--side-green); color: var(--side-ink); padding: 26px 18px; display: flex; flex-direction: column; overflow-y: auto; z-index: 20;
}
main { margin-left: 240px; padding: 28px 32px 60px; max-width: 1240px; }
.topbar { display: none; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font: 700 22px var(--sans); }
.mark { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; background: linear-gradient(145deg, var(--pink), var(--plum)); color: #fff; font-size: 18px; }
.sidebar .logo { color: var(--side-ink); }
.sidebar .mark, .topbar .mark { background: rgba(255,255,255,.22); color: var(--side-ink); border: 1px solid var(--side-line); }
.logo-sub { text-transform: uppercase; letter-spacing: .18em; font-size: 10px; color: var(--side-muted); margin: 10px 0 26px 46px; }
#nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-item { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; color: var(--side-ink); text-decoration: none; }
.nav-item:hover { background: rgba(244, 239, 232, .12); }
.nav-item.active { background: rgba(255,255,255,.2); color: var(--side-ink); box-shadow: inset 0 0 0 1px var(--side-line); font-weight: 600; }
.ico { width: 18px; text-align: center; opacity: .85; }
.nav-group { border-top: 1px solid var(--side-line); margin-top: 10px; padding-top: 10px; }
.nav-group summary { cursor: pointer; font-size: 13px; color: var(--side-muted); padding: 6px 4px; }
.sidebar .nav-sub { display: block; padding: 7px 12px 7px 22px; color: var(--side-ink); text-decoration: none; border-radius: 10px; font-size: 14px; }
.sidebar .nav-sub:hover { background: rgba(244, 239, 232, .12); }
.sidebar .nav-sub.active { background: rgba(255,255,255,.2); color: var(--side-ink); }
.nav-note { font-size: 12px; color: var(--side-muted); padding: 0 6px; }
.sidebar a:focus-visible { outline-color: var(--side-ink); }
.sidebar-foot { margin-top: 20px; font-size: 13px; }
.sidebar-foot .muted { color: var(--side-muted); }
.sidebar-foot .small { font-size: 11px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; background: var(--muted); }
.dot.ok { background: #a8d48a; } .dot.warn { background: #f0c060; }

/* блоки */
.page-head { margin-bottom: 18px; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: 12px; color: var(--muted); margin: 0; }
.eyebrow a { color: var(--muted); }
.lead { font-size: 16px; max-width: 760px; }
.crumbs { margin-bottom: 10px; font-size: 14px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 18px; }
.panel.two { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.row-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.row-head h2 { margin-bottom: 12px; }
.notice { background: var(--warn); color: var(--warn-ink); padding: 12px 16px; border-radius: 12px; }
.demo-bar { background: var(--warn); color: var(--warn-ink); padding: 10px 16px; border-radius: 12px; font-size: 14px; }
.loop { border-left: 4px solid var(--accent); background: var(--accent-soft); padding: 14px 18px; border-radius: 0 12px 12px 0; margin: 18px 0 10px; }
.sub { margin: 26px 0 12px; }
.loading { padding: 40px; }

/* кнопки */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px;
  padding: 8px 16px; border-radius: 12px; border: 1px solid var(--glass-line); background: var(--glass);
  color: var(--ink); font: inherit; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: rgba(255, 255, 255, .18); border-color: var(--plum); }
.btn.primary { background: transparent; color: var(--plum); border-color: var(--pink); font-weight: 600; }
.btn.primary:hover { background: rgba(255, 255, 255, .2); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--bad-ink); border-color: rgba(138, 47, 42, .3); }
.btn:disabled { opacity: .55; cursor: progress; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }

/* шаги */
.steps-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.step-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; }
.step-card h3 { font-size: 17px; margin: 10px 0 4px; }
.step-card .role { font-weight: 600; font-size: 13px; }
.step-card p { font-size: 14px; color: #5a4c53; }
.step-card .btn { margin-top: auto; align-self: flex-start; }
.step-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.num { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 13px; }
.now-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.now-grid h3 { color: var(--muted); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; }
.mini { margin: 0; padding-left: 18px; }
.mini li { margin-bottom: 4px; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.pager.month { justify-content: flex-start; margin-bottom: 12px; }
.pager.month b { font-family: var(--serif); font-size: 18px; min-width: 150px; text-align: center; text-transform: capitalize; }
.back-loop { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* карточки */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; min-width: 0; }
.card-title { display: block; font-weight: 600; text-decoration: none; color: var(--ink); margin-bottom: 6px; overflow-wrap: anywhere; }
.card-title:hover { color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.chip { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--chip); font-size: 12px; white-space: nowrap; }
.chip.ok { background: var(--ok); color: var(--ok-ink); }
.chip.warn { background: var(--warn); color: var(--warn-ink); }
.chip.bad { background: var(--bad); color: var(--bad-ink); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.stat b { display: block; font-size: 20px; font-family: var(--serif); overflow-wrap: anywhere; }
.stat span { font-size: 13px; color: var(--muted); }
.stats.big .stat { background: var(--panel); }

/* контент-план */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.plan-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; min-width: 0; }
.plan-card h3 { font-family: var(--serif); font-size: 19px; margin: 6px 0 8px; }
.plan-card h3 a { color: var(--ink); text-decoration: none; }
.status-rows { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; align-items: center; font-size: 13px; color: var(--muted); margin: 10px 0; }
.status-rows .chip { justify-self: start; }
details summary { cursor: pointer; color: var(--accent); font-size: 14px; margin: 6px 0; }

/* формы */
.field { margin-bottom: 14px; display: flex; flex-direction: column; gap: 5px; }
.field label { font-weight: 600; font-size: 14px; }
.field small { color: var(--muted); font-size: 12px; }
.req { color: var(--accent); }
input:not([type=checkbox]), select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: rgba(255, 255, 255, .7); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; min-height: 42px;
}
textarea { resize: vertical; min-height: 84px; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); flex: none; }
fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin: 0 0 14px; }
legend { font-weight: 700; padding: 0 6px; }
fieldset.evidence { background: var(--card); }
.form-msg { min-height: 0; font-size: 14px; }
.form-msg.bad { background: var(--bad); color: var(--bad-ink); padding: 10px 14px; border-radius: 10px; margin-top: 8px; }
.ready-note { padding: 10px 14px; border-radius: 10px; margin: 8px 0 0; font-size: 14px; }
.ready-note.bad { background: var(--bad); color: var(--bad-ink); }
.ready-note.ok { background: var(--ok); color: var(--ok-ink); padding: 10px 14px; border-radius: 10px; margin-top: 8px; }
.group-title { font-family: var(--serif); font-size: 18px; margin: 18px 0 8px; }
.search { display: flex; gap: 8px; margin-bottom: 14px; max-width: 520px; }
.login { max-width: 420px; margin: 8vh auto; }
.conflict { border-color: var(--warn-ink); }

/* таблицы */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); opacity: 0;
  background: var(--velvet); color: var(--bg); padding: 12px 18px; border-radius: 12px; transition: .2s; pointer-events: none;
  max-width: calc(100% - 32px); z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%); }
.toast.bad { background: var(--bad-ink); }

body.locked .sidebar, body.locked .topbar { display: none; }
body.locked main { margin-left: 0; }

/* планшет и телефон */
@media (max-width: 1100px) {
  .steps-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .now-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .topbar {
    display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 30;
    background: linear-gradient(90deg, #6e6c8c, #5e5d78); padding: 10px 16px;
  }
  .topbar .logo { font-size: 19px; color: var(--side-ink); }
  .topbar #menu-btn { color: var(--side-ink); border-color: var(--side-line); }
  .topbar .mark { width: 30px; height: 30px; font-size: 15px; }
  .sidebar { transform: translateX(-100%); transition: transform .2s; width: 270px; top: 57px; box-shadow: 0 10px 30px rgba(0,0,0,.12); }
  .sidebar > .logo, .logo-sub { display: none; }
  body.menu-open .sidebar { transform: none; }
  main { margin-left: 0; padding: 18px 16px 60px; }
  h1 { font-size: 24px; }
  .panel { padding: 16px; }
  .panel.two, .now-grid, .steps-grid { grid-template-columns: 1fr; }
  .cards, .plan-grid { grid-template-columns: 1fr; }
  .pager .btn { flex: 1 1 auto; white-space: normal; }
}


