@font-face { font-family: "Open Sans"; font-style: normal; font-display: swap; font-weight: 300 800;
  src: url("fonts/open-sans-cyrillic-wght-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Open Sans"; font-style: normal; font-display: swap; font-weight: 300 800;
  src: url("fonts/open-sans-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
:root {
  --bg: #f3f5f8; --card: #fff; --text: #1b1f24; --muted: #6b7480; --line: #e3e7ec;
  --accent: #1f4e91; --red: #c62828; --green: #2e7d32; --amber: #b26a00; --chip: #e8edf4;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #15181c; --card: #1f2329; --text: #e8eaed; --muted: #9aa3ad; --line: #2e333a;
    --accent: #6ea0ec; --red: #ef7070; --green: #6cc070; --amber: #e0a040; --chip: #2a3038; }
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.45 "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; background: var(--bg); color: var(--text); }
.top { display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; z-index: 2; background: linear-gradient(135deg, #1f4e91, #2a78d6); color: #fff; padding: 12px 16px; }
.title { font-size: 18px; font-weight: 600; }
.sub { font-size: 13px; opacity: .85; }
main { padding: 10px 12px 40px; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; }
.chip { flex: none; border: 0; border-radius: 16px; padding: 6px 12px; background: var(--chip); color: var(--text); font-size: 14px; }
.chip.on { background: var(--accent); color: #fff; }
.chip b { font-weight: 600; margin-left: 4px; }
.filters input, .filters select { width: 100%; padding: 9px 10px; margin-top: 6px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--card); color: var(--text); font-size: 15px; }
.row { display: flex; gap: 6px; }
.count { color: var(--muted); font-size: 13px; margin: 8px 2px; }
.task { background: var(--card); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; border-left: 4px solid var(--line); }
.task.overdue { border-left-color: var(--red); }
.task.under_review { border-left-color: var(--amber); }
.task.closed { border-left-color: var(--green); }
.head { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); }
.num { font-weight: 600; color: var(--text); }
.text { margin: 4px 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.meta { font-size: 13px; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; }
.pill { font-size: 12px; padding: 1px 8px; border-radius: 10px; background: var(--chip); color: var(--text); white-space: nowrap; }
.pill.red { background: var(--red); color: #fff; }
.late { color: var(--red); font-weight: 600; }
.more { width: 100%; padding: 10px; border: 0; border-radius: 10px; background: var(--chip); color: var(--text); font-size: 15px; }
.card { background: var(--card); border-radius: 12px; padding: 14px; margin-bottom: 10px; }
.card h2 { font-size: 17px; margin: 0 0 6px; }
.card h3 { font-size: 15px; margin: 0 0 8px; }
.full { white-space: pre-wrap; margin: 8px 0; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 4px 8px; font-size: 14px; }
.kv span:nth-child(odd) { color: var(--muted); }
.step { border-top: 1px solid var(--line); padding: 8px 0; font-size: 14px; }
.step:first-of-type { border-top: 0; }
.step small { color: var(--muted); display: block; }
.btn { display: block; width: 100%; padding: 12px; border: 0; border-radius: 10px; background: var(--accent); color: #fff; font-size: 15px; }
.back { background: none; border: 0; color: var(--accent); font-size: 15px; padding: 4px 0 10px; }
.error { margin: 20px; padding: 14px; border-radius: 12px; background: var(--card); color: var(--red); }
.empty { text-align: center; color: var(--muted); padding: 30px 0; }
.row select { flex: 1; min-width: 0; }
.chips { scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
body { overflow-x: hidden; }

.tabs { position: sticky; top: 58px; z-index: 2; display: flex; background: var(--card); border-bottom: 1px solid var(--line); }
.tabs button { flex: 1; border: 0; background: none; padding: 11px; font-size: 15px; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs button.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.section { font-size: 15px; margin: 6px 2px 8px; color: var(--muted); font-weight: 600; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-bottom: 10px; }
.tile { border: 0; border-radius: 12px; background: var(--card); color: var(--text); padding: 12px; text-align: left; border-top: 3px solid var(--accent); }
.tile b { display: block; font-size: 26px; line-height: 1.1; }
.tile span { font-size: 13px; color: var(--muted); }
.tile.red { border-top-color: var(--red); } .tile.red b { color: var(--red); }
.tile.amber { border-top-color: var(--amber); }
.tile.green { border-top-color: var(--green); }
.card .task { background: var(--bg); }
.hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.hint em, .bar-num em { color: var(--red); font-style: normal; font-weight: 600; }
.empty.small { padding: 8px 0; }
.bar { display: grid; grid-template-columns: minmax(90px, 38%) 1fr auto; align-items: center; gap: 8px; width: 100%;
  border: 0; background: none; color: var(--text); padding: 5px 0; font-size: 14px; text-align: left; }
.bar-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { position: relative; height: 10px; background: var(--chip); border-radius: 5px; overflow: hidden; }
.bar-track i { position: absolute; top: 0; bottom: 0; background: var(--c); border-radius: 4px; }
.chart { display: flex; align-items: flex-end; gap: 2px; height: 90px; }
.chart .col { flex: 1; height: 100%; display: flex; align-items: flex-end; gap: 1px; }
.chart i { flex: 1; display: block; min-height: 1px; border-radius: 2px 2px 0 0; }
.chart i.in, .legend .in { background: var(--accent); }
.chart i.done, .legend .done { background: var(--green); }
.legend { font-size: 12px; color: var(--muted); margin-top: 6px; display: flex; align-items: center; gap: 4px; }
.legend span { width: 10px; height: 10px; border-radius: 2px; display: inline-block; margin-left: 8px; }
textarea { width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--text);
  font: inherit; margin: 6px 0; resize: vertical; }
.file { display: block; padding: 10px; border: 1px dashed var(--line); border-radius: 10px; text-align: center; color: var(--accent); margin: 4px 0 8px; }
.file input { display: none; }
.btn.green { background: var(--green); margin-bottom: 10px; }
.btn.ghost { background: var(--chip); color: var(--text); }
.btn:disabled { opacity: .6; }
.card.warn { border-left: 4px solid var(--amber); }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; margin: 8px 0; }
.photos a { display: block; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--chip); }
.photos img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nophoto { font-size: 12px; color: var(--muted); display: flex; align-items: center; justify-content: center; aspect-ratio: 1; background: var(--chip); border-radius: 8px; }
.toast { position: fixed; left: 12px; right: 12px; bottom: 16px; z-index: 9; background: #222; color: #fff; padding: 12px 14px; border-radius: 12px; font-size: 14px; }
.viewer { position: fixed; inset: 0; z-index: 10; background: rgba(0,0,0,.92); display: flex; align-items: center; justify-content: center; }
.viewer img { max-width: 100%; max-height: 100%; }
[hidden] { display: none !important; }

/* ---- дашборд (v3): цвета частей проверены валидатором, светлая и тёмная тема ---- */
:root { --s-done: #1baf7a; --s-work: #2a78d6; --s-late: #e34948; --s-review: #eda100; --s-in: #2a78d6; }
@media (prefers-color-scheme: dark) { :root { --s-done: #199e70; --s-work: #3987e5; --s-late: #d03b3b; --s-review: #c98500; --s-in: #3987e5; } }
.s-done { --c: var(--s-done); } .s-work { --c: var(--s-work); } .s-late { --c: var(--s-late); }
.s-review { --c: var(--s-review); } .s-in { --c: var(--s-in); }
.hello { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin: 4px 2px 10px; }
.hello b { display: block; font-size: 18px; }
.hello span { font-size: 13px; color: var(--muted); }
.seg { display: flex; background: var(--chip); border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: none; color: var(--muted); padding: 6px 10px; border-radius: 8px; font-size: 13px; }
.seg button.on { background: var(--card); color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.card { box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.dash h3 { font-size: 15px; }
.donut-wrap { position: relative; width: 190px; max-width: 70%; margin: 4px auto 10px; }
.donut { width: 100%; display: block; }
.donut .track { stroke: var(--chip); }
.donut .arc { stroke: var(--c); transition: opacity .15s; cursor: pointer; }
.donut .arc.dim { opacity: .25; }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; text-align: center; }
.donut-center b { font-size: 30px; line-height: 1; }
.donut-center span { font-size: 13px; color: var(--muted); }
.donut-center small { font-size: 11px; color: var(--muted); margin-top: 2px; max-width: 110px; }
.legend-rows { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.lrow { display: grid; grid-template-columns: 12px 1fr auto; grid-template-rows: auto auto; column-gap: 8px; align-items: center;
  border: 0; border-radius: 10px; background: var(--bg); color: var(--text); padding: 8px 10px; text-align: left; font-size: 13px; }
.lrow .sw { grid-row: 1 / 3; }
.lrow b { font-size: 17px; grid-column: 3; grid-row: 1 / 3; }
.lrow em { font-style: normal; color: var(--muted); font-size: 12px; grid-column: 2; }
.lrow.on { outline: 2px solid var(--c, var(--accent)); }
.sw { width: 12px; height: 12px; border-radius: 4px; background: var(--c); display: inline-block; }
.legend .sw { margin: 0 2px 0 10px; }
.legend .sw:first-child { margin-left: 0; }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.kpi { background: var(--card); border-radius: 12px; padding: 12px; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.kpi span { display: block; font-size: 12px; color: var(--muted); }
.kpi b { display: block; font-size: 24px; margin: 2px 0 4px; }
.kpi small { font-size: 11px; color: var(--muted); }
.meter { height: 6px; background: var(--chip); border-radius: 3px; overflow: hidden; margin-bottom: 4px; }
.meter i { display: block; height: 100%; background: var(--s-done); border-radius: 3px; }
.trend-wrap { position: relative; }
.trend { width: 100%; display: block; touch-action: pan-y; }
.trend .grid { stroke: var(--line); stroke-width: 1; }
.trend .axis { fill: var(--muted); font-size: 10px; }
.trend .line { fill: none; stroke: var(--c); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.trend .area { fill: var(--c); opacity: .10; }
.trend .cross { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.trend .dot { fill: var(--c); stroke: var(--card); stroke-width: 2; }
.trend .hit { fill: transparent; cursor: crosshair; }
.tip { position: absolute; top: -6px; z-index: 3; background: var(--text); color: var(--card); border-radius: 8px; padding: 6px 9px; font-size: 12px;
  pointer-events: none; white-space: nowrap; display: flex; flex-direction: column; gap: 2px; transform: translateY(-100%); }
.tip .sw { width: 9px; height: 9px; margin-right: 5px; }
.hint.center { text-align: center; margin: 4px 0 12px; }

/* ---- вход в браузере ---- */
.logout { border: 1px solid rgba(255,255,255,.5); background: none; color: #fff; border-radius: 8px; padding: 6px 12px; font-size: 14px; }
.login { max-width: 420px; margin: 30px auto; text-align: center; padding: 24px; }
.login h2 { font-size: 20px; }
.login p { color: var(--muted); }
.login a.btn { text-decoration: none; font-weight: 600; }
.or { margin: 16px 0 8px; font-size: 13px; color: var(--muted); }
.qr { display: inline-block; background: #fff; padding: 8px; border-radius: 12px; }
.qr svg { width: 200px; height: auto; display: block; }

/* ---- компьютер: шире, главная в две колонки, список таблицей, карточка справа ---- */
@media (min-width: 1000px) {
  main { max-width: 1180px; margin: 0 auto; padding: 16px 20px 40px; }
  .tabs { justify-content: center; }
  .tabs button { flex: 0 0 200px; }
  #home { column-count: 2; column-gap: 14px; }
  #home > * { break-inside: avoid; }
  #home > .hello, #home > .hint { column-span: all; }
  #home .card, #home .kpis { margin-bottom: 14px; display: block; }
  #home .kpis { display: grid; }
  .donut-wrap { width: 220px; }
  #list .task { display: grid; grid-template-columns: 150px 1fr 170px 150px 120px; gap: 12px; align-items: center;
    border-radius: 0; margin: 0; border-bottom: 1px solid var(--line); padding: 10px 12px; cursor: pointer; }
  #list .task:hover { background: var(--chip); }
  #list .task .head, #list .task .meta { display: contents; }
  #list .task .num { grid-column: 1; grid-row: 1; }
  #list .task .text { grid-column: 2; grid-row: 1; margin: 0; -webkit-line-clamp: 2; }
  #list .task .who { grid-column: 3; grid-row: 1; }
  #list .task .due { grid-column: 4; grid-row: 1; }
  #list .task .pill { grid-column: 5; grid-row: 1; justify-self: start; }
  #list { background: var(--card); border-radius: 12px; overflow: hidden; }
  body.split #list-view, body.split #home { margin-right: 48%; max-width: none; }
  body.split #home { column-count: 1; }
  body.split #card-view { position: fixed; top: 0; right: 0; bottom: 0; width: 46%; max-width: none; overflow-y: auto;
    background: var(--bg); box-shadow: -4px 0 16px rgba(0,0,0,.12); z-index: 5; padding-top: 16px; }
}

/* ---- новое поручение ---- */
.btn.create { margin: 0 0 12px; font-weight: 600; font-size: 16px; }
#home > .btn.create { column-span: all; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
#nt-date { width: 100%; padding: 9px 10px; margin: 6px 0; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--text); font: inherit; }
.toggle { width: 100%; margin-top: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--text); font-size: 15px; }
.toggle.on { background: var(--red); border-color: var(--red); color: #fff; font-weight: 600; }
.count-pill { font-size: 12px; font-weight: 400; color: var(--muted); margin-left: 6px; }
.picked { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.tag { background: var(--accent); color: #fff; border-radius: 14px; padding: 4px 10px; font-size: 13px; cursor: pointer; }
#nt-q { width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--text); font-size: 15px; }
.people { max-height: 360px; overflow-y: auto; margin-top: 6px; }
.people .group { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; margin: 10px 2px 4px; }
.person { display: flex; gap: 10px; align-items: center; width: 100%; border: 0; background: none; color: var(--text); text-align: left; padding: 7px 4px; border-radius: 8px; }
.person:hover { background: var(--chip); }
.person b { display: block; font-weight: 500; font-size: 14px; }
.person small { display: block; color: var(--muted); font-size: 12px; }
.person .check { flex: none; width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--line); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 14px; }
.person.on .check { background: var(--accent); border-color: var(--accent); }

button, input, select, textarea { font-family: inherit; }
/* ---- итоги закрытия ---- */
.outcomes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 6px 0; }
.oc { border: 1px solid var(--line); background: var(--bg); color: var(--text); border-radius: 10px; padding: 10px 6px; font-size: 14px; font-weight: 600; }
.oc.on, .oc.sure { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.oc.sure { background: var(--accent); color: #fff; }
.sep { height: 1px; background: var(--line); margin: 12px 0 6px; }
/* ---- переключатель список / канбан ---- */
.modes { display: inline-flex; background: var(--chip); border-radius: 10px; padding: 3px; margin: 0 0 8px; }
.modes button { border: 0; background: none; color: var(--muted); padding: 6px 14px; border-radius: 8px; font-size: 13px; }
.modes button.on { background: var(--card); color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
/* ---- канбан ---- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 10px; overflow-x: auto; padding: 8px 0 12px; align-items: start; }
.kcol { background: rgba(127,127,127,.06); border-radius: 12px; min-height: 200px; transition: background .15s; }
.kcol.over { background: rgba(42,120,214,.12); outline: 2px dashed var(--accent); }
.drag-on .kcol[data-col="late"], .drag-on .kcol[data-col="review"] { opacity: .55; }
.khdr { display: flex; justify-content: space-between; align-items: center; padding: 8px 18px 8px 12px; color: #fff; font-weight: 600; font-size: 13px;
  background: var(--c); border-radius: 10px 10px 0 0; clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%); }
.khdr b { background: rgba(255,255,255,.25); border-radius: 10px; padding: 0 8px; font-weight: 600; }
.khdr.s-review { color: #1b1f24; } .khdr.s-review b { background: rgba(0,0,0,.12); }
.kbody { padding: 8px; display: flex; flex-direction: column; gap: 8px; max-height: calc(100vh - 260px); overflow-y: auto; }
.kcard { background: var(--card); border-radius: 10px; padding: 10px 12px; box-shadow: 0 1px 2px rgba(0,0,0,.08); cursor: pointer; border: 1px solid transparent; }
.kcard:hover { border-color: var(--accent); }
.kcard[draggable="true"] { cursor: grab; }
.kcard.dragging { opacity: .4; }
.kcard.urgent { box-shadow: inset 3px 0 0 var(--s-late), 0 1px 2px rgba(0,0,0,.08); }
.khead { display: flex; justify-content: space-between; font-size: 13px; }
.kfire { color: var(--s-late); font-size: 12px; font-weight: 600; }
.ktext { font-size: 13px; margin: 6px 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.kmeta { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--accent); }
.ava { width: 22px; height: 22px; border-radius: 50%; background: var(--chip); color: var(--text); display: inline-flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; }
.kdue { font-size: 12px; color: var(--muted); margin-top: 4px; }
.kempty { color: var(--muted); font-size: 13px; text-align: center; padding: 20px 0; }
.dialog { position: fixed; inset: 0; z-index: 11; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; padding: 16px; }
.dlg { background: var(--card); border-radius: 14px; padding: 18px; width: 100%; max-width: 460px; }
.dlg h3 { margin-top: 0; }
.dlg-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
@media (min-width: 1000px) {
  #list-view { max-width: 1600px; }
}
