:root {
  --bg: #eef2f4;
  --panel: #fff;
  --border: #c6cdd3;
  --line: #edeef0;
  --text: #333;
  --muted: #828b95;
  --head: #525c69;
  --link: #2067b0;
  --accent: #2fc6f6;
  --accent-dark: #11a9d9;
  --bx-search: rgba(47, 30, 78, .55);
  --bx-search-border: rgba(255,255,255,.18);
  --ok: #3f6b00;
  --ok-bg: #eaf7d8;
  --danger: #ff5752;
  --danger-bg: #ffe8e7;
  --warn-bg: #fff4e5;
  --warn: #b86e00;
  --info-bg: #e8f6fc;
  --shadow: 0 12px 40px rgba(33, 43, 54, .22);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font: 14px/1.45 "Helvetica Neue", Arial, Helvetica, sans-serif;
  color: var(--text);
  background: var(--bg);
}
body.wide-mode {
  background: #d5dbe3;
}

.top {
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 10px 20px;
  position: sticky; top: 0; z-index: 40;
}
.brand { font-size: 16px; font-weight: 500; color: var(--head); }
.sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.back { color: var(--link); text-decoration: none; font-size: 12px; display: inline-block; margin-bottom: 2px; }

.wrap {
  padding: 12px 16px 32px;
  max-width: 960px;
  margin: 0 auto;
  width: 100%;
}
body.wide-mode .wrap {
  max-width: none;
  margin: 0;
  padding: 0 0 28px;
}
body.wide-mode .stepbar {
  padding-left: 20px;
  padding-right: 20px;
}
body.wide-mode .panel[data-step="2"] {
  padding: 12px 20px 0;
  max-width: none;
  width: 100%;
}

/* Status bars instead of circles */
.stepbar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 12px 16px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.stepbar-item { min-width: 0; }
.stepbar-track {
  height: 4px;
  border-radius: 999px;
  background: #e0e4e8;
  overflow: hidden;
  margin-bottom: 6px;
}
.stepbar-track i {
  display: block;
  height: 100%;
  width: 0;
  background: #c6cdd3;
  border-radius: 999px;
  transition: width .25s ease, background .2s ease;
}
.stepbar-item.done .stepbar-track i,
.stepbar-item.on .stepbar-track i {
  width: 100%;
  background: var(--accent);
}
.stepbar-item.on .stepbar-label { color: var(--head); font-weight: 600; }
.stepbar-label {
  display: block;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lead { color: var(--muted); margin: 0 0 14px; font-size: 13px; }
.lbl.req::after { content: " *"; color: var(--danger); font-weight: 700; }

.group { margin: 0 0 22px; }
.group h2 {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}

/* BP tiles */
.bp-tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 4px;
}
.bp-tile {
  text-align: left;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 12px;
  padding: 14px 14px 12px;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: border-color .15s, box-shadow .15s, background .15s;
  min-height: 108px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.bp-tile:hover {
  border-color: #9edfeb;
  box-shadow: 0 4px 14px rgba(47,198,246,.12);
}
.bp-tile.on {
  border-color: var(--accent);
  background: #f3fbfe;
  box-shadow: inset 0 0 0 1px var(--accent);
}
.bp-tile-ico {
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 700; color: #fff;
  background: #535c69;
}
.bp-tile-ico.permanent { background: #2fc6f6; }
.bp-tile-ico.substitution { background: #ffa900; color: #333; }
.bp-tile-ico.one_off { background: #55d0e0; color: #0f4a52; }
.bp-tile-title { font-size: 15px; font-weight: 600; color: var(--head); }
.bp-tile-desc { font-size: 12px; color: var(--muted); line-height: 1.35; }

/* Total FM / Hub process cards — shared look */
.process-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  margin: 4px 0 8px;
  align-items: stretch;
}
.process-card {
  display: grid;
  grid-template-columns: 44px 1fr 18px;
  gap: 12px;
  align-items: center;
  text-align: left;
  border: 1px solid #dfe3e8;
  background: #fff;
  border-radius: 10px;
  padding: 14px 12px;
  cursor: pointer;
  font: inherit;
  color: inherit;
  min-height: 88px;
  box-shadow: 0 1px 2px rgba(33,43,54,.06);
  transition: border-color .15s, box-shadow .15s, transform .15s;
  position: relative;
  overflow: hidden;
}
.process-card::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: #c6cdd3;
}
.process-card:hover {
  border-color: #b9e3f3;
  box-shadow: 0 6px 18px rgba(32,103,176,.10);
  transform: translateY(-1px);
}
.process-card.on {
  border-color: #2fc6f6;
  background: #f7fcfe;
  box-shadow: 0 0 0 1px rgba(47,198,246,.35);
}
.process-card.on::before { background: #2fc6f6; }
.process-card-ico {
  width: 44px; height: 44px; min-width: 44px; max-width: 44px;
  border-radius: 12px;
  display: grid; place-items: center;
  color: #fff; background: #535c69;
  font-size: 15px; font-weight: 700;
  overflow: hidden; flex: 0 0 44px;
}
.process-card-ico svg {
  width: 22px !important; height: 22px !important;
  max-width: 22px !important; max-height: 22px !important;
  fill: currentColor; display: block;
}
.process-card-ico.permanent { background: #2fc6f6; }
.process-card-ico.substitution { background: #ffa900; color: #333; }
.process-card-ico.one_off { background: #00c2d0; }
.process-card-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.process-card-title {
  font-size: 15px; font-weight: 600; color: #333;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.process-card-sub { font-size: 12px; color: #828b95; line-height: 1.35; }
.process-card-go { color: #a8adb4; font-size: 22px; line-height: 1; }
.process-card.on .process-card-go { color: #11a9d9; }
a.process-card { text-decoration: none; color: inherit; }
.process-card.is-disabled { opacity: .55; pointer-events: none; cursor: default; }

.format-next {
  display: flex; align-items: flex-start; gap: 10px;
  margin: 12px 0 16px;
  padding: 12px 14px;
  background: #e8f7fc;
  border: 1px solid #9edfeb;
  border-radius: 10px;
  color: #134a63;
  font-size: 14px;
  line-height: 1.4;
}
.format-next.on {
  background: #dff6fd;
  border-color: #2fc6f6;
  box-shadow: 0 0 0 1px rgba(47,198,246,.2);
}
.format-next-k {
  flex: 0 0 auto;
  font-size: 11px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: #11a9d9;
  background: #fff; border-radius: 4px; padding: 3px 7px;
  margin-top: 1px;
}
.format-next-v { font-weight: 600; color: #1f3a4d; }

.obj-open-btn {
  width: 100%;
  display: grid;
  grid-template-columns: 36px 1fr 18px;
  gap: 10px; align-items: center;
  text-align: left;
  border: 1px solid #c6cdd3;
  background: #fff;
  border-radius: 10px;
  padding: 12px 12px;
  font: inherit;
  cursor: pointer;
  color: var(--text);
}
.obj-open-btn:hover { border-color: #66afe9; box-shadow: 0 0 0 1px rgba(47,198,246,.2); }
.obj-open-ico {
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center;
  background: #f0f3f5; color: #525c69; font-size: 16px;
}
.obj-open-text { font-weight: 600; color: var(--head); }
.obj-open-go { color: #a8adb4; font-size: 22px; }

body.picker-open { overflow: hidden; }
.obj-picker {
  position: fixed; inset: 0; z-index: 90;
  display: flex; justify-content: flex-end;
}
.obj-picker.hidden { display: none !important; }
.obj-picker-backdrop {
  position: absolute; inset: 0;
  background: rgba(33, 43, 54, .45);
}
.obj-picker-panel {
  position: relative; z-index: 1;
  width: min(520px, 100vw);
  height: 100%;
  background: #fff;
  box-shadow: -8px 0 28px rgba(33,43,54,.18);
  display: flex; flex-direction: column;
  border-radius: 16px 0 0 16px;
  overflow: hidden;
  animation: objSlide .18s ease-out;
}
@keyframes objSlide {
  from { transform: translateX(24px); opacity: .6; }
  to { transform: translateX(0); opacity: 1; }
}
.obj-picker-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; padding: 16px 16px 10px; border-bottom: 1px solid var(--line);
}
.obj-picker-title { font-size: 16px; font-weight: 700; color: var(--head); }
.obj-picker-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.obj-picker-close {
  border: 0; background: #f0f3f5; width: 32px; height: 32px;
  border-radius: 8px; font-size: 20px; cursor: pointer; color: #525c69;
}
.obj-picker-search {
  padding: 12px 16px; border-bottom: 1px solid var(--line);
  position: relative; z-index: 4; overflow: visible;
}
.obj-filter-panel {
  position: absolute;
  left: 16px; right: 16px; top: 60px;
  z-index: 6;
  margin-top: 0;
  padding: 12px;
  background: #fff;
  border: 1px solid #d5dbe0;
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(33,43,54,.16);
}
.obj-picker-list {
  flex: 1; overflow: auto; padding: 8px 12px 20px;
  -webkit-overflow-scrolling: touch;
}
.obj-picker-list .card-item { margin-bottom: 6px; }

.block-label {
  margin: 4px 0 8px;
  font-size: 12px; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase;
  color: var(--muted);
}
.foot-block-label {
  grid-area: label; margin: 0;
}
.format-badge {
  margin-left: auto;
  font-size: 12px; font-weight: 700;
  color: #0f5f78; background: #e8f7fc;
  border: 1px solid #b9e3f3;
  border-radius: 999px; padding: 4px 10px;
  white-space: nowrap;
}
.text-action {
  border: 0; background: transparent; color: var(--link);
  font: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; padding: 4px 2px;
}
.text-action:hover { text-decoration: underline; }

.emp-stack {
  display: flex; flex-direction: row; flex-wrap: nowrap;
  gap: 6px; align-items: center;
  max-width: 280px; overflow: hidden;
}
.emp-pill {
  display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
  min-width: 72px; max-width: 120px;
  border-radius: 8px; padding: 6px 8px;
  font-size: 11px; font-weight: 700; line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.emp-pill.filled {
  background: #eef5ff; color: #1e4b8f; border: 1px solid #c9daf8;
}
.emp-pill.vacant {
  background: #fff7f7; color: #b42318;
  border: 1px dashed #f3b0aa;
}

.done-panel { text-align: center; max-width: 520px; margin: 0 auto; }
.success-mark {
  width: 72px; height: 72px; margin: 8px auto 12px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: #eaf7d8; color: #3f6b00;
  font-size: 36px; font-weight: 700;
  box-shadow: inset 0 0 0 2px #c5dfa0;
}
.done-card {
  width: 100%; text-align: left;
  border: 1px solid #d5dbe0; background: #fff;
  border-radius: 12px; padding: 16px;
  cursor: pointer; font: inherit; color: inherit;
  box-shadow: 0 2px 8px rgba(33,43,54,.06);
  margin: 8px 0 16px;
}
.done-card:hover { border-color: #2fc6f6; box-shadow: 0 0 0 1px rgba(47,198,246,.25); }
.done-card-k { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.done-card-title { font-size: 16px; font-weight: 700; color: var(--link); margin-top: 4px; }
.done-card-meta { font-size: 12px; color: var(--muted); margin-top: 6px; }
.done-actions {
  display: grid; grid-template-columns: 1fr; gap: 8px;
}
.done-actions .btn { margin: 0; width: 100%; }
.btn.text {
  background: transparent !important;
  color: #a8adb4 !important;
  font-weight: 500;
  box-shadow: none;
}
.btn.text:hover {
  background: transparent !important;
  color: var(--link) !important;
  text-decoration: underline;
}

.hint-callout {
  margin: 10px 0 8px;
  padding: 12px 14px;
  background: #eef7fb;
  border: 1px solid #b9e3f3;
  border-left: 4px solid #2fc6f6;
  border-radius: 8px;
  color: #1f3a4d;
  font-size: 13px;
  line-height: 1.4;
}
.hint-callout.ok {
  background: #eaf7d8;
  border-color: #c5dfa0;
  border-left-color: #7db82e;
  color: #2f4a0d;
}

.kb-help-link,
.portal-body a.kb-help-link {
  color: #2fc6f6;
  text-decoration: none;
  font-weight: 500;
}
.kb-help-link:hover { text-decoration: underline; }

.kb-callout {
  margin: 0.75rem 0 1rem;
  padding: 0.75rem 0.9rem;
  border-left: 3px solid #2fc6f6;
  background: #f0fbff;
  border-radius: 0 8px 8px 0;
  font-size: 0.875rem;
  line-height: 1.45;
}

.kb-catalog {
  display: grid;
  gap: 0.75rem;
}
.kb-card {
  display: block;
  padding: 1rem 1.1rem;
  border: 1px solid #dfe3e8;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.kb-card:hover {
  border-color: #2fc6f6;
  box-shadow: 0 4px 12px rgba(47, 198, 246, 0.12);
}
.kb-card-id { font-size: 0.75rem; color: #828b95; margin-bottom: 0.25rem; }
.kb-card-title { font-weight: 600; margin-bottom: 0.35rem; }
.kb-card-summary { font-size: 0.8125rem; color: #525c69; line-height: 1.4; }

.pick-kb-link { margin-left: 0.5rem; font-size: 0.8125rem; font-weight: 500; }
.uf-kb-bar { margin-top: 0.35rem; font-size: 0.75rem; }

.format-hint {
  margin-top: 8px;
  padding: 10px 12px;
  background: #f4f8fa;
  border-radius: 8px;
  border-left: 3px solid var(--accent);
  color: var(--head);
  font-size: 13px;
}
.filter-wrap.obj-filter { padding: 0; max-width: none; margin-top: 4px; }
.main-ui-filter-search.light {
  background: #fff;
  border: 1px solid #c6cdd3;
  border-radius: 12px;
  color: var(--text);
  box-shadow: inset 0 1px 1px rgba(0,0,0,.04);
}
.main-ui-filter-search.light .main-ui-square-search { color: var(--text); }
.main-ui-filter-search.light .main-ui-square-search::placeholder { color: var(--muted); }
.main-ui-filter-search.light .main-ui-filter-search-icon { color: #a8adb4; }
.main-ui-filter-search.light.focused {
  border-color: #66afe9;
  box-shadow: 0 0 0 1px rgba(47,198,246,.25);
}
.date-row { margin: 0 0 12px; max-width: 320px; }
.nav-row { max-width: 420px; }

.review-card {
  background: #fff;
  border: 1px solid #d5dbe0;
  border-radius: 14px;
  overflow: hidden;
  margin: 8px 0 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.review-head {
  padding: 14px 16px;
  background: linear-gradient(135deg, #e8f7fc, #f4f8fa);
  border-bottom: 1px solid var(--line);
}
.review-head .rh-title { font-size: 16px; font-weight: 600; color: var(--head); }
.review-head .rh-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.review-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
.review-cell {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
}
.review-cell:nth-child(2n) { border-right: 0; }
.review-cell .rk { display: block; font-size: 11px; color: var(--muted); margin-bottom: 2px; text-transform: uppercase; letter-spacing: .03em; }
.review-cell .rv { font-size: 14px; color: var(--text); font-weight: 500; }
.review-cell.span2 { grid-column: 1 / -1; border-right: 0; }

.accuracy-box {
  background: #fff8e8;
  border: 1px solid #f0d7a8;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
}
.accuracy-title {
  font-size: 14px; font-weight: 700; color: #8a5a00; margin-bottom: 10px;
}
.radio-row {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 8px 10px; margin: 0 0 6px; border-radius: 8px;
  background: rgba(255,255,255,.7); cursor: pointer;
}
.radio-row:has(input:checked),
.radio-row.on {
  background: #fff;
  box-shadow: inset 0 0 0 1px #f0b429;
}
.radio-row input { margin-top: 3px; }
.radio-row b { display: block; font-size: 13px; color: var(--text); }
.radio-row small { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }

@media (max-width: 620px) {
  .review-grid { grid-template-columns: 1fr; }
  .review-cell { border-right: 0; }
}


@media (max-width: 820px) {
  .bp-tiles { grid-template-columns: 1fr; }
  .process-cards { grid-template-columns: 1fr; }
  .stepbar { gap: 6px; }
  .stepbar-label { font-size: 10px; }
}


.panel h1 { font-size: 18px; margin: 0 0 12px; font-weight: 500; color: var(--head); }
.page-head { margin-bottom: 10px; }
.page-head h1 { margin: 0 0 4px; font-size: 20px; font-weight: 400; }
.page-meta { color: var(--muted); font-size: 13px; margin: 0; }

.lbl { display: block; font-size: 12px; color: var(--muted); margin: 10px 0 4px; }
.inp, select.inp, textarea.inp {
  width: 100%; border: 1px solid var(--border); border-radius: 2px;
  padding: 8px 10px; background: #fff; font: inherit; color: inherit;
}
.inp:focus, select.inp:focus, textarea.inp:focus {
  outline: none; border-color: #66afe9;
}
.area { resize: vertical; min-height: 80px; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button {
  border: 1px solid var(--border); background: #fff; border-radius: 2px;
  padding: 7px 12px; font: inherit; cursor: pointer; color: var(--text);
}
.seg button.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.cards { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.card-item {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  width: 100%; text-align: left; border: 1px solid var(--border); border-radius: 2px;
  background: var(--panel); padding: 10px 12px; font: inherit; cursor: pointer;
}
.card-item:active, .card-item.on { border-color: var(--accent); background: #f3fbfe; }
.card-title { font-weight: 600; font-size: 13px; line-height: 1.35; }
.card-meta { color: var(--muted); font-size: 12px; }
.picked {
  margin: 12px 20px 0; font-size: 13px; color: var(--link);
  padding: 10px 12px; background: #e5f9fe; border-radius: 2px;
}
body:not(.wide-mode) .picked { margin-left: 0; margin-right: 0; }
.picked:empty { display: none; }
.empty {
  padding: 28px 16px; color: var(--muted); font-size: 13px; text-align: center;
  background: #fff;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  margin-top: 12px; width: 100%; border: 0; border-radius: 2px;
  padding: 10px 14px; background: var(--accent); color: #fff;
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--accent-dark); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.ghost { background: #edeef0; color: #535c69; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
body.wide-mode .panel[data-step="2"] > .row {
  max-width: 420px;
  margin: 16px 20px 0;
}
body.wide-mode .staff-form {
  max-width: 480px;
  margin: 0 20px;
}
.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 2px;
  padding: 10px 12px; margin: 8px 0; font-size: 13px;
}
.card.warn { background: var(--warn-bg); color: var(--warn); border-color: #f0d7a8; }
.card.ok { background: var(--ok-bg); color: var(--ok); border-color: #c5dfa0; }
.card.info { background: var(--info-bg); border-color: #b9e3f3; }
.hint { color: var(--muted); font-size: 12px; margin: 6px 0; }
.table-hint { padding: 8px 20px 0; margin: 0; background: #fff; }
.err { color: var(--danger); min-height: 1.2em; margin: 10px 20px; font-size: 12px; }
.chk { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; margin-top: 10px; color: var(--muted); }
.hidden { display: none !important; }

.filter-bar {
  display: flex; align-items: center; gap: 0;
  background: var(--panel); border: 1px solid var(--border); border-radius: 2px;
  margin-top: 6px; min-height: 38px; overflow: hidden;
}
.filter-bar .chip {
  padding: 0 10px; border-right: 1px solid var(--border); background: #f8fafb;
  color: var(--muted); font-size: 12px; white-space: nowrap; line-height: 38px;
}
.filter-bar input {
  flex: 1; border: 0; outline: none; padding: 0 10px; font: inherit; min-width: 0; background: transparent;
}

/* —— Bitrix CRM list shell —— */
.staff-shell {
  background: transparent;
  margin: 0;
  padding: 0;
  overflow: visible;
}
.staff-list-board {
  background: #fff;
  border-radius: 0;
  box-shadow: none;
  margin: 0 -20px;
  width: calc(100% + 40px);
  min-height: 50vh;
}
.pick-type-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 2px;
}
.pick-type-chips .portal-chip {
  background: #fff;
}

/* Dark Bitrix "Фильтр + поиск" */
.main-ui-filter-search {
  display: flex; align-items: center; gap: 0;
  background: var(--bx-search);
  border: 1px solid var(--bx-search-border);
  border-radius: 18px;
  min-height: 40px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
  color: #fff;
}
.main-ui-filter-search.focused,
.main-ui-filter-search.open {
  background: rgba(47, 30, 78, .72);
  box-shadow: 0 0 0 1px rgba(255,255,255,.2);
}
.main-ui-filter-search-filter {
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px;
  flex: 1; padding: 3px 8px 3px 14px; min-width: 0;
}
.chip-row { display: contents; }
.main-ui-filter-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: #d9f4fc; color: #333; border-radius: 11px;
  padding: 2px 8px 2px 10px; font-size: 12px; max-width: 220px;
}
.main-ui-filter-chip span {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.main-ui-filter-chip button {
  border: 0; background: transparent; cursor: pointer;
  color: #525c69; font-size: 14px; line-height: 1; padding: 0 2px;
}
.main-ui-square-search {
  flex: 1; min-width: 140px; border: 0; outline: none;
  font-size: 14px; background: transparent; color: #fff; height: 32px;
}
.main-ui-square-search::placeholder { color: rgba(255,255,255,.72); }
.main-ui-filter-search-icon {
  width: 40px; height: 40px; border: 0; background: transparent;
  cursor: pointer; color: rgba(255,255,255,.85); font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 0 18px 18px 0; flex: 0 0 40px;
}
.main-ui-filter-search-icon:hover,
.main-ui-filter-search-icon.on { color: #fff; background: rgba(255,255,255,.08); }
.main-ui-filter-search-icon svg { width: 18px; height: 18px; fill: currentColor; }

.filter-backdrop { display: none !important; pointer-events: none; }
.popup-filter {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  width: auto;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(33,43,54,.18);
  max-height: min(62vh, 520px);
  overflow: hidden;
  z-index: 80;
  border: 1px solid #d5dbe0;
}
.popup-filter.open {
  display: grid;
  grid-template-columns: 168px 1fr;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 240px;
  max-height: min(62vh, 520px);
}
.popup-presets {
  grid-row: 1;
  border-right: 1px solid var(--line);
  padding: 8px 6px;
  overflow: auto;
  min-height: 160px;
  background: #f8f9fa;
}
.popup-preset {
  display: block; width: 100%; text-align: left; border: 0;
  background: transparent; padding: 8px 12px; cursor: pointer;
  font-size: 13px; color: var(--text); border-radius: 2px; margin-bottom: 1px;
}
.popup-preset:hover { background: #edf1f3; }
.popup-preset.active {
  background: #e5f9fe; color: var(--link); font-weight: 600;
}
.popup-fields {
  grid-row: 1;
  padding: 18px 20px 12px;
  overflow: auto;
  min-height: 160px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 20px;
  align-content: start;
}
.field { margin-bottom: 4px; min-width: 0; }
.field.field-span { grid-column: 1 / -1; }
.field label {
  display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px;
}
.field select, .field input {
  width: 100%; height: 36px; border: 1px solid #c6cdd3; border-radius: 8px;
  padding: 0 10px; font-size: 14px; background: #fff; color: var(--text);
}
.field select:focus, .field input:focus {
  outline: none; border-color: #66afe9;
}
.popup-footer {
  grid-column: 1 / -1;
  display: flex; align-items: center; justify-content: flex-end; gap: 12px;
  padding: 12px 20px; border-top: 1px solid var(--line);
  background: #fff;
}
.ui-btn-link {
  border: 0; background: transparent; color: #535c69;
  font-size: 13px; cursor: pointer; padding: 0; height: auto;
}
.ui-btn-link:hover { color: var(--head); text-decoration: underline; }
.popup-presets { padding: 14px 10px; }
.ui-btn {
  border: 0; border-radius: 2px; cursor: pointer;
  padding: 0 18px; height: 36px; font-size: 12px; font-weight: 600;
  letter-spacing: .3px; text-transform: uppercase;
  display: inline-flex; align-items: center; gap: 6px;
}
.ui-btn-primary { background: var(--accent); color: #fff; }
.ui-btn-primary:hover { background: var(--accent-dark); }
.ui-btn-light { background: #edeef0; color: #535c69; }
.ui-btn:disabled { opacity: .45; cursor: default; }

.grid-wrap {
  margin: 0;
  overflow: auto;
  min-height: 280px;
  max-height: none;
  padding: 0;
  width: 100%;
  -webkit-overflow-scrolling: touch;
  background: #fff;
}
table.main-grid {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
  border-spacing: 0;
}
.main-grid th {
  background: #f4f6f8;
  color: var(--head);
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid #e6e9ec;
  white-space: nowrap;
  position: sticky; top: 0; z-index: 2;
  cursor: pointer; user-select: none;
}
.main-grid th:hover { color: var(--link); }
.main-grid th.sort-asc::after { content: " ↑"; color: var(--accent-dark); }
.main-grid th.sort-desc::after { content: " ↓"; color: var(--accent-dark); }
.main-grid td {
  padding: 10px 14px;
  vertical-align: top;
  font-size: 13px;
  background: #fff;
  border-bottom: 1px solid #edeef0;
}
.main-grid tbody tr { cursor: pointer; }
.main-grid tbody tr:hover td { background: #f6f8f9; }
.main-grid tbody tr.on td {
  background: #eef9fd;
}
.col-id { width: 64px; color: var(--muted); font-size: 12px; }
.col-name { min-width: 260px; }
.col-shift { width: 90px; }
.col-sched { width: 100px; }
.col-time { width: 120px; }
.col-sal { width: 100px; }
.col-plan { width: 90px; }
.col-act { width: 90px; }

.crm-link {
  color: var(--link);
  text-decoration: none;
  font-weight: 400;
  font-size: 14px;
}
.crm-link:hover { text-decoration: underline; }
.cell-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.bp-status {
  display: inline-flex;
  align-items: center;
  margin-top: 6px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
}
.bp-status.free { color: #3f6b00; background: #eaf7d8; }
.bp-status.busy { color: #c2302b; background: #ffe8e7; }
.bp-status.muted { color: #828b95; background: #f0f3f5; }
.shift-link {
  color: var(--link);
  font-size: 13px;
  text-decoration: none;
}
.shift-link:hover { text-decoration: underline; }

@media (max-width: 900px) {
  body.wide-mode .panel[data-step="2"] { padding: 10px 12px 0; }
  .staff-list-board { margin: 0 -12px; width: calc(100% + 24px); }
  .filter-wrap { padding: 10px 12px 0; max-width: none; }
  .popup-filter { left: 0; right: 0; width: auto; }
  .popup-filter.open { grid-template-columns: 1fr; }
  .popup-presets {
    display: flex; gap: 4px; overflow-x: auto; border-right: 0;
    border-bottom: 1px solid var(--line); white-space: nowrap;
  }
  .popup-preset { width: auto; }
  .popup-fields { grid-template-columns: 1fr; }
  .table-hint, .picked, body.wide-mode .staff-form,
  body.wide-mode .panel[data-step="2"] > .row { margin-left: 12px; margin-right: 12px; }
  .err { margin-left: 12px; margin-right: 12px; }
}
@media (max-width: 560px) {
  .top { padding: 8px 12px; }
  body.wide-mode .steps { padding: 8px 12px; }
}



/* ===== UX unify overrides (light filters + staff workspace) ===== */
body.wide-mode { background: var(--bg); }
body.wide-mode .panel[data-step="2"] { padding: 12px 16px 0; }
body.wide-mode .staff-form { max-width: none; margin: 0; }
body.wide-mode .panel[data-step="2"] > .row { max-width: none; margin: 12px 0 0; }

.main-ui-filter-search,
.main-ui-filter-search.light,
.main-ui-filter-search.focused,
.main-ui-filter-search.open {
  background: #fff !important;
  border: 1px solid #c6cdd3 !important;
  border-radius: 8px !important;
  color: var(--text) !important;
  box-shadow: none !important;
}
.main-ui-filter-search.open {
  border-radius: 8px !important;
  border-bottom-color: #c6cdd3 !important;
}
.main-ui-filter-search.open .main-ui-filter-search-icon {
  border-radius: 0 8px 8px 0 !important;
}
.main-ui-filter-search.focused:not(.open) {
  border-color: #66afe9 !important;
  box-shadow: 0 0 0 1px rgba(47,198,246,.25) !important;
}
.main-ui-square-search,
.main-ui-filter-search.light .main-ui-square-search {
  color: var(--text) !important;
}
.main-ui-square-search::placeholder { color: var(--muted) !important; }
.main-ui-filter-search-icon {
  color: #a8adb4 !important;
  border-radius: 0 8px 8px 0 !important;
}
.main-ui-filter-search-icon:hover,
.main-ui-filter-search-icon.on {
  color: var(--accent-dark) !important;
  background: #f3fbfe !important;
}

.filter-wrap { padding: 0; max-width: none; }
.staff-list-board { margin: 0; width: 100%; min-height: 0; border-radius: 0; }

.picked-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 8px; padding: 8px 10px;
  background: #f3fbfe; border: 1px solid #b9e3f3; border-radius: 8px;
  font-size: 13px; color: var(--link);
}
.picked-bar.hidden { display: none !important; }
.picked-bar .picked-title { font-weight: 600; color: var(--link); cursor: pointer; background: none; border: 0; padding: 0; font: inherit; font-weight: 600; }
.picked-bar .picked-title:hover { text-decoration: underline; }
.picked-bar .picked-meta { color: var(--muted); font-size: 12px; }
.picked-bar .picked-actions { margin-left: auto; display: flex; gap: 6px; }
.picked-bar .link-btn {
  border: 1px solid #c6cdd3; background: #fff; border-radius: 6px;
  padding: 4px 10px; font-size: 12px; cursor: pointer; color: var(--head);
}
.picked-bar .link-btn:hover { border-color: var(--accent); color: var(--accent-dark); }

.card-item {
  display: grid !important;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
  align-items: center;
  border-radius: 8px !important;
}
.card-item .card-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.card-item .card-open {
  border: 0; background: transparent; color: var(--link); font: inherit;
  font-weight: 600; text-align: left; cursor: pointer; padding: 0;
}
.card-item .card-open:hover { text-decoration: underline; }
.card-item .card-pick {
  border: 1px solid var(--accent); background: #fff; color: var(--accent-dark);
  border-radius: 6px; padding: 6px 12px; font-size: 12px; font-weight: 600; cursor: pointer;
}
.card-item .card-pick:hover { background: #e5f9fe; }

.step2-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 8px;
}
.step2-head h1 { margin: 0 0 2px; }
.object-context { margin: 0 0 10px; }
.object-context-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid #d5dbe0;
  border-radius: 8px;
}
.object-context-mark {
  font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: #11a9d9; background: #e8f7fc; border-radius: 4px; padding: 3px 8px;
}
.object-context-title {
  border: 0; background: transparent; color: var(--link); font: inherit;
  font-weight: 600; cursor: pointer; padding: 0; text-align: left;
  max-width: min(420px, 55vw);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.object-context-title:hover { text-decoration: underline; }
.date-inline { min-width: 200px; }
.date-inline .lbl { margin-top: 0; }
.date-inline .inp { border-radius: 8px; }

.staff-workspace {
  display: flex; flex-direction: column;
  height: calc(100vh - 320px); min-height: 360px;
  background: transparent; border: 0; border-radius: 0;
  overflow: visible;
}
.staff-workspace-top {
  flex: 0 0 auto; padding: 0 0 10px;
  border-bottom: 0; background: transparent;
  position: relative; z-index: 5;
  overflow: visible;
}
.staff-workspace-top .filter-wrap { position: relative; z-index: 6; }
.staff-workspace-top .table-hint { padding: 8px 2px 10px; background: transparent; margin: 0; }
.staff-workspace-grid {
  flex: 1 1 auto; overflow: auto; min-height: 180px;
  -webkit-overflow-scrolling: touch;
  background: #fff;
  border: 1px solid #d5dbe0;
  border-radius: 10px;
}
.params-panel {
  margin-top: 16px;
  padding-top: 4px;
}
.params-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
}
.params-block {
  display: grid;
  grid-template-columns: minmax(140px, 180px) minmax(180px, 1.4fr) 100px;
  gap: 10px;
  align-items: end;
  padding: 12px;
  background: #fff;
  border: 1px solid #d5dbe0;
  border-radius: 10px;
}
.oneoff-params { margin-bottom: 12px; grid-template-columns: minmax(140px, 200px) 120px; }
.foot-actions { display: flex; gap: 8px; justify-content: flex-end; align-items: end; }
.foot-check { margin: 8px 0 0; }
.foot-field .lbl { margin: 0 0 4px; }
.foot-field .inp { border-radius: 8px; margin: 0; }
.foot-actions .btn { margin: 0; width: auto; min-width: 96px; border-radius: 8px; padding: 9px 16px; }
.oneoff-board {
  background: #fff; border: 1px solid #d5dbe0; border-radius: 8px; padding: 14px;
}
.oneoff-board .inp { border-radius: 8px; }
.btn, .inp, select.inp, textarea.inp, .ui-btn { border-radius: 8px !important; }

.staff-workspace-grid table.main-grid {
  width: 100%; min-width: 920px; border-collapse: collapse; border-spacing: 0;
  table-layout: auto;
}
.staff-workspace-grid .main-grid th {
  background: #f4f6f8; color: var(--head); font-size: 12px; font-weight: 600;
  text-align: left; padding: 10px 12px; border-bottom: 1px solid #e6e9ec;
  white-space: nowrap; position: sticky; top: 0; z-index: 2; cursor: pointer;
}
.staff-workspace-grid .main-grid td {
  padding: 10px 12px; vertical-align: top; font-size: 13px; background: #fff;
  border-bottom: 1px solid #edeef0; border-top: 0; border-left: 0; border-right: 0;
  border-radius: 0 !important;
}
.staff-workspace-grid .main-grid tbody tr { cursor: pointer; }
.staff-workspace-grid .main-grid tbody tr:hover td { background: #f6f8f9; }
.staff-workspace-grid .main-grid tbody tr.on td { background: #eef9fd; }
.col-pos { min-width: 120px; }

.info-chip, .shift-chip {
  display: inline-flex; align-items: center; gap: 5px;
  max-width: 100%;
  padding: 3px 8px; border-radius: 999px;
  font-size: 12px; font-weight: 600; line-height: 1.3;
  background: #f0f3f5; color: #525c69; white-space: nowrap;
}
.info-chip.sched { background: #eef2ff; color: #3f51b5; }
.info-chip.time { background: #f3f0ff; color: #6a1b9a; }
.info-chip.pos { background: #eef7fb; color: #2067b0; border-radius: 6px; }
.col-emp { max-width: 280px; width: 220px; }
.shift-chip .shift-ico { font-size: 12px; }
.shift-chip.day { background: #fff6d6; color: #8a6d00; }
.shift-chip.night { background: #e8ecf8; color: #2f3f7a; }
.shift-chip.morning { background: #e7f7ef; color: #1f6b45; }
.shift-chip.evening { background: #fdece8; color: #9a3412; }
.shift-chip.other { background: #f0f3f5; color: #525c69; }
.muted-dash { color: var(--muted); }
.plan-fact { display: flex; flex-direction: column; gap: 2px; min-width: 110px; }
.plan-fact .pf-row { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; }
.plan-fact .pf-k { color: var(--muted); }
.plan-fact .pf-v { font-weight: 700; color: var(--head); }
.plan-fact.full .pf-v { color: #c2302b; }

.review-staff {
  padding: 14px 16px 8px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfd;
}
.review-staff-link {
  border: 0; background: transparent; color: var(--link);
  font: inherit; font-size: 16px; font-weight: 700; cursor: pointer; padding: 0;
}
.review-staff-link:hover { text-decoration: underline; }
.rh-sub .review-staff-link { font-size: 13px; font-weight: 600; }
.review-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.review-section { border-top: 1px solid var(--line); }
.review-section-title {
  padding: 12px 16px 0; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; color: var(--muted);
}
#mismatchNoteWrap { margin: 8px 0 12px; }

.field-invalid,
.inp.field-invalid,
select.field-invalid,
textarea.field-invalid,
.obj-open-btn.field-invalid,
.process-cards.field-invalid,
.staff-workspace.field-invalid {
  outline: 2px solid #e11d48;
  outline-offset: 2px;
  border-color: #e11d48 !important;
  box-shadow: 0 0 0 3px rgba(225, 29, 72, .18);
}
.foot-field.field-invalid .inp,
.foot-field.field-invalid select {
  border-color: #e11d48 !important;
  box-shadow: 0 0 0 3px rgba(225, 29, 72, .18);
}

.obj-filter-fields {
  display: grid;
  grid-template-columns: 1fr !important;
  padding: 2px 0 0;
  overflow: visible;
  max-height: none;
}
.obj-filter-panel { overflow: visible; }

.bx-select { position: relative; width: 100%; }
.bx-select-control {
  width: 100%; min-height: 38px;
  display: flex; align-items: center; gap: 8px;
  text-align: left;
  border: 1px solid #c6cdd3;
  background: #fff;
  border-radius: 8px;
  padding: 4px 10px;
  font: inherit;
  cursor: pointer;
  color: var(--text);
}
.bx-select.open .bx-select-control,
.bx-select-control:focus {
  border-color: #2fc6f6;
  box-shadow: 0 0 0 1px rgba(47,198,246,.35);
  outline: none;
}
.bx-select-placeholder { color: var(--muted); flex: 1; font-size: 14px; }
.bx-select-caret { margin-left: auto; color: #a8adb4; font-size: 12px; }
.bx-select-menu {
  display: none;
  background: #fff;
  border: 1px solid #e6e9ec;
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(33,43,54,.18);
  overflow: hidden;
  max-height: min(52vh, 360px);
}
.bx-select-menu.open { display: block; }
.bx-select-search {
  width: calc(100% - 16px);
  margin: 8px;
  height: 34px;
  border: 1px solid #c6cdd3;
  border-radius: 8px;
  padding: 0 10px;
  font-size: 13px;
}
.bx-select-search:focus {
  outline: none;
  border-color: #2fc6f6;
}
.bx-select-list { overflow: auto; max-height: 280px; padding: 4px 0 8px; }
.bx-select-item {
  display: flex; width: 100%;
  border: 0; background: transparent;
  padding: 8px 12px;
  cursor: pointer; font: inherit; text-align: left;
}
.bx-select-item:hover { background: #f4f6f8; }
.bx-select-item.on { background: #edf1f3; }
.bx-select-row {
  display: flex; align-items: center; gap: 10px; min-width: 0; width: 100%;
}
.bx-select-text {
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 14px; color: #333;
}
.bx-select-badge {
  flex: 0 0 auto;
  font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 999px;
  background: #e8f7fc; color: #0f5f78;
}
.bx-select-empty { padding: 12px; color: var(--muted); font-size: 13px; }
.bx-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700; color: #fff;
  flex: 0 0 28px;
  background: hsl(var(--h, 200) 42% 48%);
}
.bx-avatar.all { background: #9aa3ad; font-size: 12px; }
.bx-avatar.company { background: #5b6abf; }
.bx-avatar.enum { background: #6b7c93; }
.bx-avatar.icon { background: #eef2f5; color: #334; font-size: 14px; }
.bx-select-control .main-ui-filter-chip {
  max-width: calc(100% - 28px);
  margin: 0;
}
.bx-select-control .main-ui-filter-chip span {
  max-width: 220px;
}

.season-cell { display: flex; gap: 4px; align-items: center; font-size: 16px; }
.season-ico.winter { color: #2b6cb0; }
.season-ico.summer { color: #dd6b20; }
.col-season { width: 64px; text-align: center; }

@media (max-width: 900px) {
  .process-cards { grid-template-columns: 1fr; }
  .staff-workspace { height: calc(100vh - 280px); }
  .params-row { grid-template-columns: 1fr; }
  .params-block { grid-template-columns: 1fr 1fr; }
  .format-badge { margin-left: 0; }
  .obj-picker-panel { width: 100vw; border-radius: 16px 16px 0 0; height: min(92vh, 100%); align-self: flex-end; }
}
@media (max-width: 560px) {
  .params-block { grid-template-columns: 1fr; }
  .card-item { grid-template-columns: 1fr !important; }
}

.portal-body {
  display: flex; min-height: 100vh; background: var(--bg);
}
.portal-nav {
  width: 248px; flex: 0 0 248px;
  background: #fff; border-right: 1px solid var(--line);
  padding: 16px 12px 32px;
  display: flex; flex-direction: column; gap: 2px;
  max-height: 100vh; overflow: auto;
}
.portal-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.portal-select { width: min(280px, 48vw); margin: 0; border-radius: 8px; }
.portal-gate { display: grid; gap: 8px; max-width: 520px; margin-top: 12px; }
.portal-gate-btn {
  display: block; width: 100%; text-align: left;
  padding: 12px 14px; border-radius: 10px; border: 1px solid #d5dbe0;
  background: #fff; cursor: pointer; font: inherit; color: var(--head);
}
.portal-gate-btn:hover { border-color: var(--link); background: #eef7fb; }
.portal-gate-btn .pg-name { font-weight: 700; }
.portal-gate-btn .pg-meta { font-size: 12px; color: var(--muted); margin-top: 4px; }
.portal-switch {
  margin-left: 8px; font-size: 12px; color: var(--link); cursor: pointer;
  background: none; border: none; padding: 0; text-decoration: underline;
}
.portal-brand {
  font-size: 16px; font-weight: 700; color: var(--head);
  padding: 4px 10px 14px;
}
.portal-nav-k {
  margin: 14px 10px 6px; font-size: 11px; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase; color: var(--muted);
}
.portal-nav a {
  display: block; padding: 8px 10px; border-radius: 8px;
  color: var(--head); text-decoration: none; font-size: 13px;
}
.portal-nav a:hover, .portal-nav a.on { background: #eef7fb; color: var(--link); }
.portal-nav-off {
  display: block; padding: 8px 10px; color: #b0b6bd; font-size: 13px;
}
.portal-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.portal-top {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
}
.portal-search { width: min(320px, 42vw); margin: 0; border-radius: 8px; }
.portal-wrap { padding: 12px 16px 40px; }
.portal-stats {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 12px 0 16px;
}
.portal-stat {
  background: #fff; border: 1px solid #d5dbe0; border-radius: 10px; padding: 12px 14px;
}
.ps-k { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.ps-v { font-size: 22px; font-weight: 700; color: var(--head); margin-top: 4px; }
.ps-s { font-size: 12px; color: var(--muted); margin-top: 4px; }
.portal-table { max-height: calc(100vh - 220px); border: 1px solid #d5dbe0; border-radius: 10px; background: #fff; }
.portal-form {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  background: #fff; border: 1px solid #d5dbe0; border-radius: 10px;
  padding: 10px 12px; margin: 0 0 12px;
}
.portal-form .inp { margin: 0; min-width: 160px; }
.portal-form-msg { font-size: 12px; color: var(--muted); }
.portal-filters { display: flex; gap: 6px; margin: 0 0 10px; }
.portal-chip {
  border: 1px solid #d5dbe0; background: #fff; border-radius: 999px;
  padding: 4px 10px; font-size: 12px; cursor: pointer; color: var(--head);
}
.portal-chip.on { background: #e8f6fc; border-color: #8fd4ea; color: var(--link); }
.portal-del { padding: 4px 8px !important; font-size: 12px; min-width: 0; }
.portal-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 12px; }
.portal-row { cursor: pointer; }
.portal-row:hover td { background: #f5f9fc; }

.cm-section { margin: 18px 0 24px; }
.cm-section .portal-table { max-height: 520px; }
.cm-n { font-size: 12px; color: var(--muted); font-weight: 500; }
.cm-yes { color: #0a7; font-weight: 600; }
.cm-pill { margin: 12px 0; font-size: 13px; }

.iv-wrap { font-size: 13px; }
.iv-head { display: block; margin-bottom: 12px; }
.iv-board { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.iv-grid-bar { display: flex; flex-direction: column; gap: 8px; }
.iv-sel-banner {
  border: 1px solid #dfe3e6;
  background: #f8fafb;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  color: var(--muted);
}
.iv-sel-banner.on {
  background: #e8f6fc;
  border-color: #8fd4ea;
  color: var(--head);
}
.iv-sel-k {
  display: inline-block;
  margin-right: 8px;
  color: var(--link);
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
}
.iv-sel-v { font-size: 14px; font-weight: 700; color: var(--head); }
.iv-meta { display: inline-block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.iv-tools { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.iv-inp { min-width: 110px; margin: 0; padding: 4px 8px; font-size: 12px; }
.iv-legend { display: flex; gap: 12px; font-size: 12px; color: var(--muted); margin: 8px 0 0; align-items: center; flex-wrap: wrap; }
.iv-dot { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.iv-dot.free { background: #e8f6ec; border: 1px solid #7bc99a; }
.iv-dot.busy { background: #fde8e8; border: 1px solid #e88; }
.iv-dot.vac { background: #ffe8cc; border: 1px solid #e0a154; }
.iv-dot.closed { background: #eef0f3; border: 1px solid #b0b7c3; }
.iv-sched-hint {
  font-size: 12px;
  color: #4b5563;
  margin: 0 0 8px;
  padding: 6px 8px;
  background: #f3f4f6;
  border-radius: 6px;
}
.iv-outcome {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid #d0d7de;
  border-radius: 8px;
  background: #f6f8fa;
}
.iv-outcome-title { font-weight: 600; margin-bottom: 6px; font-size: 13px; }
.iv-out-prev { font-size: 12px; color: #57606a; margin-bottom: 8px; }
.iv-outcome-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.iv-out-note {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  padding: 6px 8px;
  font: inherit;
  resize: vertical;
}
.iv-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.iv-day-h { font-weight: 600; font-size: 12px; margin-bottom: 4px; }
.iv-slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.iv-slot { border: 1px solid #d5dbe0; background: #fff; border-radius: 6px; padding: 4px 2px; font-size: 11px; cursor: default; }
.iv-slot.free { background: #f4fbf6; cursor: pointer; }
.iv-slot.free:hover { border-color: #7bc99a; }
.iv-slot.busy { background: #fff5f5; color: #a44; opacity: 0.85; }
.iv-slot.sel { background: #ffe8cc; border-color: #f90; box-shadow: 0 0 0 1px #f90; }
.iv-actions { display: flex; gap: 10px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.iv-msg { font-size: 12px; color: var(--muted); }
.iv-lab { display: block; font-size: 11px; color: var(--muted); margin: 8px 0 4px; }
.iv-kind-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.iv-kind-lock {
  display: inline-flex; align-items: center;
  font-size: 12px; font-weight: 700; letter-spacing: .02em;
  color: #525c69; background: #f5f7f8; border: 1px solid #dfe3e6;
  border-radius: 16px; padding: 4px 12px;
  pointer-events: none;
}
.iv-kind-intro { font-size: 13px; color: var(--muted); margin: 8px 0 14px; }
.iv-kind-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.iv-kind-card {
  text-align: left; border: 1px solid #dfe3e6; background: #fff; border-radius: 10px;
  padding: 16px; cursor: pointer; font: inherit;
}
.iv-kind-card:hover { border-color: #2fc6f6; }
.iv-kind-title { font-size: 16px; font-weight: 700; color: var(--head); }
.iv-kind-who { margin-top: 6px; font-size: 12px; color: var(--muted); }
.iv-people { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.iv-people-wrap { position: relative; }
.iv-tag {
  display: inline-flex; align-items: center; gap: 6px;
  background: #e7f9e8; color: #2f6b3a; border-radius: 14px;
  padding: 3px 8px 3px 3px; font-size: 12px; font-weight: 500;
}
.iv-tag-name { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iv-tag.vac { background: #ffe8cc; color: #8a4b00; }
.iv-tag-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.iv-tag-hint { font-size: 10px; font-weight: 600; color: #8a4b00; }
.iv-ava {
  width: 28px; height: 28px; border-radius: 50%;
  background: #2fc6f6; color: #fff; display: inline-flex;
  align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0;
  overflow: hidden;
}
.iv-nav-btn {
  appearance: none;
  -webkit-appearance: none;
  width: 22px !important; height: 22px !important;
  min-width: 22px !important; max-width: 22px !important;
  margin: 0; flex: 0 0 22px; box-sizing: border-box;
  border: 0 !important; border-radius: 4px !important;
  background: #edeef0 !important; color: #535c69 !important;
  font-size: 13px; line-height: 1; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 !important; box-shadow: none !important;
}
.iv-nav-btn:hover { background: #e0e2e6; }
.iv-week-h-nav { display: flex; gap: 4px; align-items: center; justify-content: center; padding: 4px 2px; }
.iv-week-h-day { display: flex; align-items: center; justify-content: center; gap: 6px; }
.iv-nav-pair { display: inline-flex; gap: 4px; flex-shrink: 0; }
.iv-ava img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block;
}
.iv-ava.sm { width: 22px; height: 22px; font-size: 10px; }
.iv-add-user {
  border: 1px dashed #c6cdd3; background: #fff; color: var(--link);
  border-radius: 14px; padding: 4px 10px; font: 12px inherit; cursor: pointer;
}
.iv-add-user:hover { background: #f5f9fc; }
.iv-chip-x { border: 0; background: transparent; cursor: pointer; color: inherit; font-size: 14px; line-height: 1; padding: 0 0 0 2px; }
.iv-user-pop {
  position: absolute; z-index: 30; left: 0; top: calc(100% + 6px);
  width: min(380px, 94vw); background: #fff;
  border: 1px solid #dfe3e6; border-radius: 12px;
  box-shadow: 0 10px 32px rgba(33,43,54,.18);
  padding: 0; overflow: hidden;
}
.iv-user-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  margin: 10px; padding: 6px 8px;
  border: 1px solid #c6cdd3; border-radius: 8px; min-height: 40px;
}
.iv-user-picked { display: flex; flex-wrap: wrap; gap: 6px; }
.iv-pick-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: #e5f1fb; color: var(--head); border-radius: 14px;
  padding: 2px 8px 2px 2px; font-size: 12px;
}
.iv-user-search {
  flex: 1; min-width: 80px; border: 0; outline: none;
  font: 13px inherit; color: var(--head); background: transparent;
}
.iv-user-hits { max-height: 260px; overflow: auto; padding: 4px 0 8px; }
.iv-user-hit {
  display: flex; width: 100%; text-align: left; border: 0; background: #fff;
  padding: 8px 12px; font: 13px inherit; cursor: pointer; align-items: center; gap: 10px;
}
.iv-user-hit:hover { background: #f5f9fc; }
.iv-user-hit.on { background: #e8f4fc; }
.iv-user-hit-txt { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.iv-user-hit-name { color: var(--head); display: flex; align-items: center; gap: 8px; }
.iv-role {
  font-size: 11px; background: #e7f9e8; color: #2f6b3a;
  border-radius: 10px; padding: 1px 7px;
}
.iv-check { color: #2fc6f6; font-weight: 700; margin-left: auto; }
.iv-user-empty { padding: 10px 12px; }
.iv-layout { display: grid; grid-template-columns: minmax(0, 1fr) 228px; gap: 12px; align-items: start; }
.iv-main { min-width: 0; overflow: auto; max-height: calc(100vh - 250px); border: 1px solid #e6e9ec; border-radius: 8px; background: #fff; }
.iv-cal { background: #fff; border: 1px solid #e6e9ec; border-radius: 8px; padding: 10px; position: sticky; top: 0; }
.iv-cal-h { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-bottom: 8px; text-transform: capitalize; font-size: 13px; }
.iv-cal-nav { margin: 0; width: 28px; min-width: 28px; padding: 4px 0; }
.iv-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.iv-cal-wd { font-size: 10px; color: var(--muted); text-align: center; padding: 2px 0; }
.iv-cal-day {
  height: 28px; border: 0; background: transparent; border-radius: 50%;
  font-size: 12px; cursor: pointer; color: var(--head);
}
.iv-cal-day.out { visibility: hidden; }
.iv-cal-day.today { background: #2fc6f6; color: #fff; }
.iv-cal-day.in-week { background: #e8f5e9; }
.iv-cal-day.sel { background: #2fc6f6; color: #fff; }
.iv-cal-day.has-busy { box-shadow: inset 0 -3px 0 #e88; }
.iv-cal-day.has-vac { box-shadow: inset 0 -3px 0 #e0a154; }
.iv-cal-day:hover { background: #f0f3f5; }
.iv-week { display: grid; min-width: 640px; }
.iv-week-h { font-size: 11px; text-align: center; padding: 8px 2px; background: #f8f9fa; border-bottom: 1px solid #e6e9ec; font-weight: 600; position: sticky; top: 0; z-index: 1; }
.iv-week-time { font-size: 10px; color: #a8adb4; text-align: right; padding: 0 6px 0 0; border-top: 1px solid #f0f2f4; }
.iv-week-cell { border-top: 1px solid #f0f2f4; border-left: 1px solid #f0f2f4; position: relative; min-height: 22px; }
.iv-week-cell.free { background: #fff; cursor: pointer; }
.iv-week-cell.free:hover { background: #eef9fd; }
.iv-week-cell.busy {
  background: repeating-linear-gradient(-45deg, #f4f6f8, #f4f6f8 4px, #eceff2 4px, #eceff2 8px);
  cursor: not-allowed;
}
.iv-week-cell.busy.vac { background: #ffe8cc; }
.iv-week-cell.busy.off { background: #e0e7ff; }
.iv-week-cell.busy.closed { background: #eef0f3; color: #6b7280; }
.iv-week-ev {
  display: block; font-size: 9px; line-height: 1.15; color: #6b3b3b;
  padding: 1px 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  pointer-events: none;
}
.iv-week-cell.vac .iv-week-ev { color: #8a4b00; }
.iv-week-cell.off .iv-week-ev { color: #312e81; }
.iv-now { position: absolute; left: 0; right: 0; height: 2px; background: #f44336; z-index: 2; }
.iv-tl { overflow: auto; max-height: calc(100vh - 280px); position: relative; }
.iv-tl-head-days { display: flex; flex: 1; min-width: 0; }
.iv-tl-busy {
  position: absolute; top: 8px; bottom: 8px;
  background: #f7c1c1; border-radius: 3px; z-index: 1;
  overflow: hidden; color: #7a3030; font-size: 10px; font-style: normal;
  line-height: 28px; padding: 0 5px; white-space: nowrap; text-overflow: ellipsis;
  box-sizing: border-box; pointer-events: none;
}
.iv-tl-busy.vac { background: #ffd59e; color: #8a4b00; }
.iv-tl-busy.off { background: #c7d2fe; color: #312e81; }
.iv-tl-tools { display: flex; gap: 8px; align-items: center; padding: 8px 10px; font-size: 12px; color: var(--muted); border-top: 1px solid #f0f2f4; }
.iv-tl-head, .iv-tl-hours-row, .iv-tl-row { display: flex; align-items: stretch; }
.iv-tl-hours { display: flex; border-left: 1px solid #e6e9ec; flex: 1; }
.iv-tl-hr { font-size: 11px; color: #a8adb4; border-left: 1px solid #f0f2f4; box-sizing: border-box; padding: 2px 0 2px 4px; }
.iv-tl-body { position: relative; }
.iv-tl-label {
  width: 148px; flex-shrink: 0; padding: 6px 8px; font-size: 12px; color: var(--head);
  border-right: 1px solid #e6e9ec; box-sizing: border-box;
  display: flex; align-items: center; gap: 8px;
}
.iv-tl-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iv-tl-who { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.iv-tl-status { font-size: 10px; color: #8a4b00; font-weight: 600; }
.iv-crown { color: #7bc96f; font-size: 11px; }
.iv-tl-res-ico { color: #8a9aa8; }
.iv-tl-sec {
  font-size: 11px; color: var(--muted); font-weight: 600;
  padding: 8px 10px 4px; text-transform: none;
}
.iv-tl-day { padding: 8px 8px 4px; font-size: 13px; font-weight: 600; border-left: 1px solid #e6e9ec; background: #fff; display: flex; align-items: center; gap: 8px; }
.iv-tl-today {
  border: 0; background: transparent; color: var(--link); font-size: 12px; cursor: pointer; padding: 0;
}
.iv-tl-overlay {
  position: absolute; left: 148px; top: 0; right: 0; bottom: 0;
  pointer-events: none;
}
.iv-tl-track { position: relative; height: 44px; background: #f7f8f9; border-bottom: 1px solid #eceff2; cursor: pointer; flex: 1; min-width: 0; }
.iv-tl-slot {
  position: absolute; top: 8px; bottom: 8px;
  background: #2fc6f6; border-radius: 14px; opacity: .9; z-index: 2;
  pointer-events: none;
}
.iv-tl-sel {
  position: absolute; top: 0; bottom: 0; height: auto;
  background: rgba(47, 198, 246, .16);
  border-left: 2px solid #2fc6f6; border-right: 2px solid #2fc6f6;
  cursor: grab; z-index: 4; user-select: none; pointer-events: auto;
}
.iv-tl-handle {
  position: absolute; top: 0; bottom: 0; width: 8px;
  background: transparent; cursor: ew-resize;
}
.iv-tl-handle.left { left: -2px; }
.iv-tl-handle.right { right: -2px; }
.iv-tl-grip {
  position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%);
  background: #2fc6f6; color: #fff; letter-spacing: 1px;
  font-size: 10px; line-height: 1; padding: 4px 9px; border-radius: 4px;
  cursor: grab; font-style: normal;
}
.iv-tl-ticks {
  display: block; height: 10px; flex: 1;
  background: repeating-linear-gradient(90deg, #c6cdd3 0 1px, transparent 1px 8px);
  opacity: .7; margin-left: 8px;
}
.iv-foot { justify-content: flex-end; }
.iv-busy-overlay {
  position: absolute; inset: 0; z-index: 120;
  background: rgba(255,255,255,.78);
  display: flex; align-items: center; justify-content: center;
}
.iv-busy-overlay.hidden { display: none !important; }
.iv-busy-box { text-align: center; color: var(--head); }
.iv-busy-txt { margin-top: 10px; font-size: 14px; font-weight: 600; }
.iv-spinner {
  display: inline-block; width: 36px; height: 36px;
  border: 3px solid #d5dbe0; border-top-color: #2fc6f6;
  border-radius: 50%; animation: iv-spin .7s linear infinite;
}
@keyframes iv-spin { to { transform: rotate(360deg); } }
.bx-slider-panel.iv-wide-panel,
.hub-slider-shell { position: relative; }
.iv-foot-btns { margin-left: auto; display: flex; gap: 8px; }
.iv-wide-panel { width: min(1100px, 100vw); }
.iv-view-toggle { display: flex; gap: 4px; }

@media (max-width: 720px) {
  .iv-grid { grid-template-columns: 1fr; }
  .iv-layout { grid-template-columns: 1fr; }
  .iv-kind-pick { grid-template-columns: 1fr; }
}
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger:hover { background: #e04843; }
.btn.danger:disabled { opacity: .45; }

html, body.uf-embed {
  text-align: left;
  width: 100%;
  box-sizing: border-box;
}
body.uf-embed {
  margin: 0;
  padding: 10px 14px 10px 16px;
  background: transparent;
  min-height: 0;
  box-sizing: border-box;
}
body.uf-embed.uf-compact {
  overflow: visible;
}
body.uf-compact .uf-people {
  flex-direction: row;
  flex-wrap: wrap;
  margin-top: 8px;
  gap: 12px;
}
body.uf-compact .pick-person-name { max-width: 140px; }
body.uf-embed .bx-jr-list { max-height: 168px; }
#ufRoot, #ivRoot {
  box-sizing: border-box;
  width: 100%;
}
.iv-book {
  width: 100%;
  box-sizing: border-box;
  background: #fff;
  border: 1px solid #d5dbe0;
  border-radius: 10px;
  padding: 12px 14px 14px;
  cursor: pointer;
  text-align: left;
}
.iv-book-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(72px, .7fr) minmax(80px, .8fr);
  gap: 10px;
  margin-bottom: 10px;
}
.iv-book-f { min-width: 0; }
.iv-book-lab {
  font-size: 11px;
  color: #a8adb4;
  margin: 0 0 5px;
}
.iv-book-inp {
  position: relative;
  height: 34px;
  border: 1px solid #c6cdd3;
  border-radius: 4px;
  background: #fff;
  padding: 0 28px 0 10px;
  font-size: 13px;
  color: var(--head);
  display: flex;
  align-items: center;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}
.iv-book-inp.empty { color: #a8adb4; }
.iv-book-ico, .iv-book-chev {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  font-size: 11px; color: #a8adb4; pointer-events: none;
}
.iv-book-box {
  border: 1px solid #c6cdd3;
  border-radius: 4px;
  min-height: 36px;
  padding: 6px 10px;
  margin-bottom: 10px;
  background: #fff;
}
.iv-book-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.iv-book-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: #e7f9e8; color: #2f6b3a; border-radius: 3px;
  padding: 3px 7px; font-size: 12px; max-width: 100%;
}
.iv-book-chip i { font-style: normal; color: #6a9; font-size: 13px; }
.iv-book-link {
  display: inline-block;
  color: #2066b0;
  font-size: 13px;
  background: none;
  border: 0;
  padding: 2px 0;
  cursor: pointer;
  font-family: inherit;
}
.iv-book-link:hover { text-decoration: underline; }
.iv-book-kind { margin-top: 6px; font-size: 11px; color: #6a737c; }
.iv-people-box { margin: 0; }
.uf-line {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 3px;
  padding: 2px 0 2px 2px;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 13px;
  line-height: 1.3;
  overflow: visible;
  min-height: 0;
  text-align: left;
  width: 100%;
}
.uf-line-top {
  display: flex;
  align-items: baseline;
  gap: 8px;
  width: 100%;
  min-width: 0;
}
.uf-line-main {
  font-weight: 600;
  color: var(--head);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  text-align: left;
  flex: 1;
  min-width: 0;
}
.uf-line-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  max-width: 100%;
  text-align: left;
  white-space: normal;
}
.uf-line-sub-text {
  color: var(--muted);
  min-width: 0;
}
.uf-line-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 100%;
  margin-top: 6px;
}
.uf-meta-chip {
  display: inline-flex;
  align-items: center;
  background: #d9f4fc;
  color: #2066a0;
  border-radius: 11px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 600;
  line-height: 18px;
  white-space: nowrap;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.uf-meta-chip.fmt { background: #d9f4fc; }
.uf-meta-chip.qty { background: #fff3d6; color: #8a6d00; }
.uf-meta-chip.pos { background: #eaf7d8; color: #2f4a0d; }
.uf-meta-chip.req { background: #d9f4fc; color: #333; }
.uf-meta-chip.plat { background: #e8f6ec; color: #1f6b45; }
.uf-meta-chip.code { background: #f0f3f5; color: #525c69; }
.uf-line-chips .info-chip { font-size: 11px; padding: 2px 7px; }
.info-chip.plat { background: #e8f6ec; color: #1f6b45; }
.info-chip.code { background: #f0f3f5; color: #525c69; font-weight: 500; }
.uf-line-tag {
  margin-left: 6px;
  font-size: 11px;
  color: #8a6d3b;
}
.uf-line.empty { color: var(--muted); font-weight: 400; background: transparent; }
.uf-line-action {
  border: 0;
  background: transparent;
  color: var(--link);
  cursor: pointer;
  font-size: 12px;
  padding: 0;
  text-align: left;
  font-family: inherit;
}
.uf-line-action:hover { text-decoration: underline; }
.uf-line-sub .uf-line-action { margin-left: 6px; }
.bx-focus-flash { outline: 2px solid #2fc6f6; outline-offset: 3px; }
.uf-view { padding: 4px 2px; }
.uf-view-title { font-size: 13px; font-weight: 600; color: var(--head); }
.uf-view-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.uf-view-note { font-size: 12px; color: var(--muted); margin-top: 6px; line-height: 1.35; }
.uf-view.empty { color: var(--muted); font-size: 13px; }
.bx-slider {
  position: fixed; inset: 0; z-index: 80;
  display: flex; justify-content: flex-end; align-items: stretch;
}
body.uf-embed .bx-slider { z-index: 99999; }
body.uf-embed.bx-slider-open { overflow: hidden; }
.bx-slider-title-text { font: 18px/1.3 "Helvetica Neue", Arial, sans-serif; color: var(--head); padding: 4px 0; }
.uf-slot-panel { width: min(680px, 96vw); }
.iv-wrap-slider { padding: 12px 20px 18px; }
.iv-wrap-slider .iv-tools { margin-bottom: 0; }
.iv-wrap-slider .iv-grid { max-height: calc(100vh - 220px); overflow: auto; }
.bx-slider.hidden { display: none; }
.bx-slider-mask {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.45);
}
.bx-slider-panel {
  position: relative;
  margin-left: auto;
  width: min(760px, 100vw);
  max-width: 100%;
  background: #fff;
  box-shadow: -8px 0 40px rgba(33, 43, 54, .28);
  display: flex; flex-direction: column;
  animation: bxSlideIn .22s ease;
}
.bx-slider-panel.iv-wide-panel { width: min(1100px, 100vw); }
@keyframes bxSlideIn {
  from { transform: translateX(24px); opacity: .6; }
  to { transform: none; opacity: 1; }
}
.bx-slider-top {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 16px 24px 14px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  position: sticky; top: 0; z-index: 2;
}
.bx-slider-titles { flex: 1; min-width: 0; }
.bx-slider-actions {
  display: flex; align-items: center; gap: 4px;
  margin-left: auto; flex-shrink: 0;
}
.bx-help-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; box-sizing: border-box;
  border-radius: 50%;
  border: 1px solid #c6cdd3;
  background: #fff;
  color: #525c69;
  font: 700 15px/1 "Helvetica Neue", Arial, sans-serif;
  text-decoration: none;
  cursor: pointer;
}
.bx-help-btn:hover {
  border-color: #2fc6f6;
  color: #2067b0;
  background: #f5fbfe;
}
.bx-title-input {
  width: 100%; border: 0; border-bottom: 1px dashed #c6cdd3;
  font: 18px/1.3 "Helvetica Neue", Arial, sans-serif;
  color: var(--head); padding: 8px 0 10px; background: transparent;
}
.bx-title-input:focus { outline: none; border-bottom-color: var(--accent); }
.bx-slider-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.bx-icon-btn {
  width: 32px; height: 32px; border: 0; background: transparent;
  font-size: 20px; line-height: 1; color: var(--head); cursor: pointer; border-radius: 6px;
}
.bx-icon-btn:hover { background: #f0f2f4; }
.bx-more-menu {
  position: absolute; left: 12px; top: 48px; z-index: 3;
  background: #fff; border: 1px solid #d5dbe0; border-radius: 8px;
  box-shadow: var(--shadow); min-width: 200px; padding: 6px 0;
}
.bx-more-item {
  display: block; width: 100%; text-align: left; border: 0; background: none;
  padding: 8px 14px; font: 13px/1.4 inherit; cursor: pointer; color: var(--head);
}
.bx-more-item:hover { background: #f5f7f8; }
.bx-more-item.danger { color: var(--danger); }
.bx-more-empty { padding: 10px 14px; color: var(--muted); font-size: 13px; }
.bx-slider-body { flex: 1; overflow: auto; padding: 12px 0 28px; background: #fff; }
.bx-slider-foot {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 24px; border-top: 1px solid var(--line); background: #f8f9fa;
}
.bx-slider-msg { font-size: 12px; color: var(--muted); }
.bx-sec { padding: 10px 0 6px; }
.bx-sec-h {
  padding: 14px 24px 10px;
  font-size: 12px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--muted);
  background: #f6f8f9; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.bx-row {
  display: grid; grid-template-columns: 220px 1fr;
  gap: 16px; align-items: start;
  padding: 14px 24px;
  border-bottom: 1px solid #f0f2f4;
}
.bx-lab { font-size: 13px; color: var(--head); padding-top: 10px; }
.bx-hub-only {
  margin-left: 6px; font-size: 10px; font-weight: 700; letter-spacing: .04em;
  color: #8a6d3b; background: #fff4e5; border-radius: 4px; padding: 1px 5px; vertical-align: middle;
}
.bx-ctl .bx-input, .bx-ctl .inp { width: 100%; margin: 0; min-height: 38px; padding: 8px 12px; box-sizing: border-box; }
.bx-ctl select[multiple] { min-height: 110px; }
.bx-filter { margin-bottom: 6px !important; }
.bx-check { display: inline-flex; align-items: center; gap: 8px; padding-top: 8px; font-size: 13px; }
.bx-jr-list {
  max-height: 280px; overflow: auto;
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
.bx-jr .portal-filters { flex-wrap: wrap; margin-bottom: 6px; }
.bx-picker-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 6px;
}
.bx-picker-legend {
  display: flex; flex-wrap: wrap; gap: 10px; font-size: 11px; color: var(--muted); margin: 0 0 6px;
}
.bx-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px;
  vertical-align: middle; background: var(--muted);
}
.bx-dot.ok { background: var(--ok); }
.bx-dot.danger { background: var(--danger); }
.bx-dot.muted { background: var(--muted); }
.bx-jr-row {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px 7px 8px; border-bottom: 1px solid #f0f2f4; font-size: 13px; cursor: pointer;
  border-left: 3px solid transparent;
}
.bx-jr-row:last-child { border-bottom: 0; }
.bx-jr-row:hover { background: #f5f9fc; }
.bx-jr-row.life-active { border-left-color: var(--ok); }
.bx-jr-row.life-archived { border-left-color: var(--muted); color: var(--muted); }
.bx-jr-row.is-urgent { border-left-color: var(--danger); background: var(--danger-bg); }
.bx-jr-row.is-urgent:hover { background: #ffd9d7; }
.bx-jr-title { flex: 1; min-width: 0; color: var(--head); }
.bx-jr-row.life-archived .bx-jr-title { color: var(--muted); }
.bx-jr-meta { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bx-jr-hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.bx-auto-link {
  min-height: 36px; padding: 8px 10px; border-radius: 8px;
  background: #f5f8fb; color: var(--head); font-size: 13px; line-height: 1.35;
}
.bx-confirm {
  position: absolute; inset: 0; z-index: 4;
  background: rgba(0,0,0,.35);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.bx-confirm.hidden { display: none; }
.bx-confirm-card {
  background: #fff; border-radius: 12px; padding: 18px 20px; width: min(480px, 100%);
  box-shadow: var(--shadow);
}
.bx-confirm-h { font-size: 18px; font-weight: 600; color: var(--head); margin-bottom: 8px; }
.bx-confirm-list { margin: 8px 0 12px; padding-left: 18px; color: var(--head); }
.bx-confirm-warn { color: var(--warn); font-size: 13px; }
.bx-confirm-actions { display: flex; gap: 8px; margin-top: 14px; }
@media (max-width: 900px) {
  .bx-slider-panel { width: 100%; }
  .bx-more-menu { left: 12px; }
  .bx-row { grid-template-columns: 1fr; gap: 4px; }
}
@media (max-width: 900px) {
  .portal-body { flex-direction: column; }
  .portal-nav { width: 100%; flex: none; flex-direction: row; flex-wrap: wrap; }
  .portal-stats { grid-template-columns: 1fr 1fr; }
}
body.hub-embed-slider .portal-nav { display: none; }
body.hub-embed-slider .portal-main { width: 100%; }
body.hub-slider-page {
  margin: 0; padding: 0; background: #fff; min-height: 100vh;
  font: 13px/1.4 "Helvetica Neue", Arial, sans-serif; color: var(--head);
}
body.hub-slider-page .hub-slider-shell {
  display: flex; flex-direction: column; min-height: 100vh; position: relative;
}
body.hub-slider-page .hub-slider-body {
  flex: 1; overflow: auto; padding: 12px 16px 16px;
  position: relative;
}
body.hub-slider-page .bx-slider-top,
body.hub-slider-page .bx-slider-foot {
  flex-shrink: 0;
}
body.hub-slider-page .bx-jr-list { max-height: calc(100vh - 220px); }
body.hub-slider-page .filter-wrap.pick-filter {
  position: relative;
  padding: 0 0 8px;
  max-width: none;
  z-index: 50;
  overflow: visible;
}
body.hub-slider-page .pick-hint { margin: 0 0 10px; }
body.hub-slider-page .pick-table { max-height: calc(100vh - 220px); overflow: auto; background: #fff; }
body.hub-slider-page .pick-table .main-grid,
body.hub-slider-page .pick-grid { min-width: 640px; }
body.hub-slider-page .pick-grid th {
  background: #fff;
  color: #525c69;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 16px 10px;
  border-bottom: 1px solid #e6e9ec;
  cursor: default;
}
body.hub-slider-page .pick-grid td {
  padding: 14px 16px;
  font-size: 14px;
  color: #333;
  border-bottom: 1px solid #edeef0;
  vertical-align: top;
}
body.hub-slider-page .pick-grid .col-id {
  width: 72px;
  color: #a8adb4;
  font-size: 13px;
}
body.hub-slider-page .pick-ent .crm-link { font-size: 14px; font-weight: 400; }
body.hub-slider-page .pick-ent .cell-sub { margin-top: 3px; font-size: 12px; }
body.hub-slider-page .pick-ent .uf-line-chips { margin-top: 6px; }
body.hub-slider-page .pick-grid .col-people { width: 240px; min-width: 210px; }
.pick-people { display: flex; flex-direction: column; gap: 8px; }
.pick-person {
  display: flex; align-items: center; gap: 8px; min-width: 0;
}
.pick-person.empty { opacity: .55; }
.pick-ava {
  width: 32px; height: 32px; border-radius: 50%;
  background: #2fc6f6; color: #fff; display: inline-flex;
  align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0; overflow: hidden;
}
.pick-ava img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pick-person-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.pick-person-role {
  font-size: 10px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: #a8adb4;
}
.pick-person-name {
  font-size: 13px; color: #333;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 160px;
}
body.hub-slider-page .pick-grid tbody tr:hover td { background: #f5f9fc; }
body.hub-slider-page .popup-filter {
  left: 0; right: 0; width: auto; max-width: none;
  border-radius: 12px;
  box-shadow: 0 18px 40px rgba(33,43,54,.18);
  max-height: min(70vh, 560px);
  overflow: hidden;
}
body.hub-slider-page .popup-filter.open {
  grid-template-columns: 168px 1fr;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 220px;
}
body.hub-slider-page .popup-fields {
  grid-template-columns: 1fr;
  padding: 16px 18px 10px;
  gap: 14px;
  overflow: auto;
  min-height: 0;
  max-height: none;
}
body.hub-slider-page .popup-presets {
  overflow: auto;
  min-height: 0;
}
body.hub-slider-page .popup-fields .field label {
  font-size: 13px;
  color: #525c69;
  margin-bottom: 8px;
}
body.hub-slider-page .pick-filter .main-ui-filter-search {
  min-height: 40px;
}
.pick-dates {
  display: flex; align-items: center; gap: 8px;
}
.pick-dates input[type="date"] {
  flex: 1; min-width: 0; height: 36px;
  border: 1px solid #c6cdd3; border-radius: 8px;
  padding: 0 10px; font-size: 13px; background: #fff; color: var(--text);
}
th.pick-sort { cursor: pointer; user-select: none; }
th.pick-sort:hover { color: var(--link); }
body.hub-slider-page .pick-grid .col-date { width: 118px; white-space: nowrap; }
body.hub-slider-page .pick-grid .col-plat { width: 120px; }
body.hub-slider-page .pick-grid .uf-meta-chip.req { max-width: 260px; }
body.hub-slider-page .pick-grid .col-qty { width: 120px; white-space: nowrap; }
.uf-link { color: var(--link); cursor: pointer; }
.uf-link:hover { text-decoration: underline; }
.uf-pick-btn {
  display: inline-flex; align-items: center; gap: 4px;
  border: 1px solid #c6cdd3; background: #fff; color: var(--link);
  border-radius: 2px; padding: 4px 10px; font-size: 13px; cursor: pointer;
  text-align: left;
}
.uf-pick-btn:hover { background: #f5f9fc; }
.uf-pick-inline {
  margin-top: 0; border: 0; background: transparent; padding: 0;
  color: var(--link); font-size: 12px; flex-shrink: 0;
}
.uf-pick-inline:hover { text-decoration: underline; background: transparent; }
button.bx-jr-row {
  width: 100%; border: 0; background: transparent; text-align: left;
}

/* Shift exit — align with interview slider */
.sh-section { margin: 0 0 16px; }
.sh-ro-box {
  border: 1px solid #d5dbe0;
  background: #fff;
  border-radius: 4px;
  padding: 10px 12px;
  min-height: 44px;
}
.sh-ro-person { pointer-events: none; }
.sh-ro-person .pick-person-name {
  max-width: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--head);
  white-space: normal;
}
.sh-ro-person .pick-person-role {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.sh-ro-meta {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #eef0f3;
  font-size: 12px;
  color: var(--muted);
}
.sh-date-picked {
  font-size: 15px;
  font-weight: 600;
  color: var(--head);
  margin: 0 0 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eef0f3;
}
.sh-date-picked.muted {
  font-weight: 400;
  color: var(--muted);
}
.sh-form-card {
  border: 1px solid #dfe3e6;
  background: #fff;
  border-radius: 8px;
  padding: 12px 14px 14px;
}
.sh-field {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 0 0 4px;
  padding: 8px 10px;
  font: inherit;
  font-size: 13px;
  border: 1px solid #c6cdd3;
  border-radius: 6px;
  background: #fff;
  color: var(--head);
}
.sh-field:focus {
  outline: none;
  border-color: #2fc6f6;
  box-shadow: 0 0 0 2px rgba(47, 198, 246, 0.2);
}
.sh-anchor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 4px;
}
.sh-pass-row { display: flex; gap: 8px; }
.sh-pass-row .sh-field:first-child { width: 34%; flex: 0 0 34%; }
.sh-pass-row .sh-field:last-child { flex: 1; }
.sh-obj-pick {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
  margin-top: 6px;
}
.sh-obj-card {
  min-height: 56px;
  text-align: left;
  padding: 10px 12px;
}
.sh-obj-card.on {
  border-color: var(--accent, #2fc6f6);
  background: #f3fbfe;
  box-shadow: inset 0 0 0 1px var(--accent, #2fc6f6);
}
.sh-obj-card .iv-kind-title { font-size: 14px; }
.sh-cal-card {
  border: 1px solid #dfe3e6;
  background: #fff;
  border-radius: 8px;
  padding: 12px;
  max-width: 340px;
  margin-top: 8px;
}
.sh-cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.sh-cal-label { font-weight: 600; text-transform: capitalize; color: var(--head); }
.sh-cal-dow {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  margin-bottom: 6px;
}
.sh-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.sh-cal-cell {
  border: 1px solid #d5dbe0;
  background: #fff;
  border-radius: 6px;
  padding: 8px 0;
  font-size: 13px;
  cursor: pointer;
  color: var(--head);
}
.sh-cal-cell.empty { border: 0; background: transparent; cursor: default; }
.sh-cal-cell.dis { opacity: .35; cursor: default; background: #f3f4f6; }
.sh-cal-cell.sel {
  background: #e8f6fc;
  border-color: #2fc6f6;
  font-weight: 700;
}
.sh-cal-cell.in-range {
  background: #eef9fd;
  border-color: #b8e8f8;
}
.sh-cal-cell.range-start,
.sh-cal-cell.range-end {
  background: #e8f6fc;
  border-color: #2fc6f6;
  font-weight: 700;
}
.sh-cal-cell:not(.dis):not(.empty):hover { border-color: #2fc6f6; }
.sh-cal-hint {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--muted);
}
@media (max-width: 560px) {
  .sh-anchor-grid { grid-template-columns: 1fr; }
  .sh-cal-card { max-width: none; }
}

/* Period control — двухколоночный layout */
.pc-split {
  display: grid;
  grid-template-columns: 1fr min(340px, 38%);
  gap: 24px;
  align-items: start;
}
@media (max-width: 820px) {
  .pc-split { grid-template-columns: 1fr; }
}
.pc-main { min-width: 0; }
.pc-side {
  background: #f8fafb;
  border: 1px solid #e8ecef;
  border-radius: 10px;
  padding: 14px 16px;
}
.pc-mode-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 8px;
}
.pc-mode-card {
  border: 2px solid #e0e4e8;
  border-radius: 10px;
  padding: 14px 16px;
  cursor: pointer;
  background: #fff;
  transition: border-color .15s, background .15s;
}
.pc-mode-card:hover { border-color: #2fc6f6; }
.pc-mode-card.sel {
  border-color: #2fc6f6;
  background: #f0faff;
}
.pc-mode-card strong { display: block; font-size: 15px; margin-bottom: 4px; }
.pc-mode-card span { font-size: 13px; color: var(--muted); line-height: 1.4; }
.pc-shift-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  max-height: 220px;
  overflow-y: auto;
}
.pc-shift-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid #eef1f3;
  font-size: 13px;
}
.pc-shift-list li:last-child { border-bottom: 0; }
.pc-shift-rm {
  border: 0;
  background: transparent;
  color: #e53935;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 0 4px;
}
.pc-range-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-end;
  margin: 12px 0 0;
}
.pc-range-quick label { font-size: 12px; color: var(--muted); display: block; margin-bottom: 4px; }
.pc-range-quick input[type=date] {
  padding: 6px 8px;
  border: 1px solid #d5dbe0;
  border-radius: 6px;
  font-size: 13px;
}
.pc-context-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  font-size: 13px;
  border-bottom: 1px solid #eef1f3;
}
.pc-context-row:last-child { border-bottom: 0; }
.pc-context-lbl { color: var(--muted); flex-shrink: 0; }
.sh-cal-cell.in-range { background: #eef9fd; border-color: #b8e8f8; }

/* JR coverage grid */
.cg-head {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin-bottom: 12px;
}
.cg-stat { text-align: center; min-width: 64px; }
.cg-stat-n { display: block; font-size: 20px; font-weight: 700; color: var(--head); }
.cg-stat-l { font-size: 11px; color: var(--muted); text-transform: lowercase; }
.cg-list { max-height: 280px; overflow-y: auto; }
.cg-list-compact { max-height: 200px; }
.cg-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 6px;
  margin-bottom: 4px;
  font-size: 13px;
  background: #fff;
  border: 1px solid #e8ecef;
}
.cg-row.cg-busy { opacity: 0.55; pointer-events: none; }
.cg-row.cg-st-fulfilled { border-left: 3px solid #4caf50; }
.cg-row.cg-st-gap { border-left: 3px solid #ef5350; }
.cg-row.cg-st-waived { border-left: 3px solid #9e9e9e; }
.cg-row.cg-st-assigned { border-left: 3px solid #2fc6f6; }
.cg-row.cg-st-planned { border-left: 3px solid #cfd8dc; }
.cg-st { font-weight: 600; color: var(--head); }
.cg-deal { grid-column: 1 / -1; font-size: 11px; color: var(--muted); }
.cg-mo-hint { margin: 0 0 8px; font-size: 12px; }
.cg-actions { display: flex; gap: 4px; }
.cg-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 6px;
  border: 1px solid #dfe3e6;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}
.cg-btn:hover { background: #f5f7f8; }
.cg-btn:disabled { opacity: 0.4; cursor: default; }
.cg-btn-ok { color: #2e7d32; border-color: #a5d6a7; }
.cg-btn-gap { color: #c62828; border-color: #ef9a9a; }
.cg-btn-waive { color: #616161; }
.cg-done { color: #2e7d32; font-weight: 700; font-size: 16px; }
.jr-coverage-block { margin-top: 20px; padding-top: 16px; border-top: 1px solid #e8ecef; }

.ph-stepbar-wrap { padding: 8px 24px 0; background: var(--bx-bg, #fff); }
.ph-stepbar__list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.ph-step {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #828b95;
}
.ph-step--current { color: #2fc6f6; font-weight: 600; }
.ph-step--done { color: #9dcf00; }
.ph-step__n {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid currentColor;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}

/* Electronic timesheet — table + range bar.
   Filter: Hub canon. Nav arrows: iv-nav-btn / iv-nav-pair. */
.ts-board { display: flex; flex-direction: column; min-height: 0; }
.ts-range-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px 14px;
  margin: 10px 0 4px;
  min-height: 36px;
}
.ts-range-info { min-width: 0; flex: 0 1 200px; }
.ts-range-bar .sh-cal-label {
  font-size: 15px;
  font-weight: 600;
  text-transform: none;
  color: var(--head, #333);
  line-height: 1.3;
}
.ts-range-bar .hint { margin: 2px 0 0; }
.ts-range-bar .iv-nav-pair { margin-left: 0; flex: 0 0 auto; align-self: center; }

/* Legend in free space of range bar: ≤2 rows, multi-column; hide when narrow */
.ts-legend-inline {
  flex: 1 1 220px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, max-content));
  grid-auto-flow: row;
  gap: 2px 10px;
  align-content: start;
  max-height: 40px;
  overflow: hidden;
  font-size: 10px;
  color: #828b95;
  min-width: 0;
}
.ts-legend-inline .ts-legend-item { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.ts-legend-inline .ts-legend-lbl { line-height: 1.15; }
.ts-legend-inline .ts-code-chip {
  min-width: 18px; height: 15px; padding: 0 4px; border-radius: 8px; font-size: 10px;
}
@media (max-width: 900px) {
  .ts-legend-inline { display: none; }
}

.ts-scroll {
  overflow: auto; max-width: 100%; border: 1px solid #e0e4e8; border-radius: 8px;
  background: #fff; margin-top: 6px; max-height: calc(100vh - 280px);
}
.ts-table { border-collapse: separate; border-spacing: 0; font-size: 12px; min-width: 100%; }
.ts-table th, .ts-table td { border-bottom: 1px solid #eef1f4; padding: 6px 4px; text-align: center; vertical-align: middle; }
.ts-table thead th { position: sticky; top: 0; background: #f7f9fb; z-index: 2; font-weight: 600; color: #525c69; }
.ts-col-name, .ts-col-pos { text-align: left !important; position: sticky; left: 0; background: #fff; z-index: 1; min-width: 160px; padding-left: 10px !important; }
.ts-col-pos { left: 160px; min-width: 120px; max-width: 160px; color: #828b95; }
.ts-table thead .ts-col-name, .ts-table thead .ts-col-pos { z-index: 3; background: #f7f9fb; }
.ts-d-wnum {
  display: block; font-size: 9px; font-weight: 700; color: #106ebb; line-height: 1.1; margin-bottom: 1px;
}
.ts-d-wnum-sp { visibility: hidden; }
.ts-d-n { display: block; font-weight: 700; }
.ts-d-w { display: block; font-size: 10px; color: #a8adb4; text-transform: lowercase; }

/* Weekend: soft fill + subtle outer edge (1px, muted) */
.ts-day.ts-weekend,
.ts-cell.ts-weekend {
  background: #fdf6f5;
}
.ts-day.ts-weekend .ts-d-w { color: #c27a72; }
.ts-day.ts-weekend .ts-d-wnum { color: #c27a72; }
.ts-day.ts-weekend-start,
.ts-cell.ts-weekend-start {
  box-shadow: inset 1px 0 0 rgba(192, 122, 114, 0.45);
}
.ts-day.ts-weekend-end,
.ts-cell.ts-weekend-end {
  box-shadow: inset -1px 0 0 rgba(192, 122, 114, 0.45);
}
.ts-day.ts-weekend-start.ts-weekend-end,
.ts-cell.ts-weekend-start.ts-weekend-end {
  box-shadow:
    inset 1px 0 0 rgba(192, 122, 114, 0.45),
    inset -1px 0 0 rgba(192, 122, 114, 0.45);
}

.ts-code-chip {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 18px; padding: 0 5px; border-radius: 9px;
  font-size: 11px; font-weight: 700; line-height: 1; border: 1px solid transparent;
}
.ts-kind-present { background: #e8f5e9; color: #2e7d32; border-color: #a5d6a7; }
.ts-kind-off { background: #f0f3f5; color: #616161; border-color: #cfd8dc; }
.ts-kind-absence { background: #ffebee; color: #c62828; border-color: #ef9a9a; }
.ts-kind-empty { background: #f5f5f5; color: #9e9e9e; border-color: #e0e0e0; }

.ts-code-btn {
  min-width: 32px; height: 28px; border: 1px solid #dfe3e8; border-radius: 6px;
  background: #fff; cursor: pointer; font-weight: 700; font-size: 12px; padding: 0 4px;
}
.ts-code-btn:hover { border-color: #2fc6f6; }
.ts-code-btn:disabled { cursor: default; opacity: 0.85; }
.ts-present .ts-code-btn { background: #e8f5e9; border-color: #a5d6a7; color: #2e7d32; }
.ts-absence .ts-code-btn { background: #ffebee; border-color: #ef9a9a; color: #c62828; }
.ts-off .ts-code-btn { background: #f5f5f5; color: #757575; }
.ts-empty .ts-code-btn { color: #c0c4c9; font-weight: 400; }
.ts-hl td { background: #f0fbff; }
.ts-hl .ts-col-name, .ts-hl .ts-col-pos { background: #f0fbff; }
.ts-demo-row td { opacity: 0.92; }
.ts-name-line { font-weight: 600; color: #333; }
.ts-col-name .uf-line-chips { margin-top: 4px; }
.ts-busy { opacity: 0.5; }
.ts-menu {
  position: fixed; z-index: 10050; max-height: 300px; overflow: auto; width: 280px;
  background: #fff; border: 1px solid #c6cdd3; border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12); padding: 4px;
}
.ts-menu.hidden { display: none; }
.ts-menu-item {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  border: 0; background: transparent; padding: 7px 10px; border-radius: 6px;
  cursor: pointer; font-size: 13px; color: #333;
}
.ts-menu-item:hover { background: #f0f7fc; }
.ts-menu-item .ts-code-chip { flex: 0 0 auto; }

/* Fullscreen board (works in Bitrix iframe; Esc to exit) */
body.ts-fs-body { overflow: hidden; }
.ts-board.ts-fs-on {
  position: fixed;
  inset: 0;
  z-index: 10040;
  background: #fff;
  padding: 12px 16px 16px;
  box-sizing: border-box;
}
.ts-board.ts-fs-on .ts-scroll {
  flex: 1 1 auto;
  max-height: none;
  height: calc(100vh - 72px);
  margin-top: 8px;
}
.ts-board.ts-fs-on .ts-range-bar { margin-top: 0; }
.ts-board.ts-fs-on .ts-legend-inline { display: grid; }

.ts-strip { margin: 0 0 12px; padding: 10px 12px; border-radius: 8px; font-size: 13px; }
.ts-strip-warn { background: #fff8e1; border: 1px solid #ffe082; }
.ts-strip-ok { background: #e8f5e9; border: 1px solid #a5d6a7; color: #2e7d32; }
.ts-strip-title { font-weight: 600; margin-bottom: 6px; }
.ts-strip-row { margin-top: 6px; }
.ts-strip-dates { font-size: 12px; color: #525c69; margin-top: 2px; }
.ts-meta { font-size: 13px; margin: 0 0 8px; color: #525c69; }

