/* Фирменный стиль Ванлав — по официальному сайту vanlav.ru */
@font-face { font-family: 'Cera Pro'; src: url('/brand/fonts/CeraPro-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Cera Pro'; src: url('/brand/fonts/CeraPro-Medium.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Cera Pro'; src: url('/brand/fonts/CeraPro-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }
:root {
  --brand: #823F91; --brand-2: #9D59AA; --brand-ink: #fff;
  --bg: #F9F0F8; --panel: #fff; --ink: #3A3839; --muted: #85787F; --line: #EEDDEB;
  --accent: #823F91; --accent-ink: #fff; --accent-soft: #F9F0F8; --ok: #2f7a4b; --warn: #A15C00; --warn-soft: #FFF4E2;
  --radius: 14px; --shadow: 0 1px 2px rgba(130,63,145,.05), 0 6px 20px rgba(130,63,145,.06);
  font-family: 'Cera Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.45; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; width: 100%; }
a { color: var(--brand); }
h1 { font-size: 26px; font-weight: 700; margin: 0; color: var(--ink); }
h2 { font-size: 16px; font-weight: 700; margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.eyebrow { font-size: 12px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); margin-bottom: 4px; }

header.top { position: sticky; top: 0; z-index: 10; background: var(--brand); color: #fff; padding: 10px 24px; display: flex; align-items: center; gap: 32px; }
.brand { display: flex; align-items: center; text-decoration: none; }
.brand img { height: 34px; display: block; }
header nav { display: flex; gap: 6px 20px; flex: 1; justify-content: flex-end; flex-wrap: wrap; }
header nav a { white-space: nowrap; }
header nav a { padding: 6px 0; color: #fff; text-decoration: none; font-weight: 500; font-size: 14px; border-bottom: 2px solid transparent; }
header nav a:hover { border-bottom-color: rgba(255,255,255,.5); }
header nav a.on { border-bottom-color: #fff; }
button.link { background: none; border: 0; color: rgba(255,255,255,.75); cursor: pointer; font: inherit; font-size: 14px; }
button.link:hover { color: #fff; }
footer.site { background: var(--brand); color: #fff; padding: 22px 24px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin-top: 32px; }
footer.site img { height: 30px; }
footer.site span { font-size: 13px; opacity: .8; }
footer.site .grow { flex: 1; }

main { max-width: 1320px; margin: 0 auto; padding: 24px 20px; }
.bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.bar .grow { flex: 1; }

.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 18px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--brand-2); color: var(--brand); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--brand-2); border-color: var(--brand-2); color: #fff; }
.btn.ai { background: #fff; border: 1.5px solid var(--brand); color: var(--brand); }
.btn.ai:hover { background: var(--brand); color: #fff; }
.btn.ai.busy::after { border-color: var(--brand) var(--brand) transparent transparent; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.sm { padding: 5px 12px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.busy { position: relative; color: transparent !important; }
.btn.busy::after { content: ''; position: absolute; inset: 0; margin: auto; width: 16px; height: 16px; border: 2px solid currentColor; border-color: #fff #fff transparent transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.btn:not(.primary):not(.ai).busy::after { border-color: var(--ink) var(--ink) transparent transparent; }
@keyframes spin { to { transform: rotate(360deg); } }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.panel + .panel { margin-top: 16px; }

input, select, textarea { font: inherit; color: inherit; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: #fff; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
textarea { resize: vertical; min-height: 70px; line-height: 1.4; }
label.f { display: block; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 12px; }
label.f > input, label.f > select, label.f > textarea { margin-top: 4px; text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--ink); font-size: 15px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; }

/* Список карт */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.card-tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); text-decoration: none; color: inherit; display: flex; gap: 12px; padding: 12px; align-items: center; }
.card-tile:hover { border-color: var(--accent); transform: translateY(-1px); }
.card-tile { transition: transform .15s, border-color .15s; }
.card-tile .ph { width: 72px; height: 72px; border-radius: 10px; background: var(--bg) center/cover; flex: none; display: grid; place-items: center; color: var(--muted); font-size: 11px; }
.card-tile b { display: block; line-height: 1.25; }
.tag { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 99px; background: var(--bg); color: var(--muted); margin-top: 4px; }
.tag.pf { background: #fff; color: var(--brand-2); border: 1px solid var(--line); }
.tag.dish { background: var(--brand); color: #fff; }
.section-title { font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .08em; color: var(--brand); margin: 22px 0 10px; }

/* Редактор */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.side { position: sticky; top: 72px; display: flex; flex-direction: column; gap: 16px; }
.photo-box { display: grid; place-items: center; aspect-ratio: 1; border: 1.5px dashed var(--line); border-radius: var(--radius); background: var(--bg) center/contain no-repeat; cursor: pointer; color: var(--muted); text-align: center; font-size: 13px; padding: 10px; }
.photo-box.has { border-style: solid; background-color: #fff; }
.photo-box.has span { display: none; }

table.items { width: 100%; border-collapse: collapse; font-size: 14px; }
table.items th { text-align: left; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; padding: 4px 4px 6px; white-space: nowrap; }
table.items td { padding: 3px 3px; vertical-align: middle; }
table.items td input, table.items td select { padding: 5px 6px; }
table.items td.num input { text-align: right; width: 78px; }
table.items td.kind select { width: 96px; }
table.items td input.name { min-width: 240px; }
table.items td.unit select { width: 60px; }
table.items tr.bad input.name { border-color: var(--warn); background: var(--warn-soft); }
.scroll-x { overflow-x: auto; }

.kbju { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; text-align: center; }
.kbju div { background: var(--bg); border-radius: 8px; padding: 8px 4px; }
.kbju b { display: block; font-size: 20px; }
.kbju span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.kbju .k { background: var(--brand); color: #fff; }
.kbju .k span { color: rgba(255,255,255,.85); }
.warns { margin: 10px 0 0; padding: 0; list-style: none; font-size: 13px; }
.warns li { background: var(--warn-soft); color: var(--warn); border-radius: 6px; padding: 5px 8px; margin-top: 5px; }
.actions { display: flex; flex-direction: column; gap: 8px; }
.actions .row { display: flex; gap: 8px; }
.actions .row .btn { flex: 1; justify-content: center; }

/* Сырьё */
table.ing { width: 100%; border-collapse: collapse; }
table.ing th { text-align: left; font-size: 11px; color: var(--muted); text-transform: uppercase; padding: 6px; border-bottom: 1px solid var(--line); }
table.ing td { padding: 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.ing td.n { text-align: right; font-variant-numeric: tabular-nums; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--warn); }
.dot.ok { background: var(--ok); }

dialog { border: 0; border-radius: 14px; padding: 20px; width: min(560px, 94vw); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(31,27,23,.35); }

/* Импорт */
.parsed .pc { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin-top: 12px; background: #fff; }
.parsed .pc ul { margin: 6px 0 0; padding-left: 18px; font-size: 14px; }
.drop { border: 1.5px dashed var(--brand-2); border-radius: var(--radius); background: var(--bg); padding: 18px; cursor: pointer; text-align: center; transition: background .15s; }
.drop.over { background: var(--accent-soft); border-color: var(--brand); }
.drop.has { text-align: left; }
.drop.has .drop-hint { margin-bottom: 12px; }
.thumbs { display: flex; flex-wrap: wrap; gap: 10px; }
.thumb { width: 96px; height: 96px; border-radius: 10px; background: #fff center/cover; position: relative; box-shadow: var(--shadow); }
.thumb button { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(58,56,57,.75); color: #fff; font-size: 11px; cursor: pointer; }
table.mini { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-top: 6px; }
table.mini th { font-weight: 500; color: var(--muted); text-align: right; padding: 2px 4px; }
table.mini td { padding: 3px 4px; border-top: 1px solid var(--line); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.mini td:first-child { text-align: left; white-space: normal; }
.parsed .new { color: var(--warn); font-size: 12px; font-weight: 600; }

#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--brand); color: #fff; padding: 10px 18px; border-radius: 10px; box-shadow: var(--shadow); z-index: 100; max-width: 90vw; }
#toast.err { background: #a3212f; }

body.login { display: grid; place-items: center; min-height: 100vh; background: var(--brand); }
.login-box { background: var(--panel); padding: 32px 28px 26px; border-radius: 16px; text-align: center; box-shadow: var(--shadow); width: min(360px, 92vw); display: flex; flex-direction: column; gap: 12px; }
.login-box img { width: 200px; margin: 0 auto 4px; display: block; }
.login-box .sign { color: var(--brand); font-size: 13px; margin: 6px 0 0; opacity: .8; }
.login-box .err { color: #a3212f; margin: 0; }

@media (max-width: 980px) {
  .editor { grid-template-columns: 1fr; }
  .side { position: static; }
}
@media (max-width: 640px) {
  main { padding: 14px; }
  header.top { gap: 10px 16px; padding: 10px 14px; flex-wrap: wrap; }
  header nav { justify-content: flex-start; gap: 16px; order: 3; width: 100%; }
  .brand img { height: 28px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
}

/* Проверка названий */
.verdict { margin-top: 16px; border-radius: var(--radius); padding: 16px 18px; border: 1px solid; }
.verdict b { font-size: 17px; }
.verdict p { margin: 6px 0 8px; }
.verdict.high { background: #FDECEE; border-color: #F2B8BF; color: #7A1F2B; }
.verdict.medium { background: var(--warn-soft); border-color: #F1D29B; color: #6B4200; }
.verdict.low { background: #EAF6EE; border-color: #B7DEC4; color: #1F5A35; }
.verdict a { color: inherit; }
.risk { font-size: 12px; font-weight: 500; padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
.risk.high { background: #FDECEE; color: #9B2335; } .risk.medium { background: var(--warn-soft); color: var(--warn); } .risk.low { background: #EAF6EE; color: var(--ok); }
.cls { display: inline-block; min-width: 24px; text-align: center; font-size: 12px; padding: 1px 5px; margin: 1px 0; border-radius: 6px; background: var(--bg); color: var(--muted); }
.cls.hot { background: var(--brand); color: #fff; font-weight: 700; } .cls.warm { background: var(--accent-soft); color: var(--brand); font-weight: 500; border: 1px solid var(--line); }
.tagx { font-size: 11px; font-weight: 500; color: var(--brand); background: var(--accent-soft); padding: 1px 6px; border-radius: 99px; white-space: nowrap; }
table.tm tr.expired td { opacity: .55; }

/* Шапка: пользователь */
.who { display: flex; align-items: center; gap: 14px; }
.who form { margin: 0; }
#me { color: #fff; font-weight: 500; }
/* Презентации */
.pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.pick-item { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; cursor: pointer; background: #fff; }
.pick-item:has(input:checked) { border-color: var(--brand); background: var(--accent-soft); }
.pick-item input { width: auto; accent-color: var(--brand); }
.pick-item .ph { width: 48px; height: 48px; border-radius: 8px; background: var(--bg) center/cover; flex: none; }
.pick-item b { display: block; font-size: 14px; line-height: 1.25; }
.fc { font-size: 20px; font-weight: 700; color: var(--brand); margin-top: 8px; text-transform: none; letter-spacing: 0; }
/* Команда */
tr.off td { opacity: .5; }
.cred { display: grid; gap: 8px; background: var(--bg); border-radius: 12px; padding: 12px 14px; }
.cred div { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.cred b { font-family: ui-monospace, Menlo, monospace; font-size: 15px; word-break: break-all; text-align: right; }

.who[hidden] { display: none; }
header.top { flex-wrap: wrap; }
@media (max-width: 1100px) {
  header nav { order: 3; width: 100%; flex: none; justify-content: flex-start; gap: 4px 18px; }
  .who { margin-left: auto; }
}

/* Статусы карт */
.st { display: inline-block; font-size: 11px; font-weight: 500; padding: 1px 8px; border-radius: 99px; white-space: nowrap; vertical-align: 1px; }
.st-draft { background: #EEE; color: #666; } .st-review { background: var(--warn-soft); color: var(--warn); } .st-ok { background: #EAF6EE; color: var(--ok); }
#stBadge .st { font-size: 13px; padding: 4px 12px; }
.costbig { font-size: 22px; font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.who .help { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,.7); color: #fff; text-decoration: none; font-weight: 700; font-size: 13px; }
/* Производство */
.tabs { display: flex; gap: 6px; margin: -4px 0 16px; flex-wrap: wrap; }
.tabs a { padding: 7px 14px; border-radius: 10px; text-decoration: none; color: var(--muted); font-weight: 500; background: #fff; border: 1px solid var(--line); }
.tabs a.on { background: var(--brand); color: #fff; border-color: var(--brand); }
table.staff input, table.staff select { padding: 5px 7px; }
.pick-row { display: flex; gap: 8px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.pick-row input { width: auto; accent-color: var(--brand); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 0 0 12px; }
.stats div { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.stats span { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.stats b { font-size: 22px; }
.stats .k { background: var(--brand); border-color: var(--brand); color: #fff; } .stats .k span { color: rgba(255,255,255,.85); }
.stats .ok { background: #EAF6EE; border-color: #B7DEC4; color: #1F5A35; }
.warnbox { background: var(--warn-soft) !important; color: #6B4200; border-color: #F1D29B !important; }
.gantt { position: relative; padding-top: 24px; }
.g-axis { position: relative; height: 18px; margin-left: 130px; border-bottom: 1px solid var(--line); }
.g-axis span { position: absolute; transform: translateX(-50%); font-size: 11px; color: var(--muted); top: -16px; }
.g-row { display: flex; align-items: center; border-bottom: 1px dashed var(--line); min-height: 42px; }
.g-name { width: 130px; flex: none; font-weight: 600; font-size: 14px; display: flex; flex-direction: column; }
.g-track { position: relative; flex: 1; height: 34px; }
.g-task { position: absolute; top: 3px; height: 28px; border-radius: 6px; color: #fff; font-size: 11px; padding: 2px 5px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; box-shadow: inset 0 0 0 1px rgba(255,255,255,.35); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
tr.hl td { background: var(--accent-soft); font-weight: 500; }
tr.tot td { border-top: 2px solid var(--line); }
.task-card ol { margin: 6px 0 0; padding-left: 20px; } .task-card li { margin-bottom: 4px; }
.print-only { display: none; }
@media print {
  body.print-tasks header.top, body.print-tasks footer.site, body.print-tasks .bar, body.print-tasks .tabs, body.print-tasks .side,
  body.print-tasks #res > :not(.tasks-print), body.print-tasks .editor > div > .panel { display: none !important; }
  body.print-tasks .print-only { display: block; }
  body.print-tasks .editor { display: block; }
  body.print-tasks .task-card { break-inside: avoid; box-shadow: none; }
}

/* =====================================================================
   Оболочка v2: боковое меню, верхняя панель, дашборд, командная строка
   Моушн-токены: 120 / 200 / 320 мс, только transform и opacity.
   ===================================================================== */
:root {
  --sb-w: 256px; --sb-w-c: 76px;
  --t-fast: 120ms; --t-mid: 200ms; --t-slow: 320ms;
  --ease: cubic-bezier(0.2, 0, 0, 1); --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --brand-deep: #6C3279; --brand-ink: #F6ECF8;
}
.i { width: 20px; height: 20px; flex: none; display: block; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 200; background: #fff; padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.shell { display: grid; grid-template-columns: var(--sb-w) 1fr; min-height: 100dvh; transition: grid-template-columns var(--t-mid) var(--ease); }
.shell.collapsed { grid-template-columns: var(--sb-w-c) 1fr; }
.main { min-width: 0; display: flex; flex-direction: column; }
#app { outline: none; width: 100%; max-width: 1360px; margin: 0 auto; padding: 8px 32px 48px; }

/* Боковое меню */
.sb { position: sticky; top: 0; height: 100dvh; background: var(--brand); color: var(--brand-ink); display: flex; flex-direction: column; padding: 18px 12px 14px; overflow: hidden; z-index: 30; }
.sb-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 8px 22px; min-height: 58px; }
.sb-logo { display: block; position: relative; height: 34px; }
.sb-logo img { height: 34px; display: block; transition: opacity var(--t-mid) var(--ease), transform var(--t-mid) var(--ease); transform-origin: left center; }
.sb-mark { position: absolute; left: 0; top: 0; width: 34px; height: 34px; border-radius: 10px; background: #fff; color: var(--brand); display: grid; place-items: center; font-weight: 700; font-size: 20px; opacity: 0; transform: scale(.85); transition: opacity var(--t-mid) var(--ease), transform var(--t-mid) var(--ease); }
.sb-toggle, .sb-out { background: none; border: 0; color: rgba(255,255,255,.7); cursor: pointer; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease), transform var(--t-mid) var(--ease); }
.sb-toggle:hover, .sb-out:hover { background: rgba(255,255,255,.12); color: #fff; }
.sb-nav { position: relative; display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; }
.sb-ind { position: absolute; left: 0; right: 0; top: 0; height: 44px; border-radius: 12px; background: #fff; box-shadow: 0 6px 18px rgba(40,10,50,.22); opacity: 0; pointer-events: none; transition: transform var(--t-slow) var(--ease), height var(--t-slow) var(--ease), opacity var(--t-mid) var(--ease); will-change: transform; }
.sb-group { font-size: 11px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.55); padding: 18px 12px 6px; white-space: nowrap; transition: opacity var(--t-fast) var(--ease); }
.sb-item { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 12px; border-radius: 12px; color: rgba(255,255,255,.86); text-decoration: none; font-weight: 500; font-size: 14.5px; white-space: nowrap; transition: color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease); }
.sb-item span { transition: opacity var(--t-fast) var(--ease); }
.sb-item:hover { background: rgba(255,255,255,.1); color: #fff; }
.sb-item.on { color: var(--brand); background: transparent; }
.sb-item:active .i { transform: scale(.92); }
.sb-item .i { transition: transform var(--t-fast) var(--ease); }
.sb-foot { border-top: 1px solid rgba(255,255,255,.16); padding-top: 10px; margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.sb-user { display: flex; align-items: center; gap: 6px; }
.sb-me { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; background: none; border: 0; color: #fff; cursor: pointer; padding: 6px 8px; border-radius: 12px; text-align: left; font: inherit; transition: background-color var(--t-fast) var(--ease); }
.sb-me:hover { background: rgba(255,255,255,.1); }
.sb-user form { margin: 0; }
.av { width: 34px; height: 34px; border-radius: 50%; background: #fff; color: var(--brand); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.av.sm { width: 28px; height: 28px; font-size: 11px; background: var(--accent-soft); }
.who-t { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; white-space: nowrap; overflow: hidden; }
.who-t b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; }
.who-t small { font-size: 12px; color: rgba(255,255,255,.65); }

/* Свёрнутое меню: только иконки */
.shell.collapsed .sb-logo { width: 34px; overflow: hidden; }
.shell.collapsed .sb-logo img { opacity: 0; transform: scale(.9); }
.shell.collapsed .sb-mark { opacity: 1; transform: none; }
.shell.collapsed .sb-head { flex-direction: column; gap: 12px; padding-bottom: 12px; }
.shell.collapsed .sb-toggle { transform: rotate(180deg); }
.shell.collapsed .sb-item span, .shell.collapsed .sb-group, .shell.collapsed .who-t { opacity: 0; pointer-events: none; }
.shell.collapsed .sb-group { height: 12px; padding: 6px 0 0; overflow: hidden; }
.shell.collapsed .sb-item { justify-content: flex-start; padding: 0 14px; }
.shell.collapsed .sb-user { flex-direction: column; }

/* Верхняя панель */
.tb { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; padding: 14px 32px; background: rgba(249, 240, 248, .82); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); }
.tb-title { font-weight: 500; color: var(--muted); font-size: 14px; flex: 1; }
.tb-burger { display: none; background: #fff; border: 1px solid var(--line); border-radius: 10px; width: 40px; height: 40px; place-items: center; color: var(--ink); cursor: pointer; }
.tb-search { display: flex; align-items: center; gap: 10px; min-width: 320px; height: 40px; padding: 0 8px 0 12px; border-radius: 12px; border: 1px solid var(--line); background: #fff; color: var(--muted); cursor: pointer; font: inherit; font-size: 14px; transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease); }
.tb-search:hover { border-color: var(--brand-2); box-shadow: 0 0 0 4px rgba(130,63,145,.08); }
.tb-search .i { width: 18px; height: 18px; }
.tb-search-t { flex: 1; text-align: left; }
kbd { font-family: inherit; font-size: 11px; font-weight: 500; color: var(--muted); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; }

/* Кнопки с иконками */
.btn .i { width: 18px; height: 18px; }
.btn { transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease), transform 90ms var(--ease), box-shadow var(--t-fast) var(--ease); }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn.primary { box-shadow: 0 6px 16px -6px rgba(130,63,145,.55); }

/* Дашборд */
.dash-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin: 12px 0 24px; }
.dash-head h1 { font-size: 34px; letter-spacing: -.01em; text-wrap: balance; }
.dash-head .eyebrow::first-letter { text-transform: uppercase; }
.dash-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; background: #fff; border: 1px solid var(--line); border-radius: 20px; overflow: hidden; margin-bottom: 28px; }
.kpi { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 22px 24px; text-decoration: none; color: var(--ink); border-left: 1px solid var(--line); transition: background-color var(--t-fast) var(--ease); }
.kpi:first-child { border-left: 0; }
.kpi:hover { background: #FDF8FC; }
.kpi-l { font-size: 12px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); }
.kpi b { font-size: 40px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.kpi b small { font-size: 18px; color: var(--muted); font-weight: 500; }
.kpi-s { font-size: 13px; color: var(--muted); }
.kpi-warn b { color: var(--warn); }
.kbar { height: 6px; border-radius: 99px; background: var(--accent-soft); overflow: hidden; margin: 2px 0; }
.kbar i { display: block; height: 100%; width: var(--w); background: var(--brand); border-radius: 99px; transform-origin: left; animation: grow .7s var(--ease) both .15s; }
@keyframes grow { from { transform: scaleX(0); } }
.kpi-ring { padding-right: 96px; }
.ring { position: absolute; right: 22px; top: 50%; width: 60px; height: 60px; margin-top: -30px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 5; }
.ring-bg { stroke: var(--accent-soft); }
.ring-fg { stroke: var(--brand); stroke-linecap: round; stroke-dasharray: 113.1; stroke-dashoffset: calc(113.1 - 113.1 * var(--p) / 100); animation: ring .9s var(--ease) both .15s; }
@keyframes ring { from { stroke-dashoffset: 113.1; } }

.dash-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 28px 40px; }
.blk h2 { font-size: 13px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); margin: 0 0 12px; }
.att { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.att-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px; background: #fff; border: 1px solid var(--line); text-decoration: none; color: var(--ink); transition: border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease); }
.att-row:hover { border-color: var(--brand-2); transform: translateX(2px); }
.att-ic { width: 38px; height: 38px; border-radius: 10px; background: var(--accent-soft); color: var(--brand); display: grid; place-items: center; flex: none; }
.att-row.warn .att-ic { background: var(--warn-soft); color: var(--warn); }
.att-t { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.att-t b { font-size: 15px; font-weight: 500; }
.att-t small { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-go { color: var(--muted); transition: transform var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
.att-row:hover .att-go { transform: translateX(3px); color: var(--brand); }
.empty { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--ok); }
.empty.muted { color: var(--muted); }
.recent { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.rc { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--ink); }
.rc-ph { aspect-ratio: 4 / 3; border-radius: 14px; background: #fff center/cover; border: 1px solid var(--line); display: grid; place-items: center; color: var(--brand-2); overflow: hidden; transition: transform var(--t-mid) var(--ease), box-shadow var(--t-mid) var(--ease); }
.rc:hover .rc-ph { transform: translateY(-3px); box-shadow: 0 12px 24px -12px rgba(58,56,57,.35); }
.rc-ph .i { width: 28px; height: 28px; }
.rc-t { font-weight: 500; font-size: 14px; line-height: 1.25; margin-top: 4px; }
.rc-s { font-size: 12px; color: var(--muted); }
.feed { list-style: none; margin: 0; padding: 0; position: relative; }
.feed::before { content: ''; position: absolute; left: 13px; top: 6px; bottom: 6px; width: 1px; background: var(--line); }
.feed li { position: relative; display: flex; gap: 12px; padding: 6px 0 10px; }
.feed-t { font-size: 14px; line-height: 1.45; }
.feed-t small { display: block; color: var(--muted); font-size: 12px; }
.feed-t a { font-weight: 500; }
.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.mini-list a { font-weight: 500; text-decoration: none; }

/* Командная строка */
dialog { opacity: 1; transform: none; transition: opacity var(--t-mid) var(--ease), transform var(--t-mid) var(--ease), overlay var(--t-mid) allow-discrete, display var(--t-mid) allow-discrete; }
@starting-style { dialog[open] { opacity: 0; transform: translateY(8px) scale(.98); } }
dialog::backdrop { background: rgba(58,56,57,.28); backdrop-filter: blur(2px); transition: opacity var(--t-mid) var(--ease); }
@starting-style { dialog[open]::backdrop { opacity: 0; } }
.pal { padding: 0; width: min(640px, 94vw); border-radius: 18px; margin-top: 12vh; overflow: hidden; }
.pal-in { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.pal-in input { border: 0; outline: none; padding: 6px 0; font-size: 17px; background: transparent; }
.pal-in input:focus { outline: none; }
.pal-ic { color: var(--brand); }
.pal-list { list-style: none; margin: 0; padding: 8px; max-height: min(60vh, 460px); overflow-y: auto; }
.pal-g { font-size: 11px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 10px 10px 4px; }
.pal-it { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; cursor: pointer; color: var(--ink); }
.pal-it .i { color: var(--brand-2); }
.pal-it span { display: flex; flex-direction: column; min-width: 0; }
.pal-it b { font-weight: 500; font-size: 15px; }
.pal-it small { color: var(--muted); font-size: 12px; }
.pal-it.on { background: var(--brand); color: #fff; }
.pal-it.on .i, .pal-it.on small { color: rgba(255,255,255,.85); }
.pal-empty { padding: 18px; color: var(--muted); text-align: center; }

/* Тосты — снизу по центру, с появлением */
#toast:not([hidden]) { animation: toast-in var(--t-slow) var(--ease); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 12px); } }

/* Карточки списка и плитки — отклик на наведение */
.card-tile { transition: transform var(--t-mid) var(--ease), border-color var(--t-fast) var(--ease), box-shadow var(--t-mid) var(--ease); }
.card-tile:hover { transform: translateY(-2px); box-shadow: 0 14px 28px -16px rgba(58,56,57,.35); }
.g-task { transform-origin: left center; animation: bar-in .45s var(--ease) both; }
@keyframes bar-in { from { transform: scaleX(0); opacity: 0; } }

/* Мобильные: меню — выезжающая панель */
.sb-scrim { display: none; }
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .kpi:nth-child(3) { border-left: 0; }
  .kpi:nth-child(n+3) { border-top: 1px solid var(--line); }
  .dash-grid { grid-template-columns: 1fr; }
  .tb-search { min-width: 0; }
}
@media (max-width: 860px) {
  .shell, .shell.collapsed { grid-template-columns: 1fr; }
  .sb { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; transform: translateX(-100%); transition: transform var(--t-slow) var(--ease); box-shadow: 0 0 40px rgba(0,0,0,.25); }
  .shell.drawer .sb { transform: none; }
  .sb-scrim { display: block; position: fixed; inset: 0; background: rgba(58,56,57,.35); z-index: 25; opacity: 0; pointer-events: none; transition: opacity var(--t-mid) var(--ease); }
  .shell.drawer .sb-scrim { opacity: 1; pointer-events: auto; }
  .sb-toggle { display: none; }
  .shell.collapsed .sb-item span, .shell.collapsed .sb-group, .shell.collapsed .who-t { opacity: 1; }
  .shell.collapsed .sb-logo img { opacity: 1; transform: none; } .shell.collapsed .sb-mark { opacity: 0; }
  .tb { padding: 12px 16px; }
  .tb-burger { display: grid; }
  .tb-search-t, .tb-search kbd { display: none; }
  .tb-search { min-width: 0; width: 40px; padding: 0; justify-content: center; }
  #app { padding: 4px 16px 40px; }
  .recent { grid-template-columns: repeat(2, 1fr); }
  .dash-head h1 { font-size: 28px; }
}
@media (max-width: 520px) { .kpis { grid-template-columns: 1fr; } .kpi { border-left: 0 !important; border-top: 1px solid var(--line); } .kpi:first-child { border-top: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Правки по design-review (FormFactor): крупнее текст, меньше капса, отступы по шкале 8 */
.dash-head { margin: 16px 0 24px; }
.dash-head .eyebrow { text-transform: none; letter-spacing: 0; font-size: 15px; font-weight: 500; }
.kpis { margin-bottom: 32px; }
.kpi { padding: 24px; gap: 8px; }
.kpi-l { text-transform: none; letter-spacing: 0; font-size: 15px; color: var(--muted); }
.kpi-s { font-size: 14px; }
.dash-grid { gap: 32px 40px; }
.blk h2 { text-transform: none; letter-spacing: -.01em; font-size: 20px; font-weight: 700; color: var(--ink); margin: 0 0 16px; }
.att-row { padding: 16px; gap: 16px; }
.att-t b { font-size: 16px; }
.att-t small { font-size: 14px; }
.recent { gap: 16px; }
.rc-ph { background-color: var(--accent-soft); border-color: transparent; }
.rc-t { font-size: 15px; }
.rc-s { font-size: 13px; }
.feed-t { font-size: 15px; }
.feed-t small { font-size: 13px; }
.mini-list li { padding: 12px 0; font-size: 15px; }
.sb-item { font-size: 15px; }
.rc-ph { background-color: #fff; border: 1px solid var(--line); }
.kpi-ring { padding-right: 104px; }

/* Мобильная адаптация: колонки сетки могут сжиматься, широкое содержимое прокручивается внутри своего блока */
.editor, .dash-grid { min-width: 0; }
.editor > *, .dash-grid > *, .blk, .panel { min-width: 0; }
.dash-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
@media (max-width: 1100px) { .dash-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 980px) { .editor { grid-template-columns: minmax(0, 1fr); } }
.gantt { overflow-x: auto; }
@media (max-width: 860px) {
  .g-name { width: 92px; font-size: 13px; }
  .g-axis { margin-left: 92px; }
  .g-row, .g-axis { min-width: 560px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stats b { font-size: 19px; }
  .dash-actions { width: 100%; }
  .dash-actions .btn { flex: 1; justify-content: center; }
  .bar h1, #app h1 { font-size: 24px; }
  .items td.num input { width: 70px; }
  .tabs a { padding: 7px 12px; font-size: 14px; }
  table.ing { font-size: 14px; }
  dialog { width: min(560px, 94vw); padding: 16px; }
  .pal { margin-top: 8vh; }
}
@media (max-width: 860px) { .panel:has(> table.ing), .panel:has(> table.items) { overflow-x: auto; } }

.pc-mode { margin: 8px 0 4px; width: 100%; }
.pc-off { opacity: .55; }

/* Промо-фото */
.promo-grid { display: grid; grid-template-columns: 300px 1fr; gap: 24px; }
.promo-src { aspect-ratio: 4 / 5; border-radius: 16px; background: var(--bg) center / cover no-repeat; border: 1.5px dashed var(--brand-2); display: flex; align-items: flex-end; justify-content: center; cursor: pointer; overflow: hidden; margin-top: 6px; }
.promo-src span { background: rgba(255,255,255,.9); font-size: 12px; padding: 6px 10px; border-radius: 99px; margin: 10px; color: var(--ink); }
.promo-styles { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.pstyle { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; transition: border-color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease); }
.pstyle input { grid-row: span 2; width: auto; accent-color: var(--brand); }
.pstyle small { color: var(--muted); font-size: 13px; }
.pstyle:has(input:checked) { border-color: var(--brand); background: var(--accent-soft); }
.promo-out { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-top: 18px; }
.promo-out:empty { display: none; }
.promo-item { display: flex; flex-direction: column; gap: 8px; }
.promo-item img { width: 100%; border-radius: 12px; display: block; box-shadow: 0 10px 24px -14px rgba(58,56,57,.4); }
.promo-sk { aspect-ratio: 4 / 5; border-radius: 12px; background: linear-gradient(100deg, #F3E8F2 30%, #FBF6FA 50%, #F3E8F2 70%); background-size: 200% 100%; animation: sk 1.2s linear infinite; }
@keyframes sk { to { background-position: -200% 0; } }
@media (max-width: 700px) { .promo-grid { grid-template-columns: 1fr; } }
