/* Доска расписания (timeline.js). Белое поле панели, красный — только заливкой
   (главная кнопка, «сегодня»). Тип работы — цветом полосы и чипа, статус — словом
   и формой карточки: цвет нигде не единственный носитель смысла (DESIGN.md). */
.main:has(.тл-доска) { max-width: none; }
.тл-скрыто { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.тл-тихо { color: var(--muted); font-size: 13px; }
.тл-справка-кнопка { display: inline-flex; align-items: center; gap: 6px; }

/* фильтры и легенда */
.тл-фильтры { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 2px 0 8px; }
.тл-фильтры label { display: block; }
.тл-фильтры input[type=search], .тл-фильтры select { padding: 8px 11px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 14px; background: #fff; color: var(--ink); }
.тл-фильтры input[type=search] { min-width: 280px; }
.тл-легенда { display: flex; gap: 8px 12px; flex-wrap: wrap; align-items: center; font-size: 12px; color: var(--muted); margin: 0 0 10px; }
.тл-лег { display: inline-flex; align-items: center; gap: 5px; }
.тл-разд { width: 1px; height: 14px; background: #d4d4d8; }
.тл-обр { display: inline-block; width: 20px; height: 13px; border: 1px solid #c4c4c8; border-left: 3px solid #6b7280; border-radius: 3px; background: #fff; }
.тл-обр.заявка { background: var(--cream); }
.тл-обр.done { opacity: .5; }
.тл-обр.missed { background: repeating-linear-gradient(135deg, #ececec 0 3px, #fff 3px 6px); }
.тл-обр.призрак { border: 1.5px dashed #6b7280; }

/* сетка */
.тл-обёртка { overflow-x: auto; border: 1px solid #dcdcdf; border-radius: 10px; background: #fff; }
.тл-неделя { display: grid; grid-template-columns: 212px repeat(var(--колонок), minmax(136px, 1fr)); min-width: calc(212px + var(--колонок) * 136px); }
.тл-день-вид { display: grid; grid-template-columns: 212px minmax(880px, 1fr); }
.тл-угол { position: sticky; left: 0; z-index: 3; background: #fff; border-bottom: 1px solid #dcdcdf; border-right: 1px solid #dcdcdf; }
.тл-день { text-decoration: none; text-align: center; padding: 8px 4px 6px; border-bottom: 1px solid #dcdcdf; border-left: 1px solid var(--line); display: grid; gap: 1px; }
.тл-день:hover { background: #fafafa; }
.тл-день span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.тл-день b { font-size: 20px; line-height: 30px; font-variant-numeric: tabular-nums; }
.тл-день.сегодня b { color: #fff; background: var(--red); border-radius: 50%; width: 32px; height: 32px; line-height: 32px; margin: 0 auto; }
.тл-день small { font-size: 11px; color: var(--muted); min-height: 15px; }
.тл-часы { display: grid; grid-template-columns: repeat(var(--часов), 1fr); border-bottom: 1px solid #dcdcdf; }
.тл-часы span { font-size: 11px; color: var(--muted); padding: 10px 4px 8px 5px; border-left: 1px solid var(--line); }

/* левая колонка: кто */
.тл-подпись { position: sticky; left: 0; z-index: 2; background: #fff; display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 12px; border-top: 1px solid var(--line); border-right: 1px solid #dcdcdf; min-width: 0; }
.тл-аватар { flex: none; width: 32px; height: 32px; border-radius: 50%; color: #fff; font-weight: 800; display: grid; place-items: center; font-size: 15px; }
.тл-аватар.пусто { border: 1.5px dashed #9ca3af; background: #fff; }
.тл-кто { min-width: 0; }
.тл-кто b { display: block; font-size: 14px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.тл-кто small { display: block; color: var(--muted); font-size: 12px; line-height: 1.3; margin-top: 2px; }
.тл-подпись-заявки { flex-direction: column; gap: 2px; background: var(--cream); }
.тл-подпись-заявки b { font-size: 14px; }
.тл-подпись-заявки span { font-size: 12px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.тл-подпись-заявки small { color: var(--muted); font-size: 12px; }
.тл-подпись.ничей { background: #f7f7f8; }
.тл-подпись.ничей, .тл-ячейка[data-crew="none"], .тл-трек[data-crew="none"] { border-bottom: 2px solid #c9c9ce; }

/* строка заявок */
.тл-заявки { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 8px; padding: 10px; background: #fffdf2; border-top: 1px solid var(--line);
  max-height: 242px; overflow-y: auto; }
.тл-заявки .тл-карта { width: 214px; }
.тл-пусто { color: var(--muted); font-size: 14px; padding: 12px 4px; }
.тл-ещё { align-self: center; background: none; border: 1px dashed #c4c4c8; border-radius: 8px; padding: 8px 12px; font-size: 13px; font-weight: 600; color: var(--ink); cursor: pointer; }
.тл-ещё:hover { background: #fff; }

/* ячейка недели */
.тл-ячейка { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 6px; min-height: 96px;
  border-top: 1px solid var(--line); border-left: 1px solid var(--line); min-width: 0; }
.тл-ячейка[data-crew="none"] { background: #f7f7f8; min-height: 64px; }
.тл-ячейка.сегодня, .тл-трек.сегодня { background-color: #fffdf3; }
.тл-ячейка.прошло:not(.сегодня) { background-color: #fbfbfb; }
.тл-ячейка.закрыто, .тл-трек.закрыто { background: repeating-linear-gradient(135deg, #f4f4f5 0 6px, #fff 6px 12px); }
.тл-загрузка { position: absolute; top: 3px; right: 6px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.тл-ячейка:has(.тл-загрузка) > .тл-карта:first-of-type { margin-top: 12px; }
.тл-добавить { margin-top: auto; display: flex; align-items: center; justify-content: center; gap: 4px; background: none; border: 1px dashed transparent;
  border-radius: 6px; padding: 4px; font-size: 12px; font-weight: 600; color: #9ca3af; cursor: pointer; }
.тл-добавить span { display: none; }
.тл-добавить.есть { opacity: 0; }
.тл-ячейка:hover .тл-добавить, .тл-трек:hover .тл-добавить, .тл-добавить:focus-visible { opacity: 1; border-color: #d4d4d8; color: var(--ink); }
.тл-ячейка:hover .тл-добавить span, .тл-трек:hover .тл-добавить span { display: inline; }
.тл-тащат .тл-добавить { display: none; }

/* дорожка дня */
.тл-трек { position: relative; min-height: calc(var(--дорожек) * 70px + 10px); border-top: 1px solid var(--line);
  background-image: repeating-linear-gradient(to right, var(--line) 0 1px, transparent 1px calc(100% / var(--часов))); }
.тл-трек[data-crew="none"] { background-color: #f7f7f8; }
.тл-трек .тл-карта { position: absolute; height: 64px; overflow: hidden; min-width: 64px; padding-top: 5px; padding-bottom: 5px; }
.тл-трек .тл-добавить { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); }
.тл-сейчас { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--red); z-index: 1; }
.тл-метка { position: absolute; top: 3px; bottom: 3px; border: 2px dashed #111; border-radius: 8px; background: rgba(17,17,17,.06); z-index: 4; pointer-events: none; }
.тл-метка span { position: absolute; left: -2px; top: -2px; background: #111; color: #fff; font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 6px 0 6px 0; font-style: normal; }

/* карточки */
.тл-карта { position: relative; background: #fff; border: 1px solid #d4d4d8; border-left: 4px solid var(--т); border-radius: 8px;
  padding: 6px 8px; font-size: 13px; line-height: 1.3; cursor: pointer; min-width: 0; box-shadow: 0 1px 0 rgba(0,0,0,.04); }
.тл-карта[draggable=true] { cursor: grab; }
.тл-карта:hover { box-shadow: 0 2px 10px rgba(0,0,0,.12); z-index: 3; }
.тл-карта:focus-visible { outline: 2px solid #1d4ed8; outline-offset: 2px; }
.тл-карта.тащим { opacity: .4; }
.тл-карта.заявка { padding-left: 18px; background: #fff; }
.тл-ручка { position: absolute; left: 5px; top: 50%; transform: translateY(-50%); color: #9ca3af; display: flex; }
.тл-карта.in_progress { background: color-mix(in srgb, var(--т) 7%, #fff); }
.тл-карта.done { opacity: .6; }
.тл-карта.missed { background: repeating-linear-gradient(135deg, #f1f1f2 0 6px, #fff 6px 12px); }
.тл-карта.missed .тл-имя { text-decoration: line-through; }
.тл-карта.призрак { background: transparent; border: 1.5px dashed #6b7280; border-left: 4px dashed var(--т); box-shadow: none; }
.тл-карта.ждёт { opacity: .65; }
.тл-карта.ждёт::after { content: "Saving…"; position: absolute; right: 6px; bottom: 4px; font-size: 11px; color: var(--muted); }
.тл-верх { display: flex; align-items: center; gap: 6px; min-width: 0; }
.тл-тип { display: inline-block; background: var(--т); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 110px; line-height: 16px; }
.тл-время { font-weight: 700; font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; display: inline-flex; align-items: center; gap: 3px; }
.тл-возраст { margin-left: auto; font-size: 11px; color: var(--muted); white-space: nowrap; }
.тл-имя { font-weight: 700; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.тл-мелко { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.тл-значок { display: inline-flex; align-items: center; flex: none; margin-left: auto; }
.тл-низ { display: flex; align-items: center; gap: 5px; min-width: 0; margin-top: 2px; }
.тл-низ .тл-тип { flex: none; max-width: 60%; }
.тл-низ .тл-мелко { min-width: 0; }
.тл-лег .тл-значок { margin-left: 0; }
.тл-значок.неподтв { color: #57534e; }
.тл-слово { display: inline-flex; align-items: center; gap: 3px; margin-top: 4px; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; }
.тл-слово.идёт { background: #dbeafe; color: #1e3a8a; }
.тл-слово.готово { background: var(--ok-bg); color: var(--ok); }
.тл-слово.пропущен { background: var(--cream); color: var(--red); }
.тл-слово.план { background: #e0f2fe; color: #0c4a6e; }

/* перетаскивание */
.тл-тащат .тл-ячейка:not(.закрыто), .тл-тащат .тл-трек:not(.закрыто) { box-shadow: inset 0 0 0 1px #e4e4e7; }
.тл-тащат .тл-заявки { opacity: .55; }
.тл-ячейка.тл-цель, .тл-трек.тл-цель { background: var(--cream) !important; box-shadow: inset 0 0 0 2px #111 !important; }
.тл-ячейка.тл-цель-плохо, .тл-трек.тл-цель-плохо { background: var(--warn-bg) !important; box-shadow: inset 0 0 0 2px #b45309 !important; }
.тл-подсказка { position: absolute; left: 4px; right: 4px; bottom: 4px; z-index: 6; pointer-events: none; display: flex; gap: 6px; align-items: flex-start;
  background: #111; color: #fff; font-size: 12px; line-height: 1.3; padding: 5px 8px; border-radius: 6px; }
.тл-подсказка.плохо { background: #92400e; }
.тл-подсказка.тихо { background: #52525b; }
.тл-подсказка svg { flex: none; margin-top: 1px; }
.тл-трек .тл-подсказка { left: auto; right: 8px; bottom: auto; top: 6px; max-width: 60%; }

/* мини-диалог */
.тл-диалог-фон { position: fixed; inset: 0; background: rgba(0,0,0,.35); display: flex; align-items: center; justify-content: center; z-index: 9000; padding: 16px; }
.тл-диалог { background: #fff; width: min(540px, 100%); border-radius: 12px; padding: 20px 20px 16px; box-shadow: 0 16px 48px rgba(0,0,0,.28); max-height: calc(100vh - 32px); overflow: auto; }
.тл-диалог h2 { margin: 0 0 8px; font-size: 19px; }
.тл-что { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 14px; margin-bottom: 12px; }
.тл-поля { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.тл-широко { grid-column: 1 / -1; margin-bottom: 4px; }
.тл-адрес:not(:empty) { margin-top: 10px; }
.тл-найдено { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 10px; }
.тл-сводка { font-size: 14px; margin: 12px 0 4px; }
.тл-плашка { display: flex; gap: 8px; align-items: flex-start; background: var(--warn-bg); border-left: 3px solid #b45309; padding: 8px 10px; margin-top: 8px; font-size: 14px; border-radius: 0 6px 6px 0; }
.тл-плашка svg { flex: none; color: #b45309; margin-top: 3px; }
.тл-выбор { display: grid; gap: 6px; font-size: 13px; color: var(--muted); background: #f6f6f7; padding: 10px 12px; border-radius: 8px; margin: 12px 0 0; }
.тл-выбор b { color: var(--ink); }
.тл-кнопки { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.тл-справка ol { margin: 10px 0 12px; padding: 0; list-style: none; counter-reset: шаг; display: grid; gap: 12px; }
.тл-справка li { counter-increment: шаг; display: grid; grid-template-columns: 28px 1fr; column-gap: 10px; }
.тл-справка li::before { content: counter(шаг); grid-row: span 2; width: 26px; height: 26px; border-radius: 50%; background: var(--red); color: #fff; font-weight: 800; display: grid; place-items: center; font-size: 14px; }
.тл-справка li span { color: var(--muted); font-size: 14px; }
.тл-справка p { font-size: 14px; margin: 8px 0; }

/* тост с Undo */
.тл-тост { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 9500; display: flex; align-items: center; gap: 10px;
  background: #111; color: #fff; padding: 8px 8px 8px 16px; border-radius: 10px; box-shadow: 0 8px 28px rgba(0,0,0,.3); max-width: min(760px, calc(100vw - 32px)); font-size: 14px; }
.тл-тост.плохо { background: var(--red); }
.тл-тост button { border: 0; border-radius: 6px; padding: 6px 12px; font-weight: 700; cursor: pointer; background: #fff; color: #111; white-space: nowrap; }
.тл-тост button[data-x=close] { background: transparent; color: #fff; opacity: .75; font-size: 18px; padding: 2px 8px; }
.тл-тост button:disabled { opacity: .6; }

@media (max-width: 900px) { .тл-поля { grid-template-columns: 1fr; } .тл-фильтры input[type=search] { min-width: 0; width: 100%; } }

/* тайм-офф (time_off.py, миграция 60): выходной — светло-серая заливка; отгул — тёмно-серая полоса; working — бейдж без заливки */
.тл-ячейка.выходной, .тл-трек.выходной { background-color: #ececee !important; }
.тл-выходной-метка { align-self: flex-start; font-size: 11px; font-weight: 700; color: #3f3f46; background: #d4d4d8; border-radius: 4px; padding: 1px 6px; }
.тл-выходной-метка.тл-слева { position: absolute; left: 6px; top: 6px; }
.тл-офф { display: block; width: 100%; text-align: left; border: 0; border-radius: 6px; background: #52525b; color: #fff; font-size: 12px; font-weight: 700;
  padding: 4px 8px; cursor: pointer; font-variant-numeric: tabular-nums; }
.тл-офф:hover { background: #3f3f46; }
.тл-офф:focus-visible { outline: 2px solid #1d4ed8; outline-offset: 2px; }
.тл-офф-трек { position: absolute; top: 4px; bottom: 4px; width: auto; z-index: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  background: repeating-linear-gradient(135deg, #52525b 0 8px, #5f5f68 8px 16px); }
.тл-работает { align-self: flex-start; font-size: 11px; font-weight: 700; color: #0f5132; border: 1px solid #0f7b3f; border-radius: 999px; padding: 0 7px; background: #fff; }
.тл-работает-трек { position: absolute; top: 4px; z-index: 1; border-radius: 6px; background: transparent; padding: 1px 6px; white-space: nowrap; overflow: hidden; }
.тл-обр.выходной { background: #ececee; }
.тл-обр.офф { background: #52525b; border-color: #52525b; }
.тл-меню-кнопка { margin-left: auto; flex: none; background: none; border: 1px solid transparent; border-radius: 6px; padding: 3px 5px; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.тл-меню-кнопка:hover, .тл-меню-кнопка:focus-visible { border-color: #d4d4d8; color: var(--ink); }
.тл-тост.внимание { background: #92400e; }
.тл-переключ { display: flex; gap: 16px; margin: 4px 0 10px; }
.тл-переключ label { display: inline-flex; flex-direction: row; align-items: center; gap: 6px; font-size: 14px; color: var(--ink); }
.тл-переключ input { width: auto; margin: 0; }
