/* Кабинет: расписание · оборот · заявки (к crm.css). */
.spacer { flex: 1; }
.week-nav .btn-sm { gap: 5px; }
.mchip {
  display: inline-flex; align-items: center; max-width: 100%; padding: 1px 7px; border-radius: var(--r-xs);
  background: hsl(var(--h) 60% 55% / 0.16); color: hsl(var(--h) 65% 70%); font-weight: 600; font-size: var(--fs-small);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
[data-theme="light"] .mchip { color: hsl(var(--h) 60% 30%); background: hsl(var(--h) 60% 50% / 0.13); }
@media (prefers-color-scheme: light) { :root:not([data-theme]) .mchip { color: hsl(var(--h) 60% 30%); background: hsl(var(--h) 60% 50% / 0.13); } }

/* ------------------- сетка недели — как лист «Расписоса» (06.10) ------------------- */
/* Вся неделя на одном экране: блоки смен по 7 комнат, в клетке ник и квадратик отметки,
   заметка — уголком (как в гугл-таблице), серые — закрыто, внизу админы смен. */
.sheet-stats { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 6px; font-size: var(--fs-small); color: var(--text-2); }
.sheet-stats b { color: var(--text); font-weight: 600; }
.sheet-stats .warn b { color: var(--warning); }
.sheet-layout { display: grid; grid-template-columns: minmax(0, 1fr) 210px; gap: 12px; align-items: start; }
@media (max-width: 1180px) { .sheet-layout { grid-template-columns: minmax(0, 1fr); } }
.sheet-main { padding: 10px 10px 12px; }
.sheet { width: 100%; min-width: 820px; border-collapse: collapse; table-layout: fixed; font-size: 12.5px; }
.sheet col.c-blk { width: 66px; }
.sheet col.c-room { width: 124px; }
.sheet th, .sheet td { border: 1px solid var(--border); height: 25px; padding: 0 6px; }
.sheet thead th { position: sticky; top: 0; z-index: 1; height: 30px; background: var(--surface); text-align: left; font-weight: 500; color: var(--text-2); white-space: nowrap; }
.sheet thead th b { color: var(--text); }
.sheet thead th.today, .sheet thead th.today b { color: var(--accent-text); }
.sheet thead th.wkend b { color: var(--text-2); }
.sheet .corner { border-top-color: transparent; border-left-color: transparent; background: transparent; }
.sheet tbody + tbody tr:first-child > * { border-top: 2px solid var(--border-strong); }
.sheet .blk { text-align: left; vertical-align: top; padding-top: 6px; background: var(--surface-2); }
.sheet .blk b { display: block; font-size: var(--fs-small); color: var(--text); }
.sheet .blk span { display: block; font-size: 10.5px; color: var(--text-3); }
.sheet .room { text-align: left; font-weight: 500; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--surface-2); }
.sheet .rn { display: inline-block; width: 15px; color: var(--text-3); font-weight: 600; }
.sheet td.c { position: relative; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: background-color var(--t-fast) var(--ease); }
.sheet td.today { background: color-mix(in oklab, var(--accent) 8%, transparent); }
.sheet .nm { font-weight: 500; color: var(--text); }
.sheet .sq, .sched-legend .sq {
  display: inline-block; width: 9px; height: 9px; margin-right: 6px; border-radius: 2px; vertical-align: 0;
  background: var(--stc, transparent); box-shadow: inset 0 0 0 1px var(--stc, var(--border-strong));
}
.sheet td.c .hm { width: 11px; height: 11px; margin-left: 4px; color: var(--text-3); vertical-align: -1px; }
.sheet td.closed { background: color-mix(in oklab, var(--text-3) 20%, var(--surface)); }
.sheet td.event .nm { font-style: italic; font-weight: 400; color: var(--text-3); }
.sheet td.home .nm { font-style: italic; }
.sheet td.noturn .nm { text-decoration: underline dashed var(--border-strong); text-underline-offset: 3px; }
.sheet td.t-bad { background: transparent; }
.sheet td.t-bad .nm { color: var(--danger); }
.sheet td.t-good, .sheet td.t-mid { background: transparent; }
.sheet td.fine-off .sq { opacity: 0.45; }
/* отметка от наблюдателя — кольцом (проверить), ждём эфира — пунктиром */
.sheet td.auto .sq, .lg.auto .sq { background: color-mix(in oklab, var(--stc) 28%, transparent); box-shadow: inset 0 0 0 1.5px var(--stc); }
.sheet td.wait .sq { background: transparent; box-shadow: none; outline: 1px dashed var(--text-3); outline-offset: -1px; }
.air-box { grid-column: 1 / -1; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface-2); }
.air-h { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.air-h .ico { width: 14px; height: 14px; color: var(--text-3); }
.air-h .muted { margin-left: auto; }
.air-lines { margin: 0; padding: 0; list-style: none; font-size: var(--fs-small); color: var(--text-2); display: grid; gap: 3px; }
.air-lines .ico { width: 12px; height: 12px; vertical-align: -1px; margin-right: 3px; color: var(--text-3); }
.air-lines .delta { font-size: 11px; }
.air-lines.in-card { margin: 2px 0 6px 18px; }
.sheet td.moved { box-shadow: inset 0 0 0 1.5px var(--warning); }
.sheet td.fresh .nm { animation: pop 320ms var(--ease) both; }
@keyframes pop { from { opacity: 0; transform: scale(0.9); } }
@media (prefers-reduced-motion: reduce) { .sheet td.fresh .nm { animation: none; } }
.sheet .add { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--text-3); opacity: 0; transition: opacity var(--t-fast) var(--ease); }
.sheet .add .ico { width: 13px; height: 13px; }
.sheet td.empty:hover .add, .sheet td.empty:focus-visible .add { opacity: 1; }
.sheet.editable td.c, .sheet.editable td.ac { cursor: pointer; }
.sheet.editable td.c:hover, .sheet.editable td.ac:hover { background: var(--surface-hover); }
.sheet.editable td:focus-visible { outline: 2px solid var(--ring); outline-offset: -2px; }
.sheet td.ac { font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet td.same, .roster li.same { background: color-mix(in oklab, var(--accent) 18%, transparent); }
/* заметка — уголок, как в гугл-таблице */
.nt { position: absolute; top: 0; right: 0; width: 0; height: 0; border-style: solid; border-width: 0 7px 7px 0; border-color: transparent var(--warning) transparent transparent; pointer-events: none; }
.usd { flex: none; margin-left: auto; font-size: 10.5px; font-weight: 600; padding: 0 5px; border-radius: var(--r-xs); }
.t-good { color: var(--success); background: color-mix(in srgb, var(--success) 14%, transparent); }
.t-mid { color: var(--tip); background: var(--tip-soft); }
.t-bad { color: var(--danger); background: var(--danger-soft); }
/* отметки — цвета листа: ок! зелёный, опоздание жёлтый, пропуск красный, ув. причина синий */
.st-ok { --stc: #34a853; }
.st-late { --stc: #f2b200; }
.st-miss { --stc: #ea4335; }
.st-excused { --stc: #4285f4; }
.sched-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: var(--fs-small); color: var(--text-2); }
.lg { display: inline-flex; align-items: center; gap: 6px; }
.lg > i { width: 3px; height: 14px; border-radius: 2px; background: var(--stc); }
.lg .sq { margin-right: 0; }
.lg .sw { position: relative; display: inline-block; width: 16px; height: 12px; border: 1px solid var(--border); }
.lg .sw.closed { background: color-mix(in oklab, var(--text-3) 20%, var(--surface)); }
.lg .nm { font-weight: 500; }
.lg .nm.t-bad { background: transparent; }
.lg .ico { width: 13px; height: 13px; }
.lg .usd { margin: 0; }
.mv-dot { width: 12px; height: 12px; border-radius: 3px; box-shadow: inset 0 0 0 1.5px var(--warning); }
/* справа — колонка «Модели» листа */
.sheet-side { padding: 10px 8px 8px; position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; }
.side-h { display: flex; justify-content: space-between; align-items: baseline; padding: 0 4px 6px; border-bottom: 1px solid var(--border); font-size: var(--fs-small); }
.roster { list-style: none; margin: 4px 0; padding: 0; }
.roster li { position: relative; display: flex; align-items: center; gap: 6px; padding: 3px 4px; border-radius: var(--r-xs); font-size: var(--fs-small); }
.roster li > a, .roster li > span:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); text-decoration: none; }
.roster li > a:hover { text-decoration: underline; }
.roster li.off { opacity: 0.5; }
.roster .nt { position: static; border-width: 0 6px 6px 0; align-self: flex-start; margin-top: 2px; }
.roster .marks { display: flex; gap: 3px; }
.roster .mk { font-style: normal; font-size: 10px; font-weight: 700; line-height: 15px; padding: 0 4px; border-radius: 3px; color: #fff; background: var(--stc); }
.roster .mk.st-late { color: #3d2e00; }
.roster .mk.hm { display: inline-flex; align-items: center; gap: 2px; padding: 0; background: transparent; color: var(--text-3); }
.roster .mk .ico { width: 10px; height: 10px; }
.roster b { min-width: 18px; text-align: right; }
.side-tot { display: flex; justify-content: space-between; padding: 5px 4px 0; margin-top: 4px; border-top: 1px solid var(--border); font-size: var(--fs-small); color: var(--text-2); }
.side-tot b { color: var(--text); }

/* правка клетки */
.sched-edit { width: min(520px, 100%); display: grid; gap: 12px; }
.form-grid { display: grid; gap: 12px; }
.form-grid .field > span { font-size: var(--fs-small); color: var(--text-2); }
.st-seg { display: flex; flex-wrap: wrap; }
.st-seg label { flex: 1; padding: 5px 8px; border-radius: 6px; text-align: center; font-size: var(--fs-small); color: var(--text-2); cursor: pointer; white-space: nowrap; }
.st-seg label.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-ring); }
.row-end { align-items: center; }
.row-end .spacer { flex: 1; }

/* ---------------------------------- оборот ---------------------------------- */
.plan-edit { display: inline-flex; align-items: baseline; gap: 2px; }
.plan-edit input { width: 90px; padding: 0 4px; margin-left: -4px; border: 1px dashed transparent; border-radius: 6px; background: transparent; color: var(--text); font-family: inherit; }
.plan-edit input:hover { border-color: var(--border-strong); }
.plan-edit input:focus { outline: none; border-color: var(--accent-text); background: var(--surface-2); }
.daybars { position: relative; display: flex; align-items: flex-end; gap: 10px; height: 150px; border-bottom: 1px solid var(--border); margin-top: 18px; }
.db { flex: 1; height: 100%; display: flex; align-items: flex-end; }
.db i { display: block; width: 100%; border-radius: 4px 4px 1px 1px; background: color-mix(in oklab, var(--accent-text) 55%, var(--surface)); transition: filter var(--t-fast) var(--ease); }
.db.over i { background: var(--accent-text); }
.db.open i { background: repeating-linear-gradient(135deg, var(--accent-text) 0 3px, color-mix(in oklab, var(--accent-text) 35%, var(--surface)) 3px 6px); }
.db:hover i { filter: brightness(1.12); }
.plan-line { position: absolute; left: 0; right: 0; border-top: 2px dashed var(--text-3); pointer-events: none; z-index: 1; }
.plan-line span { position: absolute; right: 0; top: -18px; font-size: var(--fs-caption); color: var(--text-3); background: var(--surface); padding: 0 4px; }
.daybars-x { display: flex; gap: 10px; margin-top: 6px; }
.daybars-x > span { flex: 1; text-align: center; font-size: var(--fs-small); color: var(--text-2); }
.daybars-x b { color: var(--text-3); font-weight: 500; margin-right: 2px; }
.turn { width: 100%; min-width: 980px; border-collapse: separate; border-spacing: 3px; table-layout: fixed; }
.turn thead th { padding: 4px 6px 6px; text-align: left; color: var(--text-2); font-weight: 500; font-size: var(--fs-small); }
.turn thead th b { color: var(--text); }
.turn thead th.today b, .turn thead th.today span { color: var(--accent-text); }
.turn .corner { width: 118px; }
.turn .sh { text-align: left; vertical-align: top; padding: 8px 6px; }
.turn .sh b { display: block; font-size: var(--fs-body); }
.turn .sh .muted { font-size: var(--fs-caption); }
.turn tbody td { vertical-align: top; padding: 6px; border-radius: var(--r-sm); background: var(--surface-2); }
.turn tbody td.today { box-shadow: inset 0 0 0 1px var(--accent-soft); }
.te {
  display: flex; align-items: center; gap: 4px; width: 100%; padding: 3px 5px 3px 3px; border: 0; border-radius: 6px;
  background: transparent; color: inherit; font: inherit; font-size: var(--fs-small); text-align: left; cursor: pointer;
  transition: filter var(--t-fast) var(--ease), scale var(--t-fast) var(--ease);
}
button.te:hover { filter: brightness(1.15); }
button.te:active { scale: 0.98; }
.te-add {
  display: flex; align-items: center; justify-content: center; gap: 4px; width: 100%; margin-top: 3px; padding: 2px 4px;
  border: 1px dashed var(--border); border-radius: 6px; background: transparent; color: var(--text-3);
  font: inherit; font-size: var(--fs-caption); cursor: pointer; opacity: 0.55;
  transition: opacity var(--t-fast) var(--ease), color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.te-add .ico { width: 11px; height: 11px; }
.turn td:hover .te-add, .te-add:focus-visible { opacity: 1; }
.te-add:hover { color: var(--accent-text); border-color: var(--accent-text); }
.warn-ico { color: var(--warning); }
.turn-edit .big-in { font-size: 20px; font-weight: 650; min-height: 40px; }
.sites { display: grid; gap: 6px; }
.sites:empty { display: none; }
.site-row { display: grid; grid-template-columns: minmax(0, 1fr) 100px auto; gap: 6px; }
.add-site { justify-self: start; }
.turn-edit .field .muted { display: flex; gap: 5px; align-items: flex-start; }
.turn-edit .field .muted .ico { width: 13px; height: 13px; flex: none; margin-top: 2px; }
.online-row { display: flex; align-items: center; gap: 10px; }
.online-row input[type="time"] { width: 120px; }
/* штрафы */
.fines .why { white-space: normal; max-width: 420px; }
.fines .why .muted { display: block; margin-top: 2px; }
.fines tr.off .amt { text-decoration: line-through; color: var(--text-3); }
.fines tr.off th, .fines tr.off .why > :first-child { opacity: 0.7; }
.fines .act { width: 1%; }
.fine-why { display: flex; gap: 6px; align-items: center; justify-content: flex-end; }
.fine-why .input { width: 260px; min-height: 28px; }
.sc.fine-off .st-tag { text-decoration: line-through; opacity: 0.7; }
.te + .te { margin-top: 3px; }
.te .mchip { flex: 1; min-width: 0; }
.te > .num { font-weight: 600; }
.te .tn { width: 12px; height: 12px; flex: none; }
.te.t-good { background: color-mix(in srgb, var(--success) 12%, transparent); color: var(--success); }
.te.t-mid { background: var(--tip-soft); color: var(--tip); }
.te.t-bad { background: var(--danger-soft); color: var(--danger); }
.te.ev { font-style: italic; color: var(--text-3); }
.turn tfoot th { text-align: left; padding: 6px; font-weight: 500; color: var(--text-2); font-size: var(--fs-small); white-space: nowrap; }
.turn tfoot td { padding: 6px; font-size: var(--fs-small); border-top: 1px solid var(--border); }
.dt .pos { color: var(--success); }
.dt .neg { color: var(--danger); }
.ico.tn { width: 12px; height: 12px; vertical-align: -2px; margin-left: 2px; }
.gbar { display: inline-block; width: 110px; height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; vertical-align: middle; margin-right: 6px; }
.gbar i { display: block; height: 100%; border-radius: 3px; background: var(--accent-text); }
.gbar.done i { background: var(--success); }
.goal-in { width: 70px; padding: 3px 6px; text-align: right; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--text); font: inherit; }
.goal-in:hover { border-color: var(--border); }
.goal-in:focus { outline: none; border-color: var(--accent-text); background: var(--surface-2); }
.goals tbody th { font-weight: 500; }

/* ---------------------------------- заявки ---------------------------------- */
.plan-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--sp-3); margin-bottom: var(--sp-3); }
.rank { list-style: none; margin: 0 0 8px; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 14px; }
.rank li { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: var(--fs-small); min-width: 0; }
.rank .pos { width: 18px; color: var(--text-3); text-align: right; }
.rank .mchip { flex: 0 1 auto; min-width: 0; margin-right: auto; }
.tg { display: grid; gap: 8px; padding: 12px; border-radius: var(--r-md); background: color-mix(in oklab, var(--surface-2) 80%, var(--site-sc) 8%); margin-bottom: 8px; }
.tg-msg { display: grid; gap: 4px; max-width: 88%; padding: 8px 11px; border-radius: 14px; font-size: var(--fs-small); line-height: 1.45; }
.tg-msg small { justify-self: end; font-size: 10px; color: var(--text-3); }
.tg-msg.me { justify-self: end; background: var(--accent-soft); border-bottom-right-radius: 4px; }
.tg-msg.me b { color: var(--accent-text); font-size: var(--fs-caption); }
.tg-msg.bot { justify-self: start; background: var(--surface); border-bottom-left-radius: 4px; box-shadow: var(--shadow-ring); }
.tg-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.tg-chips i { font-style: normal; padding: 1px 7px; border-radius: var(--r-full); background: var(--surface-2); font-size: var(--fs-caption); }
.conflicts { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; }
.conflicts li { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: var(--r-sm); font-size: var(--fs-small); }
.conflicts li .ico { width: 14px; height: 14px; flex: none; }
.conflicts .mv { background: color-mix(in srgb, var(--warning) 9%, transparent); }
.conflicts .mv .ico { color: var(--warning); }
.conflicts .rj { background: var(--danger-soft); }
.conflicts .rj .ico { color: var(--danger); }
@media (max-width: 980px) { .plan-grid { grid-template-columns: minmax(0, 1fr); } .rank { grid-template-columns: minmax(0, 1fr); } }
