/* Веб-версия «Помощника». Бренд-бук АРКО: белый фон, чёрный текст, красный акцент #FF0514,
   серые #8A8A8A / #D9DADA / #F5F5F5. Тёмная тема — выворотка. Шрифты системные с запасом на
   Montserrat/Golos, если стоят на компьютере. */
:root {
  --bg: #fff; --fg: #000; --red: #FF0514; --grey: #8A8A8A; --line: #D9DADA; --panel: #F5F5F5;
  --nav-w: 232px;
  color-scheme: light;
}
:root[data-theme="dark"] { --bg: #000; --fg: #fff; --grey: #A0A0A5; --line: #333336; --panel: #1C1C1E; color-scheme: dark; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #000; --fg: #fff; --grey: #A0A0A5; --line: #333336; --panel: #1C1C1E; color-scheme: dark; }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--fg); font: 15px/1.5 "Golos Text", "Segoe UI", system-ui, Arial, sans-serif; }
h1, h2, h3, .brand { font-family: Montserrat, "Segoe UI", system-ui, Arial, sans-serif; font-weight: 800; letter-spacing: -0.01em; }
h1 { font-size: 26px; margin: 0 0 4px; }
h2 { font-size: 18px; margin: 22px 0 8px; display: flex; align-items: center; gap: 8px; }
h2::before { content: ""; width: 14px; height: 2px; background: var(--red); }
a { color: inherit; }
button, .btn { font: inherit; border: 1px solid var(--fg); background: var(--fg); color: var(--bg); padding: 8px 16px; border-radius: 6px; cursor: pointer; }
button.secondary, .btn.secondary { background: transparent; color: var(--fg); border-color: var(--line); }
button.red { background: var(--red); border-color: var(--red); color: #fff; }
button.link { background: none; border: none; color: var(--grey); padding: 4px 6px; }
button:disabled { opacity: .45; cursor: default; }
input, textarea, select { font: inherit; color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 9px 11px; width: 100%; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--fg); }
textarea { min-height: 120px; resize: vertical; }
label { display: block; font-size: 13px; color: var(--grey); margin: 12px 0 4px; }
.muted { color: var(--grey); font-size: 13px; }
.error { color: var(--red); font-size: 14px; margin-top: 10px; }
.card { border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; background: var(--bg); }
.panel { background: var(--panel); border-radius: 8px; padding: 14px 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
.tag { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 10px; background: var(--panel); color: var(--grey); }
.tag.red { background: var(--red); color: #fff; }
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--line); border-top-color: var(--red); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* страница входа */
.login-wrap { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login { width: 380px; max-width: 100%; }
.login .logo { height: 44px; margin-bottom: 28px; }
.login .footer { margin-top: 36px; font-size: 11px; letter-spacing: .08em; color: var(--grey); }

/* каркас: слева меню, справа содержимое */
.shell { display: grid; grid-template-columns: var(--nav-w) 1fr; min-height: 100vh; }
nav.side { border-right: 1px solid var(--line); padding: 22px 16px; position: sticky; top: 0; height: 100vh; overflow: auto; display: flex; flex-direction: column; }
nav.side .logo { height: 36px; margin: 0 0 18px 6px; }
nav.side .brand { font-size: 19px; margin: 0 6px 16px; display: flex; gap: 8px; align-items: baseline; }
nav.side .brand span { font: 500 13px Montserrat, system-ui; color: var(--grey); }
nav.side a.item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 6px; text-decoration: none; color: var(--fg); font-size: 15px; }
nav.side a.item:hover { background: var(--panel); }
nav.side a.item.active { background: var(--fg); color: var(--bg); }
nav.side a.item .ico { width: 20px; text-align: center; font-size: 16px; opacity: .85; }
nav.side .bottom { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--grey); }
main.content { padding: 26px 34px 60px; max-width: 1100px; }
.topline { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.topline .actions { margin-left: auto; display: flex; gap: 8px; }

/* списки */
.list { border-top: 1px solid var(--line); }
.list .li { display: flex; gap: 14px; align-items: center; padding: 10px 6px; border-bottom: 1px solid var(--line); cursor: pointer; }
.list .li:hover { background: var(--panel); }
.list .li .t { font-weight: 500; }
.list .li .s { color: var(--grey); font-size: 13px; }
.list .li .when { width: 120px; color: var(--grey); font-size: 13px; flex-shrink: 0; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); flex-shrink: 0; }
.dot.off { background: transparent; }
.two { display: grid; grid-template-columns: 380px 1fr; gap: 24px; }
.two > .left { max-height: calc(100vh - 140px); overflow: auto; }
.reader { white-space: pre-wrap; line-height: 1.6; }
.reader h1 { font-size: 20px; }
.reader details { margin-top: 18px; color: var(--grey); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.tabs button { background: none; border: none; color: var(--grey); padding: 8px 12px; border-bottom: 2px solid transparent; border-radius: 0; }
.tabs button.on { color: var(--fg); border-bottom-color: var(--red); }
.toast { position: fixed; right: 24px; bottom: 24px; background: var(--fg); color: var(--bg); padding: 10px 16px; border-radius: 8px; font-size: 14px; opacity: 0; transition: opacity .2s; pointer-events: none; }
.toast.show { opacity: 1; }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  nav.side { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .two { grid-template-columns: 1fr; }
  main.content { padding: 18px; }
}

/* рабочий стол */
.hero { position: relative; height: 320px; border-radius: 10px; overflow: hidden; background: #111; cursor: pointer; }
.hero img { width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity .6s; }
.hero-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.05) 30%, rgba(0,0,0,.72) 100%); }
.hero-text { position: absolute; left: 28px; right: 28px; bottom: 26px; color: #fff; }
.hero-text h1 { color: #fff; font-size: 34px; margin: 4px 0 6px; text-shadow: 0 2px 12px rgba(0,0,0,.4); }
.hero-sum { font-size: 15px; opacity: .92; }
.hero-cap { position: absolute; right: 16px; top: 14px; font-size: 12px; color: #fff; background: rgba(0,0,0,.45); padding: 6px 10px; border-radius: 6px; max-width: 46%; }
.hero-cap span { display: block; opacity: .8; font-size: 11px; }
.hero-slogan { position: absolute; left: 20px; top: 16px; max-width: 46%; color: #fff; font: 600 13px Montserrat, "Segoe UI", system-ui; letter-spacing: .01em; padding: 6px 10px 6px 20px; background: rgba(0,0,0,.45); border-radius: 6px; text-shadow: 0 1px 6px rgba(0,0,0,.5); }
.hero-slogan::before { content: ""; position: absolute; left: 8px; top: 50%; width: 8px; height: 2px; background: var(--red); }
.hero-slogan:empty { display: none; }
.hero-next { position: absolute; right: 12px; bottom: 14px; width: 34px; height: 34px; border-radius: 50%; border: 1px solid rgba(255,255,255,.5); background: rgba(0,0,0,.35); color: #fff; font-size: 18px; padding: 0; }
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 16px 0 14px; }
.quick .qa { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 12px 14px; background: var(--bg); color: var(--fg); border: 1px solid var(--line); border-radius: 8px; }
.quick .qa:hover { border-color: var(--fg); }
.quick .qa .ico { font-size: 20px; }
.quick .qa b { font-family: Montserrat, system-ui; font-weight: 600; }
.quick .qa span:last-child { font-size: 12px; color: var(--grey); }
a.tile { text-decoration: none; color: inherit; }
a.tile:hover { border-color: var(--fg); }
.home-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 32px; margin-top: 10px; }
.home-grid section h2 { margin-top: 14px; }
.link-more { margin-left: auto; font: 500 12px "Golos Text", system-ui; color: var(--grey); text-decoration: none; }
.link-more:hover { color: var(--fg); }
@media (max-width: 860px) { .quick { grid-template-columns: 1fr 1fr; } .home-grid { grid-template-columns: 1fr; } .hero { height: 240px; } .hero-cap { display: none; } .hero-slogan { max-width: 80%; } }

/* протоколы */
.ptable { width: 100%; border-collapse: collapse; }
.ptable th { text-align: left; font-size: 12px; color: var(--grey); font-weight: 500; padding: 4px 6px; border-bottom: 1px solid var(--line); }
.ptable td { padding: 4px 6px; vertical-align: top; border-bottom: 1px solid var(--line); }
.ptable td.n { color: var(--grey); font-size: 13px; padding-top: 12px; }
.ptable textarea { min-height: 44px; }

/* модальные окна */
dialog.modal { border: 1px solid var(--line); border-radius: 10px; padding: 22px 24px; width: 460px; max-width: 95vw; background: var(--bg); color: var(--fg); }
dialog.modal::backdrop { background: rgba(0,0,0,.45); }
dialog.modal h3 { margin: 0 0 6px; }
.t.done, span.done { text-decoration: line-through; color: var(--grey); }
a.li { text-decoration: none; color: inherit; }

/* календарь */
.mgrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.mgrid .dh { text-align: center; font-size: 12px; color: var(--grey); padding: 4px 0; }
.mgrid .dh.we { color: var(--red); }
.mgrid .dc { min-height: 92px; border: 1px solid var(--line); border-radius: 6px; padding: 6px; cursor: pointer; font-size: 12px; overflow: hidden; }
.mgrid .dc.empty { border: 0; cursor: default; }
.mgrid .dc:hover { background: var(--panel); }
.mgrid .dc.sel { border-color: var(--fg); }
.mgrid .dc.today .dn { color: var(--red); font-weight: 700; }
.mgrid .dn { font-weight: 600; margin-bottom: 4px; }
.mgrid .mini { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 2px solid var(--red); padding-left: 4px; margin: 2px 0; }
.wgrid { display: grid; grid-template-columns: 56px repeat(7, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.wgrid .wh { padding: 8px 6px; text-align: center; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 12px; color: var(--grey); }
.wgrid .wh b { display: block; font-size: 18px; color: var(--fg); }
.wgrid .wh.today b { color: var(--red); }
.wgrid .wh.we { color: var(--red); }
.wgrid .wl { font-size: 11px; color: var(--grey); padding: 4px 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.wgrid .wc { min-height: 44px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 2px; }
.wgrid .wc.allday { background: var(--panel); min-height: 30px; }
.wgrid .wev { background: var(--panel); border-left: 3px solid var(--red); border-radius: 3px; padding: 2px 6px; margin: 2px 0; font-size: 12px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wgrid .wev:hover { background: var(--line); }
.ev { padding: 8px 6px; border-bottom: 1px solid var(--line); cursor: pointer; }
.ev:hover { background: var(--panel); }
.ev b { display: inline-block; width: 64px; }
.ev .addr, .addr { color: var(--red); text-decoration: none; }
.daylist { border-top: 1px solid var(--line); }
/* кнопка «выполнено»: заметная, зелёная — это состояние, а не фирменный акцент */
:root { --ok: #1E8E3E; --ok-bg: #E6F4EA; }
:root[data-theme="dark"] { --ok: #4CC26B; --ok-bg: #12331B; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --ok: #4CC26B; --ok-bg: #12331B; } }
button.ev-done { border: 2px solid var(--ok); background: var(--bg); color: var(--ok); font-weight: 700; padding: 3px 10px; border-radius: 16px; margin-right: 10px; vertical-align: middle; line-height: 1.2; }
button.ev-done.on { background: var(--ok); color: #fff; }
button.ev-done.sm { padding: 0 5px; margin-right: 5px; font-size: 11px; border-width: 1.5px; }
button.done-big { width: 100%; border: 2px solid var(--ok); background: var(--ok-bg); color: var(--ok); font-weight: 700; padding: 12px 16px; border-radius: 8px; font-size: 15px; }
button.done-big.on { background: var(--ok); color: #fff; }
.wgrid .wev { display: flex; align-items: center; gap: 4px; }
.wgrid .wev b { flex-shrink: 0; }
.wgrid .wc.past, .wgrid .wh.past { background: var(--panel); opacity: .75; }
.wgrid .wpast { grid-row: 1 / span 15; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--panel); color: var(--grey); padding: 8px 2px; cursor: pointer; border-radius: 0; writing-mode: vertical-rl; transform: rotate(180deg); font-size: 12px; display: flex; align-items: center; gap: 6px; }
.wgrid .wpast:hover { color: var(--fg); }
.wgrid .wpast span { font-size: 11px; }
.ev.done .tt, .mini.done, .wev.done { text-decoration: line-through; color: var(--grey); }
.wev.done { border-left-color: var(--line); }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 8px; }
.tile { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; }
.tile b { display: block; font: 800 26px Montserrat, system-ui; font-variant-numeric: tabular-nums; }
.tile span { font-size: 12px; color: var(--grey); }
@media (max-width: 860px) { .tiles { grid-template-columns: 1fr 1fr; } }

/* реестр проектов */
.form { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 4px 18px; }
.form .fld.wide { grid-column: 1 / -1; }
.form label { margin-top: 8px; }
table.grid { width: 100%; border-collapse: collapse; font-size: 14px; }
table.grid th { text-align: left; font-size: 12px; color: var(--grey); font-weight: 500; padding: 8px 8px; border-bottom: 2px solid var(--fg); }
table.grid td { padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.grid tr[data-id] { cursor: pointer; }
table.grid tr[data-id]:hover td { background: var(--panel); }
.link-back { color: var(--grey); text-decoration: none; font-size: 14px; margin-right: 6px; }
.drop { border: 2px dashed var(--line); border-radius: 10px; padding: 16px 18px; margin: 12px 0; }
.drop.over { border-color: var(--red); background: var(--panel); }
.link-btn { color: var(--red); cursor: pointer; text-decoration: underline; }
@media (max-width: 860px) { .form { grid-template-columns: 1fr; } }

/* договор: суммы, ДС, акты */
.sums { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 12px 0 4px; }
.sums > div { background: var(--panel); border-radius: 8px; padding: 8px 12px; }
.sums span { display: block; font-size: 11px; color: var(--grey); text-transform: uppercase; letter-spacing: .04em; }
.sums b { display: block; font: 700 16px Montserrat, system-ui; font-variant-numeric: tabular-nums; }
.sums i { display: block; font-style: normal; font-size: 11px; color: var(--grey); }
.sums > div.ok b { color: var(--ok); }
.sums > div.bad b { color: var(--red); }
.kcard h4 { margin: 16px 0 6px; font: 600 13px Montserrat, system-ui; display: flex; align-items: center; gap: 10px; }
.kcard table.grid td, .kcard table.grid th { padding: 6px 8px; font-size: 13.5px; }
.kcard tr.sub td { background: var(--panel); border-bottom: 1px solid var(--line); padding: 4px 10px 6px 24px; }
.kcard tr.sub table.grid { margin: 2px 0; }
.kcard tr.sub table.grid td { border-bottom: 0; background: transparent; padding: 2px 6px; }
.upl { display: inline-flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 12px; }
.upl .small { font-size: 12px; }

/* телефон, 13.09.2026: содержимое не должно растягивать сетку шире экрана; меню не забирает половину высоты */
.shell { grid-template-columns: var(--nav-w) minmax(0, 1fr); }
main.content { min-width: 0; }
.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; align-content: start; }
  nav.side { padding: 10px 12px; }
  nav.side .logo { height: 26px; margin: 4px 0 6px 4px; }
  nav.side .brand { margin-bottom: 6px; }
  nav.side a.item { display: inline-flex; padding: 6px 9px; font-size: 14px; }
  nav.side .bottom { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding-top: 8px; margin-top: 6px; font-size: 11px; }
  nav.side .bottom > div { margin: 0 !important; }
  main.content { padding: 14px 14px 40px; }
  h1 { font-size: 22px; }
  .topline { gap: 8px; margin-bottom: 12px; }
  .topline .actions { width: 100%; margin-left: 0; }
  .topline .actions input { width: 100%; }
  table.grid { font-size: 13px; }
  table.grid th, table.grid td { padding: 7px 6px; }
  dialog.modal { width: 96vw; padding: 16px; }
  .form { grid-template-columns: 1fr; }
  .sums { grid-template-columns: 1fr 1fr; }
}

/* телефон, вторая правка 13.09.2026: лента-меню, карточки вместо таблиц, прокручиваемые вкладки */
a.btn { text-decoration: none; }
.tabs { overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { white-space: nowrap; flex: 0 0 auto; }
nav.side .items { display: flex; flex-direction: column; gap: 2px; }
@media (max-width: 860px) {
  nav.side { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 2px 10px; position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 8px 12px 6px; border-bottom: 1px solid var(--line); overflow: visible; height: auto; }
  nav.side > a:first-child { grid-row: 1; margin: 0; }
  nav.side .logo { height: 24px; margin: 0; }
  nav.side .brand { grid-row: 1; margin: 0; font-size: 16px; }
  nav.side .bottom { grid-row: 1; margin: 0; padding: 0; border: 0; display: flex; gap: 8px; align-items: center; font-size: 11px; }
  nav.side .bottom > div:first-child { max-width: 120px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  nav.side .bottom > div:nth-child(2), nav.side .bottom > div:last-child { display: none; }
  nav.side .bottom form { margin: 0 !important; }
  nav.side .items { grid-row: 2; grid-column: 1 / -1; flex-direction: row; overflow-x: auto; gap: 4px; padding: 4px 0 2px; scrollbar-width: none; }
  nav.side .items::-webkit-scrollbar { display: none; }
  nav.side a.item { flex: 0 0 auto; padding: 6px 10px; font-size: 14px; white-space: nowrap; border: 1px solid var(--line); border-radius: 16px; }
  nav.side a.item.active { border-color: var(--fg); }
  nav.side a.item .ico { display: none; }
  .list .li { flex-wrap: wrap; gap: 6px 12px; }
  .list .li .when { width: auto; }
  .acts .li .kind { width: auto; }
  .acts .li .grow { flex-basis: 100%; }
  .topline h1 { flex: 1 1 auto; min-width: 0; font-size: 20px; }
  .link-back { flex-basis: 100%; }
  .drop .row { flex-direction: column; align-items: stretch; }
  .drop .row select, .drop .row input { width: 100% !important; }
  .upl { flex-wrap: wrap; }
  table.grid.cards, table.grid.cards tbody, table.grid.cards tr, table.grid.cards td { display: block; }
  table.grid.cards tr:first-child { display: none; }
  table.grid.cards tr { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; }
  table.grid.cards tr:hover td { background: transparent; }
  table.grid.cards td { border: 0; padding: 2px 0; font-size: 14px; }
  table.grid.cards td.inl { display: inline-block; margin-right: 10px; }
  table.grid.cards td[data-l]::before { content: attr(data-l) ": "; color: var(--grey); font-size: 12px; }
  table.grid.cards td:empty { display: none; }
  .kcard table.grid:not(.cards) { display: block; overflow-x: auto; }
  .kcard table.grid:not(.cards) td, .kcard table.grid:not(.cards) th { min-width: 90px; }
  .tablewrap table.grid:not(.cards) { min-width: 560px; }
}
.topline, .topline .actions { flex-wrap: wrap; }
@media (max-width: 860px) {
  .topline .actions { width: 100%; margin-left: 0; }
  .topline .actions input { width: 100% !important; }
  .topline .actions > * { flex: 1 1 auto; }
}

/* заполненность карточки (14.09.2026, как в «Воронке»): красная до 40 %, жёлтая до 80 %, зелёная дальше */
.tag.fill { font-variant-numeric: tabular-nums; margin-left: 6px; }
.tag.fill.low { background: var(--red); color: #fff; }
.tag.fill.mid { background: #FFF1CC; color: #7A5B00; }
.tag.fill.ok { background: #DDF3E4; color: #1E6B3A; }
:root[data-theme="dark"] .tag.fill.mid { background: #4A3A00; color: #FFD866; }
:root[data-theme="dark"] .tag.fill.ok { background: #143D24; color: #7ED69A; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tag.fill.mid { background: #4A3A00; color: #FFD866; } :root:not([data-theme="light"]) .tag.fill.ok { background: #143D24; color: #7ED69A; } }

/* поля, входящие в заполненность (как в «Воронке»): красная точка у подписи, пустое — красная рамка */
.fdot, .fill-f > label::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--red); margin-right: 6px; vertical-align: 1px; }
.fill-f.fill-empty > input, .fill-f.fill-empty > select, .fill-f.fill-empty > textarea, .fill-f.fill-empty > .row > input { border-color: var(--red); background: #FFF4F4; }
:root[data-theme="dark"] .fill-f.fill-empty > input, :root[data-theme="dark"] .fill-f.fill-empty > select, :root[data-theme="dark"] .fill-f.fill-empty > textarea, :root[data-theme="dark"] .fill-f.fill-empty > .row > input { background: #2A1214; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .fill-f.fill-empty > input, :root:not([data-theme="light"]) .fill-f.fill-empty > select, :root:not([data-theme="light"]) .fill-f.fill-empty > textarea, :root:not([data-theme="light"]) .fill-f.fill-empty > .row > input { background: #2A1214; } }
.fill-legend { color: var(--grey); font-size: 12px; margin: 6px 0 0; }

/* договор, открытый по прямой ссылке (#p/<проект>/<договор>), и ссылки в списке проектов */
.kcard.hl { outline: 2px solid var(--red); outline-offset: 2px; }
.plink { color: inherit; text-decoration: none; }
.plink:hover, .plink:focus-visible { text-decoration: underline; outline: none; }

/* сортировка и фильтры списка проектов (просьба Васильева, 15.09.2026) */
table.grid th.sortable { cursor: pointer; user-select: none; }
/* колонки списка: суммы, даты и РП не переносятся, адрес и название переносятся; таблице отдана вся ширина экрана
   (15.09.2026, Артур: «фамилия РП не вмещается») */
table.grid td.nw { white-space: nowrap; font-variant-numeric: tabular-nums; }
table.grid td.addr { max-width: 260px; }
main.content.wide { max-width: none; }
table.grid th.sortable:hover, table.grid th.sortable.on { color: var(--fg); }
.fbar { margin: -8px 0 10px; gap: 8px; }
.fbar select { width: auto; max-width: 240px; padding: 5px 8px; font-size: 13px; }
.fbar button { padding: 5px 10px; font-size: 13px; }
.fbar button.red { background: var(--red); border-color: var(--red); color: #fff; }
.fpanel { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px 12px; margin-bottom: 12px; }
.fpanel label { margin: 0 0 3px; font-size: 12px; }
.fpanel select { padding: 6px 8px; font-size: 13px; }
@media (max-width: 860px) { .fbar .grow { flex-basis: 100%; height: 0; } .fbar select { flex: 1 1 auto; max-width: none; } }

/* подсказка контрагента под полями заказчика (15.09.2026) */
.fld { position: relative; }
.ac { position: absolute; left: 0; right: 0; top: 100%; z-index: 20; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.14); max-height: 280px; overflow-y: auto; }
.ac > div { padding: 7px 11px; cursor: pointer; border-bottom: 1px solid var(--line); }
.ac > div:last-child { border-bottom: 0; }
.ac > div.on, .ac > div:hover { background: var(--panel); }
.ac b { display: block; font-size: 14px; }
.ac .muted { display: block; font-size: 12px; }

/* ---------- реестр имущества (склад), 15.09.2026: телефон Ильи — крупные кнопки, карточки с фото ---------- */
.big3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 6px 0 18px; }
.big3 a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 120px; border: 2px solid var(--fg); border-radius: 14px; text-decoration: none; color: var(--fg); font: 700 17px Montserrat, "Segoe UI", system-ui; }
.big3 a .ico { font-size: 34px; line-height: 1; }
.big3 a.red { background: var(--red); border-color: var(--red); color: #fff; }
.big3 a:active { transform: scale(.98); }
.quicklinks { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; }
.quicklinks a { text-decoration: none; font-size: 13px; padding: 5px 12px; border: 1px solid var(--line); border-radius: 16px; color: var(--fg); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.icard { display: flex; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 10px; cursor: pointer; text-decoration: none; color: inherit; background: var(--bg); }
.icard:hover { border-color: var(--fg); }
.icard.sel { border-color: var(--red); background: #FFF4F4; }
:root[data-theme="dark"] .icard.sel { background: #2A1214; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .icard.sel { background: #2A1214; } }
.thumb { width: 72px; height: 72px; border-radius: 8px; object-fit: cover; background: var(--panel); flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: var(--grey); font-size: 24px; }
.thumb.lg { width: 100%; height: auto; aspect-ratio: 4 / 3; max-height: 60vh; object-fit: contain; background: #111; }
.icard .body { min-width: 0; flex: 1; }
.icard .num { font: 800 20px Montserrat, system-ui; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.icard .nm { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icard .meta { color: var(--grey); font-size: 13px; }
.tag.st-ok { background: #DDF3E4; color: #1E6B3A; }
.tag.st-new { background: #DDF3E4; color: #1E6B3A; }
.tag.st-bad { background: var(--red); color: #fff; }
.tag.st-rep { background: #FFF1CC; color: #7A5B00; }
.tag.st-off { background: var(--fg); color: var(--bg); }
.tag.dup { background: var(--red); color: #fff; }
/* карточка предмета */
.item-num { font: 800 34px Montserrat, system-ui; letter-spacing: .02em; margin: 6px 0 0; font-variant-numeric: tabular-nums; }
.item-num.none { color: var(--grey); font-size: 18px; font-weight: 600; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 6px 14px; margin: 12px 0; font-size: 15px; }
.kv span:nth-child(odd) { color: var(--grey); font-size: 13px; padding-top: 2px; }
.states { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 14px; }
.states button { padding: 8px 12px; border-radius: 18px; background: transparent; color: var(--fg); border: 1px solid var(--line); font-size: 14px; }
.states button.on { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.gallery { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.gallery img { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; border: 2px solid transparent; cursor: pointer; }
.gallery img.main { border-color: var(--red); }
.bigbtn { width: 100%; padding: 16px; font: 700 17px Montserrat, "Segoe UI", system-ui; border-radius: 12px; margin-top: 10px; }
.bigbtn.secondary { font-weight: 600; }
/* добавить: фото и голос */
.shot { position: relative; border: 2px dashed var(--line); border-radius: 14px; min-height: 200px; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 8px; cursor: pointer; overflow: hidden; background: var(--panel); }
.shot img { width: 100%; max-height: 50vh; object-fit: contain; display: block; background: #111; }
.shot .hint { color: var(--grey); font-size: 14px; text-align: center; padding: 10px; }
.shot .ico { font-size: 44px; }
.talk { width: 100%; padding: 22px 16px; border-radius: 14px; font: 700 19px Montserrat, "Segoe UI", system-ui; background: var(--fg); color: var(--bg); border: 2px solid var(--fg); user-select: none; -webkit-user-select: none; touch-action: none; -webkit-touch-callout: none; }
.talk.rec { background: var(--red); border-color: var(--red); color: #fff; animation: pulse 1s ease-in-out infinite; }
.talk.busy { opacity: .6; }
@keyframes pulse { 50% { box-shadow: 0 0 0 10px rgba(255, 5, 20, .18); } }
.heard { margin: 10px 0 4px; padding: 10px 12px; background: var(--panel); border-radius: 10px; font-size: 14px; }
.heard b { display: block; font-size: 12px; color: var(--grey); font-weight: 500; margin-bottom: 2px; }
/* экран проверки: крупно */
.check { border: 1px solid var(--line); border-radius: 14px; padding: 6px 16px 12px; margin-top: 12px; }
.check .cr { display: grid; grid-template-columns: 110px 1fr; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.check .cr:last-child { border-bottom: 0; }
.check .cr .l { color: var(--grey); font-size: 13px; }
.check .cr .v { font: 600 18px/1.3 "Golos Text", "Segoe UI", system-ui; word-break: break-word; }
.check .cr .v.empty { color: var(--grey); font-weight: 400; font-size: 15px; }
.check .cr input, .check .cr select { font-size: 18px; padding: 8px 10px; }
.check .cr input.num { font: 700 22px Montserrat, system-ui; text-transform: uppercase; letter-spacing: .04em; }
.areas { display: flex; gap: 6px; margin-top: 6px; }
.areas button { flex: 1; padding: 10px; border-radius: 10px; background: transparent; color: var(--fg); border: 1px solid var(--line); }
.areas button.on { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.step { font: 700 13px Montserrat, system-ui; letter-spacing: .06em; text-transform: uppercase; color: var(--grey); margin: 16px 0 6px; }
.step b { display: inline-flex; width: 22px; height: 22px; border-radius: 50%; background: var(--red); color: #fff; align-items: center; justify-content: center; font-size: 12px; margin-right: 8px; }
/* перемещение */
.picked { border: 1px solid var(--line); border-radius: 12px; padding: 6px 12px; margin: 8px 0; }
.picked .pi { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.picked .pi:last-child { border-bottom: 0; }
.picked .pi b { font-family: Montserrat, system-ui; }
.picked .pi .x { margin-left: auto; }
/* сводка */
table.grid td.n, table.grid th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.form .fld.areas-wrap { grid-column: 1 / -1; }
@media (max-width: 860px) {
  .big3 { grid-template-columns: 1fr; gap: 10px; }
  .big3 a { flex-direction: row; justify-content: flex-start; padding: 0 22px; min-height: 84px; font-size: 20px; gap: 16px; }
  .big3 a .ico { font-size: 32px; }
  .cards { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 110px 1fr; }
  .check .cr { grid-template-columns: 96px 1fr; }
  main.content { padding-bottom: 80px; }
  nav.side a.item[href="#list"], nav.side a.item[href="#svodka"], nav.side a.item[href="#nastroyki"], nav.side a.item[href="/api/export.xlsx"] { order: 5; }
}
