/* Палитра и кнопки — как в интерфейсе Битрикс24 (общие с остальными приложениями FRBS Labs) */
:root {
  --ground: #eef2f4;
  --surface: #fff;
  --ink: #333;
  --ink-2: #525c69;
  --muted: #6f7882;
  --line: #e4e8eb;
  --line-soft: #f0f2f4;
  --line-strong: #cfd5da;
  --chip-bg: #f5f7f8;
  --accent: #2fc6f6;
  --accent-dark: #11a9d9;
  --accent-soft: #e5f9ff;
  --link: #2067b0;
  --cta: #bbed21;
  --cta-hover: #d2f95f;
  --danger: #ff5752;
  --ok-bg: #f1fbd0; --ok-ink: #4f7d00;
  --err-bg: #ffe8e8; --err-ink: #d0312b;
  --info-bg: #e5f9ff; --info-ink: #0b8eb6;
  --warn-bg: #fff4d6; --warn-ink: #8a5a00; --warn-mark: #f5b400;
  --weekend: #f3f5f7;
  --holiday: #fdf0ef;
  --shadow: 0 1px 2px rgba(20, 24, 30, .06), 0 4px 14px rgba(20, 24, 30, .05);
  --shadow-up: 0 2px 4px rgba(20, 24, 30, .06), 0 10px 28px rgba(20, 24, 30, .12);
  --radius: 12px;
  --name-w: 230px;
  /* типы отсутствий: фон полосы, текст, насыщенный цвет */
  --t-vacation: #c8f1e2; --t-vacation-ink: #0b6b52; --t-vacation-mark: #1fbf8f;
  --t-unpaid: #ffe6ad; --t-unpaid-ink: #835400; --t-unpaid-mark: #f5a800;
  --t-sick: #ffd9d6; --t-sick-ink: #b02a22; --t-sick-mark: #ff6b61;
  --t-trip: #e1dcff; --t-trip-ink: #4a3db0; --t-trip-mark: #7f6ff0;
  --t-dayoff: #d5ecff; --t-dayoff-ink: #17599f; --t-dayoff-mark: #3d9bef;
  --t-other: #e4e8eb; --t-other-ink: #525c69; --t-other-mark: #a3acb5;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 14px/1.45 "Golos Text", "Open Sans", "Helvetica Neue", Arial, sans-serif; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--link); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); }
.error { color: var(--err-ink); }
.hint { font-size: 13px; color: var(--muted); margin: 0; }
.pad { padding: 24px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.grow { flex: 1; min-width: 0; }
.ico { display: inline-flex; flex: none; }
.ico svg { width: 1em; height: 1em; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
h1 { margin: 0; font-size: 22px; line-height: 1.2; font-weight: 600; }
h2 { margin: 0; font-size: 17px; font-weight: 600; }
h3 { margin: 0; font-size: 14px; font-weight: 600; }

/* ---------- каркас ---------- */
.app { max-width: 1600px; margin: 0 auto; padding: 14px clamp(10px, 2vw, 24px) 32px; display: flex; flex-direction: column; gap: 14px; }
.topbar { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; }
.topbar .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.seg { display: inline-flex; background: var(--surface); border-radius: 10px; padding: 3px; box-shadow: var(--shadow); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { border: 0; background: transparent; color: var(--ink-2); padding: 6px 13px; border-radius: 8px; white-space: nowrap; font-size: 13px; display: inline-flex; gap: 6px; align-items: center; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.seg.light button[aria-pressed="true"] { background: var(--accent-soft); color: var(--info-ink); }
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; }
.section { display: flex; flex-direction: column; gap: 12px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 18px; border-radius: 18px; border: 1px solid var(--line-strong);
  background: #fff; color: var(--ink-2); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; white-space: nowrap;
}
.btn:hover { border-color: #a8adb4; }
.btn:disabled { opacity: .45; cursor: default; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn-cta { background: var(--cta); border-color: var(--cta); color: var(--ink-2); }
.btn-cta:hover:not(:disabled) { background: var(--cta-hover); border-color: var(--cta-hover); }
.btn-danger { color: var(--err-ink); border-color: #f3b7b5; }
.btn-s { height: 30px; padding: 0 12px; border-radius: 15px; font-size: 11px; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--chip-bg); border-color: transparent; }
.btn .ico { font-size: 15px; }
.icon-btn { border: 0; background: transparent; color: var(--muted); width: 32px; height: 32px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-size: 18px; flex: none; }
.icon-btn:hover { background: var(--chip-bg); color: var(--ink); }
.x { border: 0; background: var(--chip-bg); color: var(--ink-2); border-radius: 50%; width: 30px; height: 30px; font-size: 17px; line-height: 1; flex: none; }
.x:hover { background: var(--ink-2); color: #fff; }
.input { width: 100%; min-height: 38px; padding: 7px 10px; font: inherit; font-size: 14px; color: inherit; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47, 198, 246, .15); }
select.input { width: auto; max-width: 100%; }
.input-s { min-height: 32px; padding: 4px 8px; font-size: 13px; }
.check { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; color: var(--ink-2); cursor: pointer; user-select: none; }
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 500; padding: 2px 9px; border-radius: 6px; white-space: nowrap; background: var(--chip-bg); color: var(--ink-2); }
.pill.warn { background: var(--warn-bg); color: var(--warn-ink); }
.pill.err { background: var(--err-bg); color: var(--err-ink); }
.note { border-radius: 10px; padding: 10px 14px; font-size: 13px; display: flex; flex-direction: column; gap: 6px; }
.note.warn { background: var(--warn-bg); color: var(--warn-ink); }
.note.ok { background: var(--ok-bg); color: var(--ok-ink); }
.note.err { background: var(--err-bg); color: var(--err-ink); }
.note.info { background: var(--info-bg); color: var(--info-ink); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #2f3640; color: #fff; padding: 10px 14px 10px 18px; border-radius: 10px; font-size: 14px; box-shadow: var(--shadow-up); z-index: 300; max-width: calc(100vw - 32px); display: flex; gap: 14px; align-items: center; }
.toast button { border: 0; background: transparent; color: var(--accent); font-weight: 600; padding: 2px 4px; }

/* ---------- верхняя полоса: сводка ---------- */
.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.stat { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 16px; display: flex; flex-direction: column; gap: 6px; min-height: 84px; }
.stat-label { font-size: 12px; color: var(--muted); }
.stat-value { font-size: 20px; font-weight: 600; line-height: 1.2; }
.stat-value small { font-size: 13px; color: var(--muted); font-weight: 400; }
.meter { height: 6px; border-radius: 3px; background: var(--line-soft); overflow: hidden; display: flex; }
.meter i { display: block; height: 100%; }
.faces { display: flex; align-items: center; gap: 0; flex-wrap: wrap; }
.faces .av { margin-right: -6px; border: 2px solid #fff; }
.faces .more { margin-left: 12px; font-size: 13px; color: var(--muted); }

/* ---------- аватар ---------- */
.av { width: 26px; height: 26px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 600; color: #fff; background: #9aa5b1 center/cover no-repeat; letter-spacing: .02em; }
.av-l { width: 34px; height: 34px; font-size: 12px; }

/* ---------- панель управления календарём ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: center; }
.period { display: flex; align-items: center; gap: 4px; }
.period-title { font-size: 17px; font-weight: 600; min-width: 170px; white-space: nowrap; border: 0; background: transparent; border-radius: 8px; padding: 5px 10px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.period-title:hover, .period-title[aria-expanded="true"] { background: var(--surface); box-shadow: var(--shadow); }
.pp-chev { font-size: 14px; color: var(--muted); transition: transform .15s; }
.period-title[aria-expanded="true"] .pp-chev { transform: rotate(180deg); }
.pp { position: relative; }
.pp-pop { position: absolute; z-index: 40; top: calc(100% + 6px); left: 0; width: 300px; background: #fff; border-radius: 12px;
  box-shadow: 0 10px 32px rgba(20, 24, 30, .18); padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.pp-head { display: flex; align-items: center; justify-content: space-between; }
.pp-head b { font-size: 15px; }
.pp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.pp-grid.quarter { grid-template-columns: repeat(2, 1fr); }
.pp-cell { border: 0; background: transparent; border-radius: 8px; padding: 9px 4px; font-size: 13px; color: var(--ink); position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.pp-cell small { font-size: 11px; color: var(--muted); }
.pp-cell:hover { background: var(--chip-bg); }
.pp-cell.now::after { content: ""; position: absolute; bottom: 4px; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--accent); }
.pp-cell.on { background: var(--accent); color: #fff; font-weight: 600; }
.pp-cell.on small { color: #e6f8ff; }
.pp-cell.on.now::after { background: #fff; }
.pp-today { border: 0; background: transparent; color: var(--link); font-size: 13px; padding: 4px; border-top: 1px solid var(--line-soft); }
.pp-today:hover { text-decoration: underline; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-left: auto; }
.search { position: relative; }
.search .input { padding-left: 30px; width: 200px; }
.search .ico { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 15px; }

/* ---------- шкала ---------- */
.tl { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; position: relative; user-select: none; }
.tl-head { display: grid; grid-template-columns: var(--name-w) 1fr; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 5; }
/* внутри Битрикс24 шапку двигает followHead: sticky во фрейме, растущем по содержимому, не работает */
.tl-head.follow { position: relative; will-change: transform; }
.tl-head.floating { box-shadow: 0 6px 14px rgba(20, 24, 30, .10); border-radius: 0; }
.follow-marks { position: absolute; inset: 0; pointer-events: none; visibility: hidden; }
.follow-marks i { position: absolute; left: 0; width: 1px; }
.tl-corner { padding: 8px 12px; font-size: 12px; color: var(--muted); display: flex; align-items: flex-end; border-right: 1px solid var(--line); }
.tl-scale { position: relative; height: 46px; }
.tl-cell { position: absolute; top: 0; bottom: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 12px; color: var(--ink-2); line-height: 1.15; border-left: 1px solid var(--line-soft); overflow: hidden; }
.tl-cell small { font-size: 10px; color: var(--muted); text-transform: lowercase; }
.tl-cell.we { color: var(--err-ink); }
.tl-cell.we small { color: #e48b87; }
.tl-cell.today { background: var(--accent); color: #fff; border-radius: 6px; margin: 4px 1px; top: 0; bottom: 0; }
.tl-cell.today small { color: #e6f8ff; }
.tl-cell.month { align-items: flex-start; padding-left: 8px; font-weight: 600; color: var(--ink); border-left-color: var(--line); }
.tl-cell.month small { font-weight: 400; }
.tl-cell.week { font-size: 10px; color: var(--muted); justify-content: flex-end; padding-bottom: 4px; }
.tl-body { position: relative; }
.tl-bg { position: absolute; top: 0; bottom: 0; left: var(--name-w); right: 0; pointer-events: none; z-index: 0; }
.tl-bg i { position: absolute; top: 0; bottom: 0; }
.tl-bg .we { background: var(--weekend); }
.tl-bg .hol { background: var(--holiday); }
.tl-bg .sep { border-left: 1px solid var(--line); }
.tl-bg .now { width: 2px; background: var(--accent); z-index: 3; }
.tl-bg .dl { border-left: 1px solid #eef1f3; }
.tl-bg .wk { border-left: 1px solid #dde3e8; }
.tl-bg .todaycol { background: rgba(47, 198, 246, .10); box-shadow: inset 1px 0 0 rgba(47, 198, 246, .45), inset -1px 0 0 rgba(47, 198, 246, .45); }
.tl-bg .hcol { background: rgba(32, 103, 176, .06); z-index: 1; }
.tl-cell.hov:not(.today) { background: #e8f1fa; border-radius: 6px; margin: 4px 1px; color: var(--link); }
.tl-group { display: grid; grid-template-columns: var(--name-w) 1fr; position: relative; z-index: 1; border-top: 1px solid var(--line); }
.tl-group:first-child { border-top: 0; }
.tl-ghead { grid-column: 1 / -1; display: grid; grid-template-columns: var(--name-w) 1fr; background: rgba(246, 248, 250, .94); border-bottom: 1px solid var(--line); position: relative; z-index: 2; }
.tl-gname { display: flex; align-items: center; gap: 6px; padding: 6px 12px; font-size: 13px; font-weight: 600; color: var(--ink-2); border: 0; background: transparent; text-align: left; border-right: 1px solid var(--line); min-width: 0; }
.tl-gname .chev { transition: transform .15s; color: var(--muted); font-size: 13px; }
.tl-group.closed .chev { transform: rotate(-90deg); }
.tl-gname .cnt { color: var(--muted); font-weight: 400; }
.tl-gname span.nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-load { position: relative; height: 30px; }
.tl-load i { position: absolute; top: 5px; bottom: 5px; display: flex; align-items: center; justify-content: center; font-size: 11px; font-style: normal; font-weight: 600; border-radius: 4px; }
.tl-load i { opacity: .9; }
.tl-row { display: contents; }
.tl-name { display: flex; align-items: center; gap: 8px; padding: 0 12px; height: 40px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line-soft); min-width: 0; background: var(--surface); }
.tl-name .who { min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.tl-name .who b { font-weight: 500; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-name .who span { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-name .used { margin-left: auto; font-size: 11px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tl-name .used.over { color: var(--err-ink); font-weight: 600; }
.tl-name.me { box-shadow: inset 3px 0 0 var(--accent); }
.tl-track { position: relative; height: 40px; border-bottom: 1px solid var(--line-soft); }
.tl-track.can { cursor: pointer; }
.addhint { position: absolute; top: 6px; height: 28px; padding: 0 2px; display: flex; align-items: center; justify-content: center; pointer-events: none; z-index: 1; }
.addhint::before { content: ""; position: absolute; inset: 0 2px; border-radius: 7px; border: 1.5px dashed rgba(17, 169, 217, .55); background: rgba(47, 198, 246, .10); }
.addhint .ico { position: relative; font-size: 14px; color: var(--accent-dark); }
.tl-track:hover { background: rgba(32, 103, 176, .035); }
.tl-group.closed .tl-row { display: none; }
.bar { position: absolute; top: 6px; height: 28px; border-radius: 7px; display: flex; align-items: center; gap: 5px; padding: 0 8px; font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden; z-index: 2; box-shadow: inset 3px 0 0 var(--mark); background: var(--bg); color: var(--ink-c); }
.bar.edit { cursor: grab; }
.bar.edit:hover { filter: brightness(.97); box-shadow: inset 3px 0 0 var(--mark), 0 2px 8px rgba(20, 24, 30, .14); }
.bar.drag { cursor: grabbing; opacity: .85; box-shadow: 0 4px 14px rgba(20, 24, 30, .2); z-index: 4; }
.bar.narrow { padding: 0; justify-content: center; }
.bar.hr { background-image: repeating-linear-gradient(135deg, transparent 0 6px, rgba(255, 255, 255, .55) 6px 9px); }
.bar.pending { opacity: .7; }
.bar.err { outline: 2px solid var(--danger); outline-offset: -2px; }
.bar .grip { position: absolute; top: 0; bottom: 0; width: 8px; cursor: ew-resize; }
.bar .grip.l { left: 0; }
.bar .grip.r { right: 0; }
.bar .t { overflow: hidden; text-overflow: ellipsis; }
.bar .d { opacity: .75; font-weight: 400; }
.ghost { position: absolute; top: 6px; height: 28px; border-radius: 7px; background: rgba(47, 198, 246, .25); border: 1.5px dashed var(--accent); z-index: 3; pointer-events: none; font-size: 11px; color: var(--info-ink); display: flex; align-items: center; padding: 0 6px; white-space: nowrap; }
.tl-empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.tl-foot { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; font-size: 12px; color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; background: var(--bg); box-shadow: inset 3px 0 0 var(--mark); }
.legend i.hr { background-image: repeating-linear-gradient(135deg, var(--t-other) 0 3px, #fff 3px 5px); box-shadow: none; }
.syncline { margin-left: auto; display: inline-flex; gap: 6px; align-items: center; }
.syncline.err { color: var(--err-ink); }
.sync-note { flex-basis: 100%; display: flex; gap: 8px; align-items: center; background: var(--info-bg); color: var(--info-ink); border-radius: 8px; padding: 7px 12px; font-size: 12px; }
.sync-note .ico { font-size: 15px; }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* подсказка над полосой */
.tip { position: fixed; z-index: 250; background: #2f3640; color: #fff; border-radius: 10px; padding: 10px 12px; font-size: 12px; line-height: 1.45; max-width: 300px; pointer-events: none; box-shadow: var(--shadow-up); }
.tip b { font-size: 13px; display: block; }
.tip .warn { color: #ffcf6b; }

/* ---------- список ---------- */
.list { display: flex; flex-direction: column; gap: 14px; }
.list-month h3 { margin: 0 0 6px; color: var(--ink-2); font-size: 13px; text-transform: uppercase; letter-spacing: .05em; }
.list-table { width: 100%; table-layout: fixed; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.list-table td { padding: 9px 12px; border-top: 1px solid var(--line-soft); font-size: 13px; vertical-align: middle; }
.list-table tr:first-child td { border-top: 0; }
.list-table tr.click { cursor: pointer; }
.list-table tr.click:hover td { background: #fafbfc; }
.list-table .person { display: flex; align-items: center; gap: 10px; min-width: 200px; }
.list-table .person span { display: block; font-size: 11px; color: var(--muted); }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 6px; font-size: 12px; font-weight: 500; background: var(--bg); color: var(--ink-c); white-space: nowrap; }
.tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--mark); }
.list-table .dates { white-space: nowrap; font-variant-numeric: tabular-nums; }
.list-table .days { color: var(--muted); white-space: nowrap; text-align: right; }
.now-pill { background: var(--accent-soft); color: var(--info-ink); }

/* ---------- сводка по сотрудникам ---------- */
.people-wrap { overflow-x: auto; border-radius: var(--radius); box-shadow: var(--shadow); }
.people-table { table-layout: auto; box-shadow: none; }
.people-table th { padding: 10px 12px; font-size: 12px; font-weight: 500; color: var(--muted); text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line); cursor: pointer; user-select: none; position: sticky; top: 0; background: var(--surface); }
.people-table th.left { text-align: left; }
.people-table th:hover, .people-table th.sorted { color: var(--ink); }
.people-table tbody tr:first-child td { border-top: 0; }
.people-table tbody tr:hover td { background: #fafbfc; }
.people-table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.people-table td.zero { color: #b5bbc2; }
.people-table td.over, .people-table .vac-num.over b { color: var(--danger); }
.people-table .vac-col { min-width: 130px; }
.people-table .vac-num { font-variant-numeric: tabular-nums; margin-bottom: 4px; }
.people-table .vac-num b { font-size: 15px; }
.people-table .vac-num small { color: var(--muted); }
.people-table .meter { height: 5px; }
.people-table .next-link { color: inherit; text-decoration: none; white-space: nowrap; }
.people-table .next-link:hover { color: var(--accent); }
.year-nav button { min-width: 30px; justify-content: center; }
.stat-foot { display: flex; justify-content: space-between; gap: 8px; }
.stat-foot a { white-space: nowrap; }
@media (max-width: 1100px) { .people-table .opt2 { display: none; } }
@media (max-width: 860px) { .people-table .opt { display: none; } }

/* ---------- окно отпуска ---------- */
.overlay { position: fixed; inset: 0; background: rgba(20, 24, 30, .45); display: flex; justify-content: center; align-items: flex-start; padding: 24px 12px; overflow-y: auto; z-index: 100; }
.modal { position: relative; background: var(--surface); border-radius: 16px; box-shadow: 0 12px 40px rgba(20, 24, 30, .25); width: 100%; max-width: 720px; display: flex; flex-direction: column; }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px 6px; }
.modal-head h2 { flex: 1; }
.modal-body { padding: 10px 20px 4px; display: flex; flex-direction: column; gap: 16px; }
.modal-foot { display: flex; gap: 8px; align-items: center; padding: 16px 20px 18px; flex-wrap: wrap; }
.modal-foot .right { margin-left: auto; display: flex; gap: 8px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .field > .label { font-size: 12px; color: var(--muted); }
.types { display: flex; flex-wrap: wrap; gap: 6px; }
.types button { border: 1px solid var(--line-strong); background: #fff; border-radius: 16px; padding: 5px 12px 5px 10px; font-size: 13px; display: inline-flex; gap: 7px; align-items: center; color: var(--ink-2); }
.types button::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--mark); }
.types button[aria-pressed="true"] { background: var(--bg); border-color: var(--mark); color: var(--ink-c); font-weight: 500; }
.picker { position: relative; }
.picker-list { position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; right: 0; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 28px rgba(20, 24, 30, .14); max-height: 260px; overflow-y: auto; padding: 4px; }
.picker-list button { display: flex; width: 100%; align-items: center; gap: 10px; border: 0; background: transparent; padding: 6px 8px; border-radius: 8px; text-align: left; }
.picker-list button:hover, .picker-list button.on { background: var(--accent-soft); }
.picker-list small { display: block; color: var(--muted); font-size: 11px; }
.person-chip { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; }
.person-chip small { display: block; color: var(--muted); font-size: 12px; }
.person-chip.btnlike { cursor: pointer; }
.person-chip.btnlike:hover { border-color: var(--accent); }

.range { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; position: relative; }
.range-nav { position: absolute; top: -2px; left: 0; right: 0; display: flex; justify-content: space-between; pointer-events: none; }
.range-nav button { pointer-events: auto; }
.mon h4 { margin: 0 0 6px; text-align: center; font-size: 14px; font-weight: 600; line-height: 30px; }
.mon-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px 0; }
.mon-grid .wd { font-size: 11px; color: var(--muted); text-align: center; padding-bottom: 2px; }
.mon-grid .wd.we { color: #e48b87; }
.day { height: 34px; border: 0; background: transparent; font-size: 13px; position: relative; display: flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; }
.day.we { color: var(--err-ink); }
.day.hol::after { content: ""; position: absolute; bottom: 4px; width: 4px; height: 4px; border-radius: 50%; background: var(--danger); }
.day.today { font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.day.in { background: var(--accent-soft); }
.day.edge { background: var(--accent); color: #fff; border-radius: 8px; z-index: 1; }
.day.edge.s { border-radius: 8px 0 0 8px; }
.day.edge.e { border-radius: 0 8px 8px 0; }
.day.edge.s.e { border-radius: 8px; }
.day.busy::before { content: ""; position: absolute; top: 4px; right: 6px; width: 5px; height: 5px; border-radius: 50%; background: var(--warn-mark); }
.day.own { box-shadow: inset 0 -3px 0 var(--t-vacation-mark); }
.day:hover:not(.edge) { background: var(--chip-bg); border-radius: 8px; }
.day.in:hover { background: #cdf1fd; border-radius: 0; }
.day.edge:hover, .day.edge.in:hover { background: var(--accent-dark); border-radius: 8px; }
.dates-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.dates-row .input { width: 160px; }
.dates-hint { min-height: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.count { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; font-size: 13px; color: var(--ink-2); }
.count b { font-size: 18px; color: var(--ink); }
.ro { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }

@media (max-width: 760px) {
  :root { --name-w: 132px; }
  .tl-name .who span, .tl-name .used { display: none; }
  .tl-name .av { display: none; }
  .range { grid-template-columns: 1fr; }
  .range .mon:nth-child(3) { display: none; }
  .filters { margin-left: 0; }
  .search .input { width: 150px; }
}

/* ---------- знакомство ---------- */
.eyebrow { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.tour-tab { position: fixed; right: 0; top: 96px; z-index: 5; writing-mode: vertical-rl; transform: rotate(180deg); border: 0; border-radius: 0 8px 8px 0;
  background: var(--accent); color: #fff; padding: 12px 5px; font-size: 13px; box-shadow: var(--shadow); }
.tour-tab:hover { background: var(--accent-dark); }
@media (max-width: 700px) { .tour-tab { display: none; } }
.ob-overlay { position: fixed; inset: 0; background: rgba(20, 24, 30, .45); display: flex; justify-content: center; align-items: flex-start; padding: 24px 16px; overflow-y: auto; z-index: 100; }
.ob { position: relative; background: var(--surface); border-radius: 16px; box-shadow: 0 12px 40px rgba(20, 24, 30, .25); width: 100%; max-width: 760px; overflow: hidden; }
.ob-x { position: absolute; top: 10px; right: 10px; background: rgba(255, 255, 255, .9); z-index: 1; }
.ob-pic { background: var(--ground); border-bottom: 1px solid var(--line); height: 300px; overflow: hidden; display: flex; align-items: flex-start; justify-content: center; }
.ob-pic img { width: 100%; height: auto; display: block; }
.ob-pic.fit { height: auto; padding: 16px 16px 0; }
.ob-pic.fit img { border-radius: 10px 10px 0 0; border: 1px solid var(--line-strong); border-bottom: 0; box-shadow: var(--shadow); }
.ob-body { padding: 18px 24px 20px; display: flex; flex-direction: column; gap: 8px; }
.ob-body h2 { font-size: 20px; }
.ob-body p { margin: 0; color: var(--ink-2); }
.ob-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.ob-dots { display: flex; gap: 6px; }
.ob-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); }
.ob-dots i.on { background: var(--accent); width: 22px; border-radius: 4px; }
.ob-skip { border-color: transparent; color: var(--muted); }

/* «Только отсутствующие» — кнопка-переключатель */
.toggle-chip { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border-radius: 16px; border: 1px solid var(--line-strong);
  background: #fff; color: var(--ink-2); font-size: 13px; font-weight: 500; white-space: nowrap; }
.toggle-chip:hover { border-color: var(--accent); color: var(--ink); }
.toggle-chip .ico { font-size: 15px; color: var(--accent-dark); }
.toggle-chip .cnt { background: var(--chip-bg); color: var(--muted); border-radius: 9px; padding: 0 7px; font-size: 11px; line-height: 18px; font-weight: 600; }
.toggle-chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.toggle-chip[aria-pressed="true"] .ico { color: #fff; }
.toggle-chip[aria-pressed="true"] .cnt { background: rgba(255, 255, 255, .25); color: #fff; }

/* выбор отделов */
.dp { position: relative; }
.dp-btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; max-width: 240px; padding: 0 10px 0 12px; border-radius: 8px; border: 1px solid var(--line-strong);
  background: #fff; font-size: 13px; color: var(--ink); }
.dp-btn:hover, .dp-btn[aria-expanded="true"] { border-color: var(--accent); }
.dp-btn.on { border-color: var(--accent); background: var(--accent-soft); color: var(--info-ink); font-weight: 500; }
.dp-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dp-pop { position: absolute; z-index: 40; top: calc(100% + 6px); right: 0; width: 360px; max-width: calc(100vw - 24px); background: #fff; border-radius: 12px;
  box-shadow: 0 10px 32px rgba(20, 24, 30, .18); padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.dp-list { max-height: 340px; overflow-y: auto; margin: 0 -4px; }
.dp-row { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 8px; font-size: 13px; cursor: pointer; }
.dp-row:hover { background: var(--chip-bg); }
.dp-row.inh { color: var(--muted); }
.dp-row input { flex: none; accent-color: var(--accent-dark); }
.dp-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dp-n { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.dp-foot { display: flex; align-items: center; gap: 6px; border-top: 1px solid var(--line-soft); padding-top: 8px; }
.dp-foot .hint { margin-right: auto; }

/* графики работы */
.offday { position: absolute; top: 0; bottom: 0; pointer-events: none; z-index: 1;
  background: repeating-linear-gradient(135deg, rgba(82, 92, 105, .11) 0 3px, transparent 3px 7px); }
.sched-badge { flex: none; font-size: 10px; font-weight: 600; color: var(--ink-2); background: var(--chip-bg); border: 1px solid var(--line); border-radius: 6px; padding: 0 5px; line-height: 16px; max-width: 64px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-name .used { margin-left: 4px; }
.tl-name .sched-badge { margin-left: auto; }
.sched-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 12px; }
.sched-card { display: flex; flex-direction: column; gap: 10px; cursor: pointer; }
.sched-card:hover { box-shadow: var(--shadow-up); }
.sched-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sched-top b { font-size: 15px; margin-right: 4px; }
.sched-targets { display: flex; flex-wrap: wrap; gap: 6px; }
.tchip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px 2px 3px; border-radius: 14px; background: var(--chip-bg); font-size: 12px; max-width: 260px; }
.tchip .av { width: 20px; height: 20px; font-size: 8px; }
.tchip > .ico { width: 20px; justify-content: center; color: var(--accent-dark); }
.tchip-x { border: 0; background: transparent; color: var(--muted); font-size: 15px; line-height: 1; padding: 0 0 0 2px; }
.tchip-x:hover { color: var(--err-ink); }
.wstrip { display: grid; grid-template-columns: repeat(14, 1fr); gap: 3px; }
.ws-day { display: flex; flex-direction: column; align-items: center; padding: 3px 0; border-radius: 6px; font-size: 11px; line-height: 1.15; color: var(--muted);
  background: repeating-linear-gradient(135deg, rgba(82, 92, 105, .10) 0 3px, transparent 3px 7px); }
.ws-day b { font-weight: 600; font-size: 12px; }
.ws-day small { font-size: 9px; }
.ws-day.on { background: var(--t-vacation); color: var(--t-vacation-ink); }
.ws-day.today { box-shadow: inset 0 0 0 1.5px var(--accent); }

/* «Кому» в графике: список отделов и сотрудников под полем */
.tp-wrap { display: flex; flex-direction: column; gap: 6px; }
.tp-list { border: 1px solid var(--line); border-radius: 10px; max-height: 300px; overflow-y: auto; padding: 4px; background: #fff; }
.tp-sec { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 8px 10px 4px; }
.tp-list .dp-row .ico { color: var(--accent-dark); }
.tp-list .dp-row .av { width: 22px; height: 22px; font-size: 9px; }
.tp-list .dp-name small { display: block; font-size: 11px; color: var(--muted); }

/* выбор времени — как в «Регулярных задачах» и «Массовом запуске БП» */
.ms { position: relative; }
.ms > summary { list-style: none; cursor: pointer; background: #fff; border: 1px solid var(--line-strong); border-radius: 8px;
  padding: 5px 30px 5px 10px; min-height: 32px; white-space: nowrap; position: relative; }
.ms > summary::-webkit-details-marker { display: none; }
.ms > summary::after { content: ""; position: absolute; right: 12px; top: 50%; width: 6px; height: 6px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: translateY(-70%) rotate(45deg); }
.ms[open] > summary { border-color: var(--accent); }
.opts { position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 12px; box-shadow: 0 8px 28px rgba(20, 24, 30, .14); display: flex; flex-direction: column; gap: 6px; }
.tp > summary { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); min-width: 92px; }
.tp-pop { width: 300px; }
.tp-quick { display: flex; gap: 6px; flex-wrap: wrap; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.tp-chip { border: 1px solid var(--line-strong); background: #fff; border-radius: 14px; padding: 4px 10px; font-size: 13px; font-variant-numeric: tabular-nums; }
.tp-chip:hover { border-color: var(--accent); }
.tp-label { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-top: 4px; }
.tp-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.tp-cell { border: 0; background: var(--chip-bg); border-radius: 6px; padding: 7px 0; font-size: 14px; font-variant-numeric: tabular-nums; }
.tp-cell:hover { background: var(--info-bg); }
.tp-cell[aria-pressed="true"] { background: var(--accent); color: #fff; }

/* смены по графику в строке сотрудника */
.shift { position: absolute; top: 8px; bottom: 8px; padding: 0 2px; pointer-events: none; z-index: 1; display: flex; }
.shift span { flex: 1; min-width: 0; border-radius: 6px; background: rgba(47, 198, 246, .14); box-shadow: inset 0 0 0 1px rgba(17, 169, 217, .22);
  color: var(--info-ink); font-size: 10px; font-weight: 600; font-style: normal; display: flex; align-items: center; justify-content: center; overflow: hidden; white-space: nowrap; }
.shift.wide { top: 12px; bottom: 12px; border-radius: 5px; background: rgba(47, 198, 246, .16); box-shadow: inset 0 0 0 1px rgba(17, 169, 217, .2); padding: 0; margin-left: 1px; }
.legend i.lg-shift { background: rgba(47, 198, 246, .16); box-shadow: inset 0 0 0 1px rgba(17, 169, 217, .3); }
.legend i.lg-off { background: repeating-linear-gradient(135deg, rgba(82, 92, 105, .25) 0 2px, #fff 2px 4px); box-shadow: none; }

/* «Внести отпуск» и под ней «Внести график» — одной ширины */
.topbar .right.add-col { flex-direction: column; align-items: stretch; gap: 6px; }
.btn-add2 { border-color: var(--accent); color: var(--accent-dark); background: #fff; }
.btn-add2:hover { background: var(--accent-soft); border-color: var(--accent-dark); }

/* период графика */
.seg.wrap { flex-wrap: wrap; overflow: visible; }
.ws-day.out { opacity: .35; background: none; }
.shift.temp span { background: rgba(127, 111, 240, .14); box-shadow: inset 0 0 0 1px rgba(127, 111, 240, .3); color: var(--t-trip-ink); }

/* сохранение настроек — как в других приложениях */
.savebar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.save-status { font-size: 13px; color: var(--muted); }
.save-status.ok { color: var(--ok-ink); }
.save-status.err { color: var(--err-ink); }
.card-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
