/* AEO/GEO: рабочее место — визуальный слой взят из «Пространства модератора» (po/prostranstvo-moderatora) */
:root {
  --bg: #f4f5f8;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --line: #e7e9ef;
  --line-strong: #d5d9e2;
  --text: #121826;
  --text-2: #3d4556;
  --muted: #6b7385;
  --primary: #4b4fe0;
  --primary-soft: #eef0ff;
  --ok: #17a34a;
  --ok-soft: #e8f7ee;
  --warn: #c2700a;
  --warn-soft: #fff4e2;
  --bad: #d63a3a;
  --bad-soft: #fdecec;
  --heat-1: #e8eaff;
  --heat-2: #c9cdfd;
  --heat-3: #9aa1f7;
  --heat-4: #5b62e6;
  --weekend: #f6f6fa;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(18, 24, 38, .04), 0 1px 3px rgba(18, 24, 38, .06);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 14px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-feature-settings: "tnum" 1, "cv11" 1;
  color: var(--text);
  background: var(--bg);
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }

/* ── шапка ─────────────────────────────────────────── */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 28px;
  height: 56px; padding: 0 28px;
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; color: var(--text); letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.logo {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px;
  background: linear-gradient(135deg, #5b62e6, #8b5cf6); color: #fff; font-size: 12px; font-weight: 700;
}
.tabs { display: flex; gap: 4px; flex: 1; height: 100%; }
.tabs a {
  display: flex; align-items: center; padding: 0 12px; color: var(--muted); font-weight: 500;
  border-bottom: 2px solid transparent;
}
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.on { color: var(--text); border-bottom-color: var(--primary); }
.who { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.who a { color: var(--muted); }

/* ── каркас страницы ───────────────────────────────── */
main { padding: 24px 28px 48px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { margin: 0; font-size: 24px; line-height: 1.25; letter-spacing: -.02em; font-weight: 650; }
.page-head .sub { margin-top: 4px; color: var(--muted); }
.crumbs { margin-bottom: 6px; font-size: 13px; }
.crumbs a { color: var(--muted); }
.head-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* переключатель месяца */
.month {
  display: inline-flex; align-items: center; height: 36px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow);
}
.month a { display: grid; place-items: center; width: 34px; height: 100%; color: var(--muted); font-size: 16px; }
.month a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.month label { position: relative; padding: 0 10px; font-weight: 600; min-width: 128px; text-align: center; cursor: pointer; }
.month input[type=month] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* плашка свежести данных */
.fresh {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; color: var(--text-2);
  box-shadow: var(--shadow); font-size: 13px;
}
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); flex: none; }
.dot.ok { background: var(--ok); }
.dot.warn { background: #f0a020; }
.dot.stale, .dot.none { background: var(--bad); }

select.as {
  height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
  font: inherit; color: var(--text); box-shadow: var(--shadow);
}

/* ── карточки итогов ───────────────────────────────── */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 24px; }
.kpi {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow);
}
.kpi .v { font-size: 26px; font-weight: 650; letter-spacing: -.02em; line-height: 1.2; }
.kpi .l { color: var(--muted); font-size: 13px; }
.kpi .s { color: var(--muted); font-size: 12px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi.warn { background: var(--warn-soft); border-color: #f6dcb2; }
.kpi.warn .v { color: var(--warn); }

/* ── панели и таблицы ──────────────────────────────── */
.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; margin-bottom: 24px;
}
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 16px 18px 12px; }
.panel-head h2 { margin: 0; font-size: 16px; font-weight: 620; }
.panel-head .hint { color: var(--muted); font-size: 13px; }
.scroll { overflow-x: auto; }

table.t { width: 100%; border-collapse: separate; border-spacing: 0; }
.t th {
  position: sticky; top: 0; z-index: 2;
  padding: 9px 14px; text-align: left; white-space: nowrap;
  font-size: 12px; font-weight: 550; color: var(--muted); text-transform: none;
  background: var(--surface-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.t td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t tbody tr:hover td { background: #fafbff; }
.t tbody tr:last-child td { border-bottom: 0; }
.t tfoot td { padding: 11px 14px; background: var(--surface-2); border-top: 1px solid var(--line); font-weight: 600; }
.t .n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.t th.n { text-align: right; }
.t .zero { color: #b4b9c6; }
.pname { font-weight: 550; color: var(--text); }
.cal .pname { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pname:hover { color: var(--primary); }
.meta { display: flex; align-items: center; gap: 6px; margin-top: 2px; font-size: 12px; color: var(--muted); }
.ext { font-size: 12px; color: var(--muted); }
.ext:hover { color: var(--primary); }

/* бейджи */
.badge {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.soft { background: #eef0f4; color: var(--muted); font-weight: 500; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }

/* полоса прогресса */
.bar { display: flex; height: 8px; min-width: 140px; border-radius: 999px; background: #eef0f4; overflow: hidden; }
.bar i { display: block; height: 100%; }
.bar .pub { background: var(--ok); }
.bar .asg { background: #8f95f2; }
.bar .wait { background: #f0a020; }
.bar-cell { display: grid; gap: 4px; min-width: 170px; }
.bar-cap { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* модератор: аватар + имя */
.person { display: flex; align-items: center; gap: 10px; min-width: 200px; }
.ava {
  display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%;
  background: var(--primary-soft); color: var(--primary); font-size: 11px; font-weight: 700; letter-spacing: .02em;
}
.ava.off { background: #eef0f4; color: var(--muted); }
.person .pi { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.person .nm { font-weight: 550; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person .ini { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
a.person:hover { text-decoration: none; }
a.person:hover .nm { color: var(--primary); }

/* матрица проекта */
.cell { display: inline-flex; gap: 4px; align-items: baseline; justify-content: flex-end; }
.cell b { font-weight: 600; }
.cell span { color: var(--muted); font-size: 12px; }
.t td.h1 { background: #f6f7ff; } .t td.h2 { background: #eceeff; } .t td.h3 { background: #dfe2ff; } .t td.h4 { background: #ccd1ff; }
.t th.mod { text-align: center; }
.t td.kind { min-width: 280px; }
.page-head .sub { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.t th.mod a { display: block; color: var(--text-2); font-weight: 600; }
.t th.mod small { display: block; color: var(--muted); font-weight: 400; max-width: 110px; overflow: hidden; text-overflow: ellipsis; }

/* ── календарь ─────────────────────────────────────── */
.cal-wrap { overflow-x: auto; }
.cal { width: 100%; min-width: 1100px; table-layout: fixed; border-collapse: separate; border-spacing: 0; }
.cal col.c-row { width: 300px; }
.cal col.c-num { width: 96px; }
.cal th, .cal td { border-bottom: 1px solid var(--line); }
.cal thead th {
  position: sticky; top: 0; z-index: 2; background: var(--surface-2); padding: 10px 0 8px;
  font-size: 12px; color: var(--muted); font-weight: 550; border-top: 1px solid var(--line);
}
.cal .proj {
  position: sticky; left: 0; z-index: 3; background: var(--surface);
  padding: 10px 16px; text-align: left; border-right: 1px solid var(--line); overflow: hidden;
}
.cal thead .proj { z-index: 4; background: var(--surface-2); }
.cal .num { padding: 0 14px; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 14px; }
.cal thead .num { font-size: 12px; }
.cal .num.last { border-right: 1px solid var(--line); }
.cal th.d { text-align: center; line-height: 1.2; }
.cal th.d b { display: block; color: var(--text); font-size: 14px; font-weight: 600; margin-bottom: 1px; }
.cal th.d span { font-size: 11px; }
.cal .we { background: var(--weekend); }
.cal thead th.d.we { background: #eeeff5; }
.cal thead th.d.hol { background: #fdeeee; }
.cal thead th.d.hol span { color: var(--bad); font-weight: 600; }
.cal td.d.we:not(.today) { background: var(--weekend); }
.warn-text { color: var(--warn); font-weight: 600; }
.cal th.d.today b { display: grid; place-items: center; width: 24px; height: 24px; margin: 0 auto 1px; border-radius: 50%; background: var(--primary); color: #fff; }
.cal td.d.today { background: #f7f8ff; }
.cal td.d { padding: 6px 3px; text-align: center; border-left: 1px solid #f0f1f5; }
.cal td.d .h {
  display: grid; place-items: center; width: 100%; max-width: 44px; height: 34px; margin: 0 auto; border-radius: 8px;
  font-size: 13px; font-weight: 650; font-variant-numeric: tabular-nums; cursor: help;
}
.h.l1 { background: var(--heat-1); color: #3b40b8; }
.h.l2 { background: var(--heat-2); color: #2e33a8; }
.h.l3 { background: var(--heat-3); color: #fff; }
.h.l4 { background: var(--heat-4); color: #fff; }
.cal tfoot td { background: var(--surface-2); font-weight: 600; font-size: 13px; color: var(--text-2); padding: 10px 0; }
.cal tfoot .proj { background: var(--surface-2); }
.cal tfoot td.tot { text-align: center; }
.cal tbody tr:hover td { background-color: #fafbff; }
.cal tbody tr:hover td.we { background-color: #f1f2fa; }
.cal .pname { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal .person { min-width: 0; }
.cal .person .pi { max-width: 230px; }
.legend i.sw { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.legend i.sw.l1 { background: var(--heat-1); } .legend i.sw.l2 { background: var(--heat-2); }
.legend i.sw.l3 { background: var(--heat-3); } .legend i.sw.l4 { background: var(--heat-4); }
.legend i.sw.we { background: var(--weekend); border: 1px solid var(--line); }

/* ── фильтры нагрузки ──────────────────────────────── */
.filters { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.pick { position: relative; }
.pick summary, .field select {
  display: flex; align-items: center; min-width: 320px; height: 40px; padding: 0 36px 0 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow);
  cursor: pointer; list-style: none; position: relative; font: inherit; color: var(--text);
}
.pick summary::-webkit-details-marker { display: none; }
.pick summary::after { content: "▾"; position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.pick[open] summary { border-color: var(--primary); }
.pick-l { font-size: 12px; font-weight: 550; color: var(--muted); line-height: 1; }
.pick-v { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 380px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field select { padding: 0 12px; font-weight: 600; appearance: auto; }
.pick-pop {
  position: absolute; z-index: 40; top: calc(100% + 6px); left: 0; width: 420px; padding: 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 40px rgba(18, 24, 38, .16);
  display: grid; gap: 10px;
}
.pick-search { height: 36px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 8px; font: inherit; }
.pick-actions { display: flex; gap: 8px; }
.pick-actions button, .pick-foot button {
  height: 30px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); font: inherit; font-size: 13px; cursor: pointer;
}
.pick-foot button.primary { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; padding: 0 16px; }
.pick-list { max-height: 320px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.pick-item { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-bottom: 1px solid #f0f1f5; cursor: pointer; }
.pick-item:hover { background: var(--surface-2); }
.pick-item:last-child { border-bottom: 0; }
.pick-foot { display: flex; align-items: center; justify-content: space-between; font-size: 12px; }
.reset { align-self: flex-end; height: 40px; display: inline-flex; align-items: center; color: var(--muted); font-size: 13px; }
.small-link { margin-left: 10px; font-size: 13px; font-weight: 500; }

/* подсказка по наведению: рисуется скриптом поверх страницы (position: fixed), чтобы её не обрезали
   прокручиваемые таблицы и закреплённые шапки */
[data-tip], [data-b], [data-s] { cursor: help; }
#tip {
  position: fixed; z-index: 1000; display: none; max-width: 340px; padding: 8px 10px; border-radius: 8px;
  background: #1c2233; color: #fff; font-size: 12px; font-weight: 450; line-height: 1.5;
  white-space: pre-line; box-shadow: 0 6px 20px rgba(0, 0, 0, .2); pointer-events: none;
}
/* пустые состояния, подвал */
.empty { padding: 36px 18px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--text-2); font-size: 15px; margin-bottom: 4px; }
footer { padding: 0 28px 28px; color: var(--muted); font-size: 12px; }

/* список в админке */
.list { margin: 0; padding: 0 18px 16px; list-style: none; columns: 2; column-gap: 32px; }
.list li { padding: 6px 0; border-bottom: 1px dashed var(--line); break-inside: avoid; }

/* ── вход ──────────────────────────────────────────── */
body.login { display: grid; place-items: center; min-height: 100vh; background: radial-gradient(1200px 600px at 20% -10%, #e6e8ff 0, transparent 60%), var(--bg); }
.login-card {
  width: 380px; padding: 32px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 10px 40px rgba(18, 24, 38, .08); display: grid; gap: 14px;
}
.login-card .brand { font-size: 17px; }
.login-card h1 { margin: 6px 0 0; font-size: 22px; letter-spacing: -.02em; }
.login-card input {
  height: 42px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 10px; font: inherit;
}
.login-card input:focus { outline: 2px solid #c9cdfd; border-color: var(--primary); }
.login-card button {
  height: 42px; border: 0; border-radius: 10px; background: var(--primary); color: #fff; font: inherit; font-weight: 600; cursor: pointer;
}
.login-card button:hover { background: #3f43c9; }
.error { margin: 0; padding: 8px 10px; border-radius: 8px; background: var(--bad-soft); color: var(--bad); font-size: 13px; }
.note { margin: 0; color: var(--muted); font-size: 12px; }

@media (max-width: 720px) {
  .top { gap: 12px; padding: 0 16px; }
  .who span { display: none; }
  main { padding: 16px; }
  .list { columns: 1; }
}

/* ── встроенная справка ────────────────────────────── */
.howto { margin: -6px 0 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.howto summary { display: flex; align-items: center; gap: 10px; padding: 10px 16px; cursor: pointer; list-style: none; color: var(--text-2); font-weight: 550; }
.howto summary::-webkit-details-marker { display: none; }
.howto summary::after { content: "показать"; margin-left: auto; color: var(--muted); font-weight: 400; font-size: 12px; }
.howto[open] summary::after { content: "скрыть"; }
.howto .i { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-size: 12px; font-weight: 700; font-style: italic; }
.howto-body { padding: 0 18px 14px 46px; color: var(--text-2); line-height: 1.6; }
.howto-body p { margin: 0 0 8px; }
.howto-body ul { margin: 0; padding-left: 18px; }
.howto-body li { margin: 3px 0; }
.doc-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; margin-bottom: 16px; }
.doc-col { display: flex; flex-direction: column; gap: 16px; }
.doc-col .panel { margin: 0; }
@media (max-width: 1350px) { .doc-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) { .doc-cols { grid-template-columns: 1fr; } }
.doc { padding: 6px 26px 22px; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin: 0 4px 0 2px; vertical-align: baseline; }
.doc .dot { vertical-align: middle; margin-right: 2px; }
.doc h2 { font-size: 17px; margin: 16px 0 8px; }
.doc p, .doc li { color: var(--text-2); line-height: 1.65; }
.doc table { margin: 8px 0 4px; }
.doc .t td, .doc .t th { vertical-align: top; }
.term { font-weight: 600; color: var(--text); white-space: nowrap; }

/* ── статусы работ: один цвет на статус везде (календарь, полосы, легенды) ── */
:root { --st-plan: #3b82f6; --st-mod: #eab308; --st-done: #16a34a; --st-del: #dc2626; --st-wait: #f97316; --st-other: #e3e6ec; }
.stk { display: flex; flex-direction: column; gap: 2px; align-items: stretch; width: 100%; max-width: 44px; margin: 0 auto; cursor: help; }
.st { display: block; border-radius: 5px; font-size: 11px; font-weight: 700; line-height: 16px; text-align: center; color: #fff; font-variant-numeric: tabular-nums; }
.st.sm { font-size: 10px; line-height: 14px; }
.s-plan { background: var(--st-plan); }
.s-mod { background: var(--st-mod); color: #3d2e00; }
.s-done { background: var(--st-done); }
.s-del { background: var(--st-del); }
.legend i.sw.s-plan { background: var(--st-plan); } .legend i.sw.s-mod { background: var(--st-mod); }
.legend i.sw.s-done { background: var(--st-done); } .legend i.sw.s-del { background: var(--st-del); }
.legend i.sw.s-wait { background: var(--st-wait); } .legend i.sw.s-other { background: var(--st-other); }
.bar .b-done { background: var(--st-done); } .bar .b-mod { background: var(--st-mod); } .bar .b-plan { background: var(--st-plan); }
.bar .b-wait { background: var(--st-wait); } .bar .b-del { background: var(--st-del); }
.cal td.d { vertical-align: middle; }
.cal tfoot td.tot { padding: 6px 3px; }
.badge.sub { background: #f1eefc; color: #5b4bb5; font-weight: 500; }
.swatch.s-plan { background: var(--st-plan); } .swatch.s-mod { background: var(--st-mod); }
.swatch.s-done { background: var(--st-done); } .swatch.s-del { background: var(--st-del); }

/* ячейка календаря: одно число, заливка по диагонали долями статусов */
.sq { display: grid; place-items: center; width: 100%; max-width: 38px; height: 30px; margin: 0 auto; border-radius: 7px;
      color: #fff; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; cursor: help;
      text-shadow: 0 1px 2px rgba(0, 0, 0, .55); }
.sq.sm { height: 24px; font-size: 11px; }

.term-tip { border-bottom: 1px dotted currentColor; cursor: help; }
.kpi[data-tip] { cursor: help; }

/* вход через Битрикс24 */
.b24-btn { display: flex; align-items: center; justify-content: center; height: 44px; border-radius: 10px;
  background: #2fc6f6; color: #fff; font-weight: 650; text-decoration: none; }
.b24-btn:hover { background: #1fb3e2; text-decoration: none; }
.dev-login { display: grid; gap: 8px; margin-top: 6px; padding-top: 12px; border-top: 1px dashed var(--line); }
.login-card button.secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--line-strong); }

.who-name { color: var(--text); font-weight: 550; }
.role-badge { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.role-badge.r-admin { background: #1c2233; color: #fff; }
.role-badge.r-mp { background: var(--primary-soft); color: var(--primary); }
.role-badge.r-mod { background: var(--ok-soft); color: var(--ok); }


/* нерабочие дни модератора */
.cal td.d.off, .cal th.d.off { background: repeating-linear-gradient(135deg, #f1f2f6 0 5px, #e3e5ee 5px 10px) !important; }
.cal td.d.off .sq { outline: 2px solid var(--bad); outline-offset: 1px; }
.sw.off { background: repeating-linear-gradient(135deg, #f1f2f6 0 3px, #d9dce7 3px 6px); }
.flash { margin: 0 0 14px; padding: 10px 14px; border-radius: 8px; font-size: 14px; }
.flash.ok { background: #eaf7ee; border: 1px solid #bfe5c9; }
.flash.bad { background: var(--warn-soft); border: 1px solid #f6dcb2; }
.btn.primary { height: 36px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--primary); background: var(--primary);
  color: #fff; font: inherit; font-weight: 600; cursor: pointer; }

/* блок «Нерабочие дни» */
.days-off { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; padding: 0 18px 18px; }
.do-card { border: 1px solid var(--line); border-radius: 12px; padding: 16px; background: var(--surface-2); min-width: 0; }
.do-title { display: flex; align-items: center; gap: 8px; font-weight: 650; margin-bottom: 10px; }
.do-count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px;
  background: var(--primary); color: #fff; font-size: 12px; }
.do-rule { display: inline-block; margin-bottom: 14px; color: var(--text-2); font-size: 13px; }
.do-form { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.do-form .field span { font-size: 12px; color: var(--muted); }
.do-form input[type=date] { height: 38px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 8px;
  font: inherit; background: #fff; }
.do-form .btn.primary { height: 38px; }
.do-list { list-style: none; margin: 0; padding: 0; }
.do-list li { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 8px 0; border-bottom: 1px solid var(--line); }
.do-list li:last-child { border-bottom: 0; }
.do-day { font-weight: 600; }
.do-day.we { color: var(--muted); }
.do-who { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.do-empty { margin: 0; color: var(--muted); }
.btn.ghost { height: 30px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff;
  font: inherit; font-size: 13px; cursor: pointer; }
.btn.ghost:hover { border-color: var(--bad); color: var(--bad); }
@media (max-width: 900px) { .days-off { grid-template-columns: 1fr; } .do-list li { grid-template-columns: 1fr auto; }
  .do-who { grid-column: 1; } }
.cal .row-days { display: inline-block; margin: 2px 0 0 46px; font-size: 12px; }

/* ---------- запросы модераторам ---------- */
.tabs a { white-space: nowrap; }
.tab-badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 4px;
  border-radius: 9px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 600; }

/* список: строка = ссылка на карточку */
.rq-list { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.rq-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto auto; align-items: center; gap: 14px;
  padding: 12px 18px; border-bottom: 1px solid var(--line); color: var(--text); border-left: 3px solid transparent; }
.rq-row:last-child { border-bottom: 0; }
a.rq-row:hover { background: var(--surface-2); text-decoration: none; }
.rq-row.s-sent { border-left-color: var(--primary); }
.rq-row.s-accepted { border-left-color: var(--ok); }
.rq-row.s-corrected { border-left-color: var(--warn); }
.rq-row.s-declined { border-left-color: var(--bad); }
.rq-row.s-replaced, .rq-row.s-cancelled { opacity: .6; }
.rq-row.cand { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto; }
.rq-row-main { display: flex; flex-direction: column; min-width: 0; }
.rq-row-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rq-row-sub { color: var(--muted); font-size: 12px; }
.rq-row-kinds { display: flex; flex-wrap: wrap; gap: 4px; }
.rq-row-go { color: var(--muted); font-size: 20px; line-height: 1; }
.rq-kindpill { display: inline-flex; gap: 4px; padding: 2px 8px; border-radius: 999px; background: var(--surface-2);
  border: 1px solid var(--line); font-size: 12px; color: var(--text-2); white-space: nowrap; }
.rq-flag { color: var(--warn); font-weight: 600; }
.rq-status { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap;
  background: var(--primary-soft); color: var(--primary); }
.rq-status.s-accepted { background: var(--ok-soft); color: var(--ok); }
.rq-status.s-corrected { background: var(--warn-soft); color: var(--warn); }
.rq-status.s-declined { background: var(--bad-soft); color: var(--bad); }
.rq-status.s-replaced, .rq-status.s-cancelled { background: var(--surface-2); color: var(--muted); }

/* карточка */
.rq-card-wrap { max-width: 720px; }
.rq-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px 22px; border-top: 4px solid var(--primary); }
.rq-card.s-accepted { border-top-color: var(--ok); } .rq-card.s-corrected { border-top-color: var(--warn); }
.rq-card.s-declined { border-top-color: var(--bad); } .rq-card.s-replaced, .rq-card.s-cancelled { border-top-color: var(--line-strong); }
.rq-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.rq-card-title { margin: 0; font-size: 18px; font-weight: 650; }
.rq-card-meta { color: var(--muted); font-size: 13px; margin-top: 2px; }
.rq-total { font-size: 13px; color: var(--text-2); margin-bottom: 4px; }
.rq-group { padding: 12px 0; border-top: 1px solid var(--line); }
.rq-group:first-of-type { border-top: 0; }
.rq-group-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.rq-count { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line); font-size: 12px; font-weight: 600; }
.rq-days { display: flex; flex-wrap: wrap; gap: 6px; }
.rq-day, .rq-pick > span { display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 10px; border-radius: 8px;
  background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; white-space: nowrap; }
.rq-day .wd, .rq-pick .wd { color: var(--muted); font-size: 11px; text-transform: uppercase; }
.rq-day.dropped { background: var(--bad-soft); border-color: #f5c2c2; color: var(--bad); text-decoration: line-through; }
.rq-day.moved { background: var(--warn-soft); }
.rq-pick { cursor: pointer; }
.rq-pick input { position: absolute; opacity: 0; pointer-events: none; }
.rq-pick > span { border-style: dashed; border-color: var(--line-strong); background: var(--surface); }
.rq-pick:hover > span { border-color: var(--bad); }
.rq-pick input:checked + span { background: var(--bad-soft); border: 1px solid #f5c2c2; color: var(--bad); text-decoration: line-through; }
.rq-pick input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 1px; }
.rq-note { margin: 10px 0; padding: 8px 12px; border-radius: 8px; background: var(--surface-2); font-size: 13px; color: var(--text-2); }
.rq-note.warn { background: var(--warn-soft); color: var(--warn); }
.rq-hint { margin: 4px 0 10px; font-size: 13px; color: var(--muted); }
.rq-msg { margin-top: 12px; padding: 10px 12px; border-radius: 8px; background: var(--surface-2); font-size: 14px; }
.rq-msg span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 2px; }
.rq-comment { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; font-size: 13px; color: var(--muted); }
.rq-comment textarea { width: 100%; font: inherit; color: var(--text); padding: 8px 10px; border: 1px solid var(--line-strong);
  border-radius: 8px; resize: vertical; }
.rq-comment textarea:focus { outline: 2px solid var(--primary-soft); border-color: var(--primary); }
.rq-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.rq-btn { height: 36px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--text); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; }
.rq-btn:hover { border-color: var(--text-2); }
.rq-btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.rq-btn.primary:hover { filter: brightness(1.08); }
.rq-btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.rq-btn.quiet { border-color: transparent; background: transparent; color: var(--muted); }
.rq-btn.quiet:hover { color: var(--text); background: var(--surface-2); }

/* шаги ответа: view → correct / decline */
.rq-form .edit-only, .rq-form .decline-only, .rq-form .comment-only { display: none; }
.rq-form[data-mode="correct"] .edit-only, .rq-form[data-mode="decline"] .decline-only { display: flex; }
.rq-form[data-mode="correct"] .rq-hint.edit-only, .rq-form[data-mode="decline"] .rq-hint.decline-only { display: block; }
.rq-form[data-mode="correct"] span.edit-only { display: inline; }
.rq-form[data-mode="correct"] .comment-only, .rq-form[data-mode="decline"] .comment-only { display: flex; }
.rq-form:not([data-mode="view"]) .view-only { display: none; }

@media (max-width: 720px) {
  .rq-row, .rq-row.cand { grid-template-columns: 1fr auto; }
  .rq-row-kinds { grid-column: 1 / -1; order: 3; }
  .rq-row-go { display: none; }
  .rq-card { padding: 16px; }
}
.brand { white-space: nowrap; }
.who-name { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* шапка не шире экрана: меню прокручивается внутри себя, а не всю страницу */
.tabs { min-width: 0; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
@media (max-width: 1100px) {
  .top { gap: 16px; padding: 0 16px; }
  .who-name { max-width: 120px; }
}
.t b.bad { color: var(--bad); } .t b.warn { color: var(--warn); }

/* ---------- календарь: закреплённые шапка и левые колонки, столбец «сегодня» (12.11.2026) ----------
   Закрепление работает только внутри своего контейнера прокрутки: у таблицы он прокручивается в обе
   стороны и не выше экрана, иначе шапка дат уезжает вместе со страницей. */
.cal-wrap { overflow: auto; max-height: calc(100vh - 72px); overscroll-behavior: contain; }
.cal thead th { top: 0; }
.cal tfoot td { position: sticky; bottom: 0; z-index: 2; }
.cal .s1, .cal .s2, .cal .s3 { position: sticky; z-index: 3; background: var(--surface); }
.cal .s1 { left: 300px; } .cal .s2 { left: 396px; } .cal .s3 { left: 492px; }
.cal thead .s1, .cal thead .s2, .cal thead .s3 { z-index: 4; background: var(--surface-2); }
.cal tfoot .proj, .cal tfoot .s1, .cal tfoot .s2, .cal tfoot .s3 { z-index: 4; background: var(--surface-2); }
.cal tbody tr:hover td.proj, .cal tbody tr:hover td.s1, .cal tbody tr:hover td.s2, .cal tbody tr:hover td.s3 { background: #fafbff; }
/* сегодня: заливка и рамка по всей высоте столбца, в шапке и в итоге */
.cal td.d.today, .cal tbody tr:hover td.d.today { background: #eef0ff; box-shadow: inset 2px 0 0 #a9adf3, inset -2px 0 0 #a9adf3; }
.cal thead th.d.today { background: #e3e6ff; box-shadow: inset 2px 0 0 #a9adf3, inset -2px 0 0 #a9adf3, inset 0 2px 0 #a9adf3; }
.cal tfoot td.d.today { background: #e3e6ff; box-shadow: inset 2px 0 0 #a9adf3, inset -2px 0 0 #a9adf3, inset 0 -2px 0 #a9adf3; }
