/* Ресурсы Friends. Палитра — из фирменного стиля, как в остальных инструментах агентства. */
:root {
  --plum: #5F3950; --plum-d: #4a2c3f; --lavender: #B8B6E7; --bluegrey: #AFC4C8; --cream: #E4E1CB;
  --lightblue: #D4E2E4; --lemon: #F9FFAE;
  --bg-lav: #E6E5F9; --bg-blue: #E1EAEC; --bg-cream: #F6F4EC; --bg-lemon: #FDFFE0;
  --ink: #1A1A1A; --muted: #7A6B74; --line: #DCD6DA; --white: #fff;
  --red: #B03030; --red-bg: #FBE3E3; --green: #2E7D32;
  --c-paid: #A9D3F0; --c-unpaid: #EDE27A; --c-tent: #D5D3F3; --c-fact: #5F3950;
  --s-part: #AFC4C8; --s-full: #6FA58A; --s-over: #D05050;
  --font: "Helvetica Neue", Helvetica, Inter, Arial, sans-serif;
  /* Объём: свет сверху, тень снизу. Кнопка стоит на «ножке» в 2 px и при нажатии на неё садится. */
  --plum-hi: #7B4D68; --plum-edge: #3F2535; --edge: #CFC4CB; --edge-line: #C9BDC5;
  --lift: 0 2px 0 #E6E0E4, 0 8px 18px rgba(63,37,53,.07);
  --top-h: 50px;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg-cream); font-size: 14px; line-height: 1.45; }
a { color: var(--plum); }
h1 { font-size: 20px; margin: 0; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
h2 { font-size: 13px; margin: 24px 0 10px; color: var(--plum); letter-spacing: .04em; text-transform: uppercase; }
h3 { font-size: 17px; margin: 0; }
h4 { font-size: 13px; margin: 0 0 6px; color: var(--plum); letter-spacing: .04em; text-transform: uppercase; }
small { font-size: 11.5px; }
[hidden] { display: none !important; }
.boot { padding: 80px 20px; text-align: center; color: var(--muted); }
.muted { color: var(--muted); }
.hint { font-size: 12.5px; color: var(--muted); margin: 8px 0 14px; max-width: 900px; }
.neg { color: var(--red); font-weight: 700; }
.pos { color: var(--green); font-weight: 700; }
.warn-t { color: #9A6A00; font-weight: 700; }
:focus-visible { outline: 2px solid var(--plum); outline-offset: 1px; border-radius: 4px; }

/* шапка */
header.top { height: var(--top-h); background: linear-gradient(180deg, #6C425A, var(--plum)); box-shadow: 0 2px 10px rgba(63,37,53,.28); color: #fff; display: flex; align-items: stretch; gap: 22px; padding: 0 20px; position: sticky; top: 0; z-index: 20; }
.brand { color: #fff; text-decoration: none; font-weight: 700; font-size: 17px; display: flex; align-items: center; gap: 8px; letter-spacing: -.01em; }
.brand span { font-weight: 400; opacity: .7; font-size: 13px; }
.nav { display: flex; align-items: flex-end; gap: 2px; flex: 1; overflow-x: auto; }
.nav a { color: #fff; text-decoration: none; padding: 9px 16px; font-size: 13.5px; border-radius: 7px 7px 0 0; background: rgba(255,255,255,.1); white-space: nowrap; }
.nav a:hover { background: rgba(255,255,255,.2); }
.nav a.on { background: var(--bg-cream); color: var(--plum); font-weight: 700; box-shadow: inset 0 1px 0 #fff; }
.nav a:focus-visible { outline-color: var(--lemon); outline-offset: -3px; }
.user { position: relative; display: flex; align-items: center; }
.user-btn { background: none; border: 0; color: #fff; font: inherit; font-size: 13px; cursor: pointer; padding: 6px 4px; white-space: nowrap; }
.caret { opacity: .7; margin-left: 5px; }
.user-menu { position: absolute; right: 0; top: calc(100% - 4px); background: #fff; border: 1px solid var(--line); border-radius: 9px; box-shadow: 0 8px 28px rgba(60,30,50,.18); padding: 5px; min-width: 180px; z-index: 30; }
.user-menu button { display: block; width: 100%; text-align: left; background: none; border: 0; font: inherit; padding: 8px 12px; border-radius: 6px; cursor: pointer; color: var(--ink); }
.user-menu button:hover { background: var(--bg-lav); }
main { padding: 18px 24px 70px; max-width: 1560px; margin: 0 auto; }
.crumbs { margin-bottom: 8px; font-size: 13px; }

/* кнопки и поля */
.btn { background: linear-gradient(180deg, var(--plum-hi), var(--plum)); color: #fff; border: 1px solid var(--plum-d); padding: 8px 16px; border-radius: 8px; font: inherit; font-size: 13.5px; cursor: pointer; white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.24), 0 2px 0 var(--plum-edge), 0 5px 10px rgba(63,37,53,.22);
  text-shadow: 0 1px 0 rgba(0,0,0,.18); transition: transform .06s ease, box-shadow .06s ease, filter .12s ease; }
.btn:hover:not(:disabled) { filter: brightness(1.09); }
.btn:active:not(:disabled) { transform: translateY(2px); box-shadow: inset 0 2px 3px rgba(0,0,0,.22), 0 0 0 var(--plum-edge), 0 1px 2px rgba(63,37,53,.2); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.ghost { background: linear-gradient(180deg, #fff, #F2EDF0); color: var(--plum); border-color: var(--edge-line); text-shadow: none;
  box-shadow: inset 0 1px 0 #fff, 0 2px 0 var(--edge), 0 4px 8px rgba(63,37,53,.09); }
.btn.ghost:hover:not(:disabled) { filter: none; background: linear-gradient(180deg, #fff, var(--bg-lav)); border-color: #B5A6B0; }
.btn.ghost:active:not(:disabled) { box-shadow: inset 0 2px 3px rgba(63,37,53,.16), 0 0 0 var(--edge); }
.btn.sm { padding: 5px 11px; font-size: 12.5px; border-radius: 7px; }
.btn.danger { background: linear-gradient(180deg, #C54A4A, var(--red)); border-color: #8A2323;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22), 0 2px 0 #741C1C, 0 5px 10px rgba(116,28,28,.2); }
.btn.danger.ghost { background: linear-gradient(180deg, #fff, #FBEDED); color: var(--red); border-color: #E2B9B9;
  box-shadow: inset 0 1px 0 #fff, 0 2px 0 #E5C6C6, 0 4px 8px rgba(116,28,28,.07); }
.btn.danger.ghost:hover:not(:disabled) { background: linear-gradient(180deg, #fff, var(--red-bg)); border-color: #D49C9C; }
.btn.left { margin-right: auto; }
.icon-btn { background: none; border: 0; font-size: 17px; line-height: 1; color: var(--muted); cursor: pointer; padding: 3px 7px; border-radius: 5px; }
.icon-btn:hover:not(:disabled) { color: var(--red); background: var(--red-bg); }
.icon-btn:disabled { opacity: .3; cursor: default; }
input, select, textarea { font: inherit; font-size: 13.5px; padding: 6px 8px; border: 1px solid #CFC6CC; border-radius: 7px; background: #fff; color: var(--ink); max-width: 100%;
  box-shadow: inset 0 1px 2px rgba(63,37,53,.09); transition: border-color .12s, box-shadow .12s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--plum); box-shadow: inset 0 1px 2px rgba(63,37,53,.09), 0 0 0 3px rgba(95,57,80,.14); }
input[type=checkbox], input[type=checkbox]:focus { box-shadow: none; }
input[type=checkbox] { width: 15px; height: 15px; padding: 0; accent-color: var(--plum); margin: 0; flex: none; }
textarea { width: 100%; resize: vertical; }
input:disabled, select:disabled, textarea:disabled { background: var(--bg-cream); color: var(--muted); }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; min-width: 0; }
.field > input, .field > select, .field > textarea { width: 100%; }
.field-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.field-hint { font-size: 11.5px; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.check { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; cursor: pointer; margin-bottom: 12px; }
.toolbar .check { margin-bottom: 0; }
.cell-in { width: 58px; text-align: center; padding: 5px 3px; background: var(--bg-lemon); }
.cell-in.wide { width: 110px; text-align: right; padding-right: 8px; }
.cell-in::placeholder { color: #A39CA0; }
.inline-in { width: 100%; border-color: transparent; background: transparent; box-shadow: none; }
.inline-in:hover, .inline-in:focus { border-color: var(--line); background: #fff; }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 12px; }
.tool-group { display: flex; gap: 4px; }
.tool-label { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.push { margin-left: auto; }
.seg { display: inline-flex; border: 1px solid var(--edge-line); border-radius: 8px; overflow: hidden; background: linear-gradient(180deg, #fff, #F2EDF0);
  box-shadow: inset 0 1px 0 #fff, 0 2px 0 var(--edge), 0 4px 8px rgba(63,37,53,.08); }
.seg button { background: transparent; border: 0; font: inherit; font-size: 12.5px; padding: 5px 11px; cursor: pointer; color: var(--plum); }
.seg button:hover:not(.on) { background: var(--bg-lav); }
.seg button + button { border-left: 1px solid #DCD2D8; }
.seg button.on { background: linear-gradient(180deg, var(--plum), var(--plum-hi)); color: #fff; box-shadow: inset 0 2px 3px rgba(0,0,0,.28); text-shadow: 0 1px 0 rgba(0,0,0,.18); }
.tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--plum); margin: 18px 0 14px; }
.tabs.top { margin-top: 0; }
.tabs button { background: linear-gradient(180deg, #F3F2FD, #E2E0F6); border: 0; font: inherit; font-size: 13px; padding: 8px 16px; cursor: pointer; border-radius: 8px 8px 0 0; color: var(--plum); box-shadow: inset 0 1px 0 #fff; }
.tabs button:hover:not(.on) { background: linear-gradient(180deg, #fff, #E9E8FA); }
.tabs button.on { background: linear-gradient(180deg, var(--plum-hi), var(--plum)); color: #fff; font-weight: 700; box-shadow: inset 0 1px 0 rgba(255,255,255,.24); text-shadow: 0 1px 0 rgba(0,0,0,.18); }

/* карточки, таблицы */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 18px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 11px; padding: 13px 15px; box-shadow: var(--lift); }
.card .lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.card .val { font-size: 24px; font-weight: 700; color: var(--plum); margin-top: 4px; font-variant-numeric: tabular-nums; }
.card .note { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.card.hi { background: linear-gradient(180deg, #FEFFEE, var(--bg-lemon)); }
.card.lav { background: linear-gradient(180deg, #F1F0FC, var(--bg-lav)); }
.card.bad { background: linear-gradient(180deg, #FDEEEE, var(--red-bg)); border-color: #E9BDBD; }
.card.bad .val { color: var(--red); }
.card-lines { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--muted); margin-top: 8px; border-top: 1px solid var(--line); padding-top: 8px; }
.card-lines b { color: var(--ink); font-variant-numeric: tabular-nums; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 11px; padding: 14px 16px; box-shadow: var(--lift); }
.panel h2 { margin-top: 0; }
.block { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 14px; }
.empty { padding: 34px; text-align: center; color: var(--muted); background: #fff; border: 1px dashed var(--line); border-radius: 10px; }
.scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: var(--lift); }
.tbl { border-collapse: collapse; width: 100%; font-size: 13px; background: #fff; }
.tbl th { background: linear-gradient(180deg, #6C425A, var(--plum)); color: #fff; font-size: 11px; text-transform: uppercase; letter-spacing: .03em; padding: 8px 9px; text-align: left; font-weight: 700; white-space: nowrap; }
.tbl td { border-top: 1px solid var(--line); padding: 6px 9px; vertical-align: middle; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl tfoot td { background: var(--bg-lav); font-weight: 700; }
.tbl tfoot tr.sub td { background: #fff; font-weight: 400; color: var(--muted); }
.tbl.hover tbody tr { cursor: pointer; }
.tbl.hover tbody tr:hover td, .tbl.tree tbody tr:hover td { background: var(--bg-lemon); }
.tbl tr.archived td { color: var(--muted); }
.tbl tr.grp td { background: var(--bg-blue); cursor: pointer; }
.tbl tr.grp.static td { cursor: default; }
.tbl tr.sub1 { cursor: pointer; }
.tbl tr.sub1 td:first-child { padding-left: 26px; }
.tbl tr.sub2 td { background: var(--bg-cream); font-size: 12.5px; }
.tbl tr.sub2 td:first-child { padding-left: 52px; }
.tbl tr.add td { background: var(--bg-cream); }
.tbl tr.total td { border-top: 2px solid var(--plum); }
.tbl tr.th-groups th { background: var(--plum-d); text-align: center; font-size: 10.5px; padding: 5px 9px; border-left: 1px solid rgba(255,255,255,.25); }
.tbl tr.th-groups th:first-child { border-left: 0; }
.tbl td.grp-start { border-left: 2px solid var(--line); }
.margin { display: inline-block; min-width: 44px; text-align: center; padding: 1px 7px; border-radius: 20px; background: var(--bg-blue); }
.margin.neg { background: var(--red-bg); }
.margin.pos { background: #DDEBDD; }
.margin.warn-t { background: #FFE9C4; }
.margin + small { display: block; line-height: 1.2; }
.tbl.compact td { padding: 4px 8px; }
.tbl.narrow { max-width: 760px; border: 1px solid var(--line); }
.tw { display: inline-block; width: 16px; font-style: normal; color: var(--muted); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 7px; vertical-align: baseline; border: 1px solid rgba(0,0,0,.12); }
.dot.lg { width: 16px; height: 16px; border-radius: 4px; margin-right: 2px; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 20px; font-size: 10.5px; font-weight: 700; letter-spacing: .02em; background: var(--bg-blue); color: var(--plum); margin-left: 6px; white-space: nowrap; }
td > .pill:first-child, .toolbar > .pill { margin-left: 0; }
.pill.st-confirmed { background: var(--lavender); }
.pill.st-tentative { background: #fff; border: 1px dashed var(--plum); }
.pill.st-completed { background: #DDEBDD; color: #245C28; }
.pill.st-cancelled { background: #E9E4E7; color: var(--muted); }
.pill.unpaid { background: var(--lemon); color: #5B5A12; }
.pill.warn-p { background: #FFE9C4; color: #7A4B00; }
.util { display: inline-block; min-width: 46px; text-align: center; padding: 2px 7px; border-radius: 20px; box-shadow: inset 0 1px 0 rgba(255,255,255,.55), inset 0 -1px 0 rgba(63,37,53,.08); font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.util small { font-weight: 400; }
.u0 { background: transparent; color: var(--muted); box-shadow: none; }
.u1 { background: var(--bg-blue); color: #4E5E62; }
.u2 { background: var(--bluegrey); color: #24383C; }
.u3 { background: var(--lavender); color: #33235A; }
.u4 { background: #F0A8A8; color: #7A1616; }
.sync { font-size: 12px; padding: 3px 10px; border-radius: 20px; background: var(--bg-lav); color: var(--plum); white-space: nowrap; }
.sync.ok { background: var(--lightblue); }
.sync.warn { background: var(--red-bg); color: var(--red); font-weight: 700; }
.heat td.hc { font-size: 12px; font-weight: 700; border-left: 2px solid #fff; border-top: 2px solid #fff; min-width: 56px; }

/* бюджет */
.budget { background: #fff; border: 1px solid var(--line); border-radius: 11px; padding: 12px 15px; margin-bottom: 4px; box-shadow: var(--lift); }
.budget-head { display: flex; gap: 14px; flex-wrap: wrap; align-items: baseline; font-size: 13px; margin-bottom: 8px; }
.budget-head span { color: var(--muted); }
.budget-bar { position: relative; height: 14px; background: var(--bg-blue); border-radius: 7px; overflow: hidden; box-shadow: inset 0 1px 2px rgba(63,37,53,.16); }
.budget-bar i { position: absolute; left: 0; top: 0; bottom: 0; }
.bb-plan { background: var(--lavender); }
.bb-plan.over { background: #F0A8A8; }
.bb-fact { background: var(--plum); height: 5px; top: auto !important; }
.bb-limit { left: 66.666% !important; width: 2px; background: var(--ink); }

/* графики */
.chart-scroll { overflow-x: auto; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { font-size: 10.5px; fill: var(--muted); font-family: var(--font); }
.chart .now { fill: var(--bg-lemon); }
.chart .cap-line { fill: none; stroke-width: 2; stroke-dasharray: 5 3; }
.chart-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 6px; }
.chart-legend i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.chart-legend i.ln { height: 0; border-top: 2px dashed; border-radius: 0; vertical-align: 4px; width: 16px; }

/* окна */
.modal-back { position: fixed; inset: 0; background: rgba(60,30,50,.5); z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; overflow-y: auto; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 520px; box-shadow: 0 2px 0 rgba(255,255,255,.6) inset, 0 24px 70px rgba(40,15,30,.38), 0 4px 12px rgba(40,15,30,.18); }
.modal.wide { max-width: 720px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 6px; }
.modal-body { padding: 10px 20px 4px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 18px; border-top: 1px solid var(--line); margin-top: 8px; background: linear-gradient(180deg, #FBFAF6, #F6F4EC); border-radius: 0 0 14px 14px; }
.confirm-text { margin: 4px 0 12px; }
#toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 70; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 9px 16px; border-radius: 8px; font-size: 13px; box-shadow: 0 6px 20px rgba(0,0,0,.25); max-width: 80vw; }
.toast.err { background: var(--red); }
.ed-tabs { margin-bottom: 14px; }
.ed-info { font-size: 12.5px; color: var(--muted); min-height: 18px; margin-bottom: 4px; }
.ed-info.warn { color: var(--red); font-weight: 700; }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.swatch { width: 24px; height: 24px; border-radius: 6px; border: 1px solid rgba(0,0,0,.15); cursor: pointer; padding: 0; }
.swatch.on { outline: 2px solid var(--plum); outline-offset: 2px; }
.phase-list { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.phase-row { display: flex; gap: 8px; align-items: center; width: 100%; }
.phase-row input:not([type=checkbox]) { flex: 1; }
.phase-row .check { margin: 0; font-size: 12px; }
.phase-group { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--plum); margin-top: 8px; }
.phase-list .toolbar { margin: 6px 0 0; }
.nowrap { white-space: nowrap; }
.team-chips { display: flex; flex-direction: column; gap: 6px; }
.team-dep { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.team-dep-name { width: 84px; flex: none; font-size: 11.5px; color: var(--muted); }
.chip { background: linear-gradient(180deg, #fff, #F4F0F3); border: 1px solid var(--edge-line); border-radius: 20px; padding: 3px 11px; font: inherit; font-size: 12.5px; cursor: pointer; color: var(--ink);
  box-shadow: inset 0 1px 0 #fff, 0 1.5px 0 var(--edge); transition: transform .06s ease, box-shadow .06s ease; }
.chip:hover { border-color: var(--plum); }
.chip:active { transform: translateY(1px); box-shadow: inset 0 1px 2px rgba(63,37,53,.18); }
.chip.on { background: linear-gradient(180deg, var(--plum-hi), var(--plum)); border-color: var(--plum-d); color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,.24), 0 1.5px 0 var(--plum-edge); }
.team-plan-box:not(:empty) { background: var(--bg-cream); border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.team-plan-head { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; font-size: 12.5px; }
.team-plan-head label, .team-plan-row { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; }
.team-plan { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 5px 14px; }
.team-plan-row span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tpl { margin-bottom: 16px; }
.tpl .toolbar > input { font-weight: 700; min-width: 240px; }
.tpl-foot { margin: 10px 0 0; }
.tpl .tbl td:nth-child(3) { min-width: 360px; }
.tpl .tbl td:nth-child(4) { min-width: 250px; }
.days { display: flex; gap: 10px; flex-wrap: wrap; padding-top: 5px; }
.check.day { margin: 0; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { flex: 1; font-size: 12px; }

/* вход */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: radial-gradient(circle at 50% 35%, #7B4D68, var(--plum) 55%, #4A2C3F); }
.auth-card { background: #fff; border-radius: 16px; padding: 28px 30px 32px; width: 100%; max-width: 400px; display: flex; flex-direction: column; box-shadow: 0 24px 70px rgba(30,10,22,.45); }
.auth-card h2 { font-size: 20px; text-transform: none; letter-spacing: -.01em; color: var(--ink); margin: 4px 0 6px; }
.auth-brand { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--plum); font-weight: 700; }
.auth-error { color: var(--red); font-size: 13px; min-height: 20px; margin-bottom: 6px; }

/* расписание */
.view-schedule { display: flex; flex-direction: column; height: calc(100vh - var(--top-h)); max-width: none; padding: 12px 16px 8px; }
.view-schedule .toolbar { margin-bottom: 10px; }
.view-schedule .toolbar input[type=search] { width: 150px; }
.sch-wrap { --left: 250px; flex: 1; min-height: 0; overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: var(--lift); }
.sch-inner { position: relative; min-width: 100%; }
.sch-head { display: flex; position: sticky; top: 0; z-index: 8; background: #fff; border-bottom: 1px solid var(--line); }
.sch-corner { position: sticky; left: 0; z-index: 9; width: var(--left); flex: none; background: #fff; border-right: 1px solid var(--line); padding: 6px 10px; display: flex; flex-direction: column; justify-content: center; }
.sch-corner b { font-size: 12.5px; }
.sch-corner small { color: var(--muted); font-size: 10.5px; }
.sch-timeline { position: relative; flex: none; }
.sch-months, .sch-ticks { display: flex; }
.sch-month { flex: none; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--plum); padding: 5px 6px 1px; border-left: 1px solid var(--line); overflow: hidden; white-space: nowrap; }
.sch-tick { flex: none; font-size: 11px; text-align: center; color: var(--ink); padding: 1px 0 5px; line-height: 1.2; overflow: hidden; white-space: nowrap; }
.sch-tick small { display: block; font-size: 9.5px; color: var(--muted); text-transform: uppercase; }
.sch-tick.off { color: var(--muted); }
.sch-tick.week { border-left: 1px solid var(--line); color: var(--muted); font-size: 10.5px; padding-top: 3px; }
.sch-tick.today { background: var(--lemon); font-weight: 700; color: var(--ink); border-radius: 4px 4px 0 0; }
.sch-band { position: absolute; bottom: -1px; height: 3px; background: var(--plum); border-radius: 2px; }
.sch-rows { position: relative; }
.sch-shades { position: absolute; top: 0; bottom: 0; left: var(--left); z-index: 0; pointer-events: none; }
.shade { position: absolute; top: 0; bottom: 0; background: #F3F0E6; pointer-events: none; }
.shade.hol { background: repeating-linear-gradient(135deg, #E4E1CB 0 5px, #F3F0E6 5px 10px); }
.shade.own { z-index: 0; background: var(--bg-blue); }
.today-line { position: absolute; top: 0; bottom: 0; background: rgba(249,255,174,.55); border-left: 2px solid #C9D04A; }
.sch-row { display: flex; border-bottom: 1px solid var(--line); }
.sch-left { position: sticky; left: 0; z-index: 5; width: var(--left); flex: none; background: #fff; border-right: 1px solid var(--line); display: flex; align-items: center; gap: 8px; padding: 4px 10px; min-width: 0; }
.sch-left.group { background: var(--bg-blue); cursor: pointer; justify-content: space-between; padding-top: 6px; padding-bottom: 6px; }
.sch-row.team .sch-left.group { background: var(--bg-lav); cursor: default; }
.grp-name { font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grp-name small { color: var(--muted); font-weight: 400; margin-left: 6px; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--bg-lav); color: var(--plum); font-size: 10.5px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex: none; }
.avatar.ph { background: #fff; border: 1.5px dashed var(--muted); color: var(--muted); }
.who { flex: 1; min-width: 0; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; line-height: 1.25; }
.who b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who:hover b { text-decoration: underline; }
.sch-track { position: relative; flex: none; background-image: linear-gradient(to right, var(--line) 1px, transparent 1px); background-size: calc(var(--dw) * 7) 100%; touch-action: pan-y; }
.sch-track[data-person] { cursor: crosshair; }
.sch-track.hot { background-color: var(--bg-lemon); }
.sch-track.group { height: 32px; background-color: var(--bg-cream); cursor: default; }
.wk { position: absolute; top: 4px; bottom: 4px; border-radius: 6px; box-shadow: inset 0 1px 0 rgba(255,255,255,.55), inset 0 -1px 0 rgba(63,37,53,.08); font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; border: 1px solid #fff; box-sizing: border-box; white-space: nowrap; overflow: hidden; font-variant-numeric: tabular-nums; z-index: 3; }
.bar { position: absolute; z-index: 1; border-radius: 5px; border: 1.5px solid; padding: 0 6px; font-size: 11px; line-height: 1.2; overflow: hidden; white-space: nowrap; cursor: grab; display: flex; gap: 6px; align-items: center; color: var(--ink); user-select: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 1px 2px rgba(63,37,53,.16); }
.bar b { font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.bar span { opacity: .7; overflow: hidden; text-overflow: ellipsis; }
.bar em { margin-left: auto; font-style: normal; font-weight: 700; opacity: .65; flex: none; }
.bar::before, .bar::after { content: ""; position: absolute; top: 0; bottom: 0; width: 7px; cursor: ew-resize; }
.bar::before { left: 0; } .bar::after { right: 0; }
.bar.tent { border-style: dashed; background: rgba(255,255,255,.7) !important; box-shadow: none; }
.bar.dim { opacity: .3; }
.bar.cut-l { border-top-left-radius: 0; border-bottom-left-radius: 0; border-left-style: dotted; }
.bar.cut-r { border-top-right-radius: 0; border-bottom-right-radius: 0; border-right-style: dotted; }
.bar.dragging { z-index: 12; opacity: .88; box-shadow: 0 6px 18px rgba(40,15,30,.3); cursor: grabbing; }
.drag-ghost { position: absolute; top: 4px; bottom: 10px; background: rgba(184,182,231,.45); border: 1.5px dashed var(--plum); border-radius: 5px; z-index: 4; pointer-events: none; }
.off { position: absolute; top: 0; bottom: 6px; z-index: 3; pointer-events: none; background: repeating-linear-gradient(135deg, rgba(122,107,116,.2) 0 4px, rgba(122,107,116,.07) 4px 8px); display: flex; align-items: flex-end; justify-content: center; overflow: hidden; }
.off.part { background: repeating-linear-gradient(135deg, rgba(122,107,116,.1) 0 4px, transparent 4px 8px); }
.off-chip { pointer-events: auto; cursor: pointer; background: #fff; border: 1px solid var(--muted); color: var(--muted); font-size: 10px; font-weight: 700; border-radius: 10px; padding: 0 6px; margin-bottom: 3px; white-space: nowrap; }
.off-chip:hover { color: var(--plum); border-color: var(--plum); }
.strip { position: absolute; left: 0; right: 0; bottom: 0; height: 6px; z-index: 3; pointer-events: none; }
.over-mark { position: absolute; bottom: 7px; z-index: 4; font-size: 9.5px; font-weight: 700; color: var(--red); text-align: center; pointer-events: auto; text-shadow: 0 0 2px #fff, 0 0 2px #fff, 0 0 3px #fff; }
.sch-empty { margin: 30px; }
.legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); padding: 7px 4px 0; align-items: center; }
.lg { display: inline-block; width: 22px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.lg.bar-solid { background: var(--lavender); }
.lg.bar-tent { border: 1.5px dashed var(--plum); }
.lg.bar-off { background: repeating-linear-gradient(135deg, rgba(122,107,116,.3) 0 3px, rgba(122,107,116,.08) 3px 6px); }
.lg.strip-part, .lg.strip-full, .lg.strip-over { width: 12px; height: 6px; margin-right: 2px; border-radius: 0; }
.lg.strip-part { background: var(--s-part); } .lg.strip-full { background: var(--s-full); } .lg.strip-over { background: var(--s-over); margin-right: 5px; }

/* табель */
.tbl.ts td { padding: 4px 6px; }
.tbl.ts .ts-cell { text-align: right; }
.tbl.ts .ts-cell.off { background: var(--bg-cream); }
.tbl.ts .ts-cell.off .cell-in { background: #fff; }
.tbl.ts .ts-cell.today, .tbl.ts th.today { box-shadow: inset 0 0 0 9999px rgba(249,255,174,.35); }
.tbl.ts th.today { color: var(--lemon); }

@media (max-width: 760px) {
  main { padding: 14px 12px 60px; }
  header.top { padding: 0 12px; gap: 12px; }
  .grid2 { grid-template-columns: 1fr; }
  .sch-wrap { --left: 150px; }
  .avatar { display: none; }
}
@media print {
  header.top, .toolbar, .tabs, .legend { display: none; }
  body { background: #fff; }
}
