/* Екраните на агенцията (DESIGN-PASS-3, етап 6): общите части на екипа – горната лента извън планера (wsPageHead),
   панели с редове (ws-panel / ws-row / ws-date), значката „нови заявки“, Началото на екипа (staff-home.js).
   Само токените от style.css :root, theme.css и workspace.css; без сурови цветове. Зарежда се след workspace.css.
   Всички :hover – зад (hover: hover) and (pointer: fine) (mobile-native §1); натискане – :active (§5). */
:root {
  --ws-date-w: 44px; /* плочката с датата в редовете (ден + ден от седмицата) */
  --ws-panel-head-h: 56px; /* заглавният ред на панел */
  --ws-panel-rows: 5; /* най-много редове в панел, после „Всички“ (staff-home.js чете стойността) */
}

/* ---------- Горна лента на страниците на екипа (DP3-01) ----------
   Заглавната зона живее в лентата (както в планера, d373bc51); в съдържанието не заема място. */
/* Специфичност над „.ws-stop:has(> .ws-shead:only-child)“ от workspace.css (там е -24 px за мрежата на #pl-body). */
body.ws #ws-page-top.ws-stop.ws-page-top,
body.ws main #ws-page-top.ws-stop.ws-page-top:has(> .ws-shead:only-child) {
  display: block;
  height: 0;
  margin: 0;
  padding: 0;
}
body.ws.ws-has-pagehead #ws-title {
  visibility: hidden;
}
body.ws .ws-shead-sub .sh-sub-phone {
  display: none;
}
@media (max-width: 760px) {
  body.ws .ws-shead-sub .sh-sub-desk {
    display: none;
  }
  body.ws .ws-shead-sub .sh-sub-phone {
    display: inline;
  }
}

/* ---------- Чипове: форма + текст, не само цвят (UUPM color-not-only) ---------- */
body.ws-staff .ws-chip--ok::before,
body.ws-staff .ws-chip--wait::before,
body.ws-staff .ws-chip--off::before {
  content: '';
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
body.ws-staff .ws-chip--wait {
  background: var(--ws-accent-wash);
}
body.ws-staff .ws-chip--wait::before {
  width: 7px;
  height: 7px;
  box-sizing: border-box;
  background: transparent;
  border: 1.5px solid currentColor;
}
body.ws-staff .ws-chip--off::before {
  width: 8px;
  height: 2px;
  border-radius: 1px;
}
/* Източник („LXVNT“, „от екипа“) – контурен, по-нисък. */
body.ws-staff .ws-chip--src {
  min-height: 20px;
  padding: 0 8px;
  border: 1px solid var(--ws-accent-line);
  background: transparent;
  color: var(--ws-accent-ink);
  font-size: 11px;
  letter-spacing: 0.02em;
}

/* ---------- Панел с редове (DESIGN-PASS-3 т. 2.6) ---------- */
body.ws-staff .ws-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--ws-radius-md);
  background: var(--paper);
}
body.ws-staff .ws-panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--ws-panel-head-h);
  padding: 12px 12px 12px 20px;
  box-sizing: border-box;
  border-bottom: 1px solid var(--ws-divider);
}
body.ws-staff .ws-panel-head h2 {
  margin: 0;
  font: 500 18px/24px var(--font-display);
  color: var(--ink);
  letter-spacing: 0;
  text-transform: none;
}
body.ws-staff .ws-panel-count {
  font: 500 13px/1 var(--font-body);
  font-variant-numeric: tabular-nums;
  color: var(--ink-muted);
  white-space: nowrap;
}
body.ws-staff .ws-panel-more {
  margin-left: auto;
  padding: 0 8px;
}
body.ws-staff .ws-panel-more svg,
body.ws-staff .ws-panel-foot .ws-link svg {
  width: 16px;
  height: 16px;
}
body.ws-staff .ws-panel-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 16px;
  margin-top: auto;
  padding: 12px 20px;
  border-top: 1px solid var(--ws-divider);
  border-radius: 0 0 var(--ws-radius-md) var(--ws-radius-md);
  background: var(--cream);
  font: 400 13px/18px var(--font-body);
  color: var(--ink-muted);
}
body.ws-staff .ws-panel-foot b {
  color: var(--ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
body.ws-staff .ws-panel-group {
  margin: 0;
  padding: 12px 20px 4px;
  font: 600 13px/18px var(--font-body);
  color: var(--ink-muted);
}
body.ws-staff .ws-panel-empty {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin: 0;
  padding: 20px;
  font: 400 14px/20px var(--font-body);
  color: var(--ink-muted);
}
body.ws-staff .ws-panel-empty p {
  margin: 0;
}
body.ws-staff .ws-rows {
  margin: 0;
  padding: 0;
  list-style: none;
}
body.ws-staff .ws-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: var(--ws-row-h);
  margin: 0;
  padding: 10px 12px 10px 20px;
  box-sizing: border-box;
  border-top: 1px solid var(--ws-divider);
  transition: background-color var(--ws-dur-1) ease;
}
body.ws-staff .ws-rows > .ws-row:first-child {
  border-top: 0;
}
body.ws-staff .ws-row:has(> .ws-date) {
  grid-template-columns: var(--ws-date-w) minmax(0, 1fr) auto;
}
body.ws-staff .ws-row-main {
  min-width: 0;
}
body.ws-staff .ws-row-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 8px;
  margin: 0;
  font: 600 15px/20px var(--font-body);
  color: var(--ink);
}
body.ws-staff .ws-row-title > span:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}
body.ws-staff .ws-row-sub {
  margin: 0;
  font: 400 13px/18px var(--font-body);
  color: var(--ink-muted);
  overflow-wrap: anywhere;
}
body.ws-staff .ws-row-end {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
/* Целият ред е връзка (под съдържанието); бутоните в реда са над нея. */
body.ws-staff .ws-row-link {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  cursor: pointer;
}
body.ws-staff .ws-row-link:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--gold-ink);
}
body.ws-staff .ws-row > :not(.ws-row-link) {
  position: relative;
  z-index: 1;
}
/* Отвореното меню „⋯“ е в клетка със собствен слой (z-index: 1) – без това следващите редове се рисуват върху него.
   3 = над клетките (1) и месеца (.ev-month, 2), но под горната лента (19). */
body.ws-staff .ws-row > :not(.ws-row-link):has(details[open]) {
  z-index: 3;
}
body.ws-staff .ws-row > .ws-row-main,
body.ws-staff .ws-row > .ws-date {
  pointer-events: none;
}
body.ws-staff .ws-row:has(> .ws-row-link:active) {
  background: var(--ws-accent-wash);
}
@media (hover: hover) and (pointer: fine) {
  body.ws-staff .ws-row:has(> .ws-row-link):hover {
    background: var(--ws-accent-wash);
  }
}
body.ws-staff .ws-amt {
  font: 600 14px/20px var(--font-body);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  text-align: right;
  white-space: nowrap;
}
body.ws-staff .ws-amt small {
  display: block;
  font: 400 12px/16px var(--font-body);
  color: var(--ink-muted);
}
/* Плочка с датата: ден Lora 19, ден от седмицата 11/600. --soon – тази седмица. */
body.ws-staff .ws-date {
  display: grid;
  justify-items: center;
  align-content: center;
  width: var(--ws-date-w);
  height: 48px;
  box-sizing: border-box;
  border: 1px solid var(--ws-divider);
  border-radius: var(--ws-radius-sm);
  background: var(--paper);
}
body.ws-staff .ws-date b {
  font: 500 19px/20px var(--font-display);
  font-variant-numeric: lining-nums;
  color: var(--ink);
}
body.ws-staff .ws-date span {
  font: 600 11px/14px var(--font-body);
  color: var(--ink-muted);
}
body.ws-staff .ws-date--soon {
  border-color: var(--ws-accent-line);
  background: var(--ws-accent-wash);
}
body.ws-staff .ws-date--soon span {
  color: var(--ws-accent-ink);
}
@media (max-width: 760px) {
  body.ws-staff .ws-panel-head {
    padding: 10px 8px 10px 16px;
  }
  body.ws-staff .ws-panel-group {
    padding: 10px 16px 2px;
  }
  body.ws-staff .ws-panel-foot {
    padding: 12px 16px;
  }
  body.ws-staff .ws-panel-empty {
    padding: 16px;
  }
  body.ws-staff .ws-row {
    gap: 12px;
    min-height: var(--ws-row-h-touch);
    padding: 10px 8px 10px 16px;
  }
}
@media (min-width: 1280px) {
  body.ws-staff .ws-panel-head h2 {
    font-size: 20px;
  }
}

/* ---------- Началото на екипа (staff-home.js) ---------- */
/* Старото начало (календарът, „Предстоящи“, „Заявки за визия“) не се показва – то е в „Календар“ и „Оферти и заявки“. */
body.ws-staff-home #workspace > :not(#staff-home, #ws-page-top) {
  display: none;
}
body.ws #staff-home {
  container: sh / inline-size;
  display: grid;
  gap: 16px;
}
body.ws #staff-home .sh-top {
  display: grid;
  gap: 16px;
}
body.ws .sh-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
}
/* 12 колони (7/5) щом съдържанието е поне 840 px (1440, 1280 и 1024 с релсата); редът е с еднаква височина. */
@container sh (min-width: 840px) {
  body.ws .sh-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 16px;
  }
  body.ws .sh-grid > .ws-panel:nth-child(odd) {
    grid-column: span 7;
  }
  body.ws .sh-grid > .ws-panel:nth-child(even) {
    grid-column: span 5;
  }
  body.ws .sh-grid > .ws-panel:nth-child(odd):last-child {
    grid-column: 1 / -1;
  }
}
@container sh (min-width: 1100px) {
  body.ws .sh-grid,
  body.ws #staff-home {
    gap: 24px;
  }
  body.ws #staff-home .sh-top {
    gap: 16px;
  }
}
/* Горната лента: „Ново ▾“ на компютър, „+“ (лист) на телефон. */
body.ws .sh-new-phone {
  display: none;
}
body.ws .sh-new-btn {
  min-height: 40px;
  padding: 0 16px 0 18px;
}
body.ws .sh-new-btn svg {
  transition: transform var(--ws-dur-2) var(--ws-ease);
}
body.ws .sh-new-btn[aria-expanded='true'] svg {
  transform: rotate(180deg);
}
body.ws .sh-new-menu {
  transform-origin: top right;
}
body.ws .sh-new-menu .sh-new-item span {
  display: grid;
}
body.ws .sh-new-menu .sh-new-item small {
  font: 400 12px/16px var(--font-body);
  color: var(--ink-muted);
}
body.ws .sh-new-menu .sh-new-item svg {
  color: var(--ink-muted);
}
@media (max-width: 760px) {
  body.ws .sh-new-wrap {
    display: none;
  }
  body.ws .sh-new-phone {
    display: inline-grid;
  }
}
/* Лист „Ново“ (телефон). */
body.ws dialog.sh-sheet {
  display: none;
}
body.ws dialog.sh-sheet[open] {
  display: grid;
  gap: 0;
}
body.ws dialog.sh-sheet h2 {
  margin: 0 0 4px;
  padding: 0 4px 4px;
}
body.ws dialog.sh-sheet a {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 56px;
  padding: 0 4px;
  border-top: 1px solid var(--ws-divider);
  color: var(--ink);
  font: 500 15px/1.3 var(--font-body);
  text-decoration: none;
  touch-action: manipulation;
}
body.ws dialog.sh-sheet a span {
  display: grid;
}
body.ws dialog.sh-sheet a small {
  font: 400 12px/16px var(--font-body);
  color: var(--ink-muted);
}
body.ws dialog.sh-sheet a svg {
  width: 20px;
  height: 20px;
  color: var(--ws-accent-ink);
}
body.ws dialog.sh-sheet a:active {
  background: var(--ws-accent-wash);
}
body.ws dialog.sh-sheet .ws-btn {
  margin-top: 8px;
  min-height: 48px;
}

/* KPI: на телефон подредът е скрит, затова предупреждението е иконка до етикета (не само цвят). */
body.ws .ws-kpi-flag {
  display: none;
}
@media (max-width: 760px) {
  body.ws-staff .ws-kpi--warn .ws-kpi-flag {
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-left: 6px;
    vertical-align: -2px;
    color: var(--rose);
  }
}
body.ws-staff .ws-kpi-meta .ws-ico {
  width: 14px;
  height: 14px;
  margin-right: 4px;
  vertical-align: -2px;
  color: var(--rose);
}
body.ws-staff .ws-kpi--warn .ws-kpi-meta {
  color: var(--ink-on-blush);
}
body.ws #staff-home .ws-kpi.ws-skel {
  min-height: var(--ws-kpi-h);
  border-color: transparent;
}
body.ws .sh-skel-title {
  display: block;
  width: 40%;
  height: 20px;
}
body.ws .sh-skel-line {
  display: block;
  grid-column: 1 / -1;
  height: 20px;
}

/* Нови заявки: кога + „Обади се“ + „Прегледай“. */
body.ws .sh-when {
  font: 500 12px/16px var(--font-body);
  color: var(--ink-muted);
  text-align: right;
  white-space: nowrap;
}
body.ws .sh-when b {
  display: block;
  font-weight: 600;
  color: var(--ws-accent-ink);
}
body.ws .sh-call {
  gap: 8px;
}
body.ws .sh-call svg {
  width: 18px;
  height: 18px;
}
/* На компютър „Обади се“ е иконка 40 px (на тъч 44); текстът е за екранния четец (aria-label). */
@media (min-width: 761px) {
  body.ws .sh-req-row .sh-call {
    width: 40px;
    min-width: 40px;
    min-height: 40px;
    padding: 0;
    border-color: transparent;
    color: var(--ink-muted);
  }
  body.ws .sh-req-row .sh-call span {
    display: none;
  }
}
@media (min-width: 761px) and (pointer: coarse) {
  body.ws .sh-req-row .sh-call {
    width: 44px;
    min-height: 44px;
  }
}
@media (max-width: 760px) {
  body.ws .sh-req-row {
    grid-template-columns: 1fr 1fr;
    gap: 10px 8px;
    padding-right: 16px;
  }
  body.ws .sh-req-row .ws-row-main {
    grid-column: 1 / -1;
    grid-row: 1;
    padding-right: 72px;
  }
  body.ws .sh-req-row .ws-row-end {
    display: contents;
  }
  body.ws .sh-req-row .sh-when {
    position: absolute;
    top: 10px;
    right: 16px;
  }
  body.ws .sh-req-row .sh-call,
  body.ws .sh-req-row .sh-review {
    min-height: 44px;
  }
  body.ws .sh-req-row .sh-review:only-of-type {
    grid-column: 1 / -1;
  }
  body.ws .sh-req-row:not(:has(.sh-call)) .sh-review {
    grid-column: 1 / -1;
  }
}
/* Плащания: името, под него чипът; сумата вдясно (еднакво на всички ширини). */
body.ws .sh-pay-row {
  grid-template-columns: minmax(0, 1fr) auto;
  row-gap: 6px;
}
body.ws .sh-pay-row > .ws-row-main {
  grid-column: 1;
  grid-row: 1;
}
body.ws .sh-pay-row > .ws-chip {
  grid-column: 1;
  grid-row: 2;
  justify-self: start;
}
body.ws .sh-pay-row > .ws-amt {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
}
/* Предстоящи събития: на телефон чипът и сумата слизат под името. */
@media (max-width: 760px) {
  body.ws .sh-ev-row {
    grid-template-columns: var(--ws-date-w) minmax(0, 1fr);
    align-items: start;
    row-gap: 6px;
  }
  body.ws .sh-ev-row > .ws-date {
    grid-row: 1 / 3;
  }
  body.ws .sh-ev-row > .ws-row-end {
    grid-column: 2;
    justify-content: space-between;
    align-items: flex-start;
  }
}
/* Задачи: отметка 44×44, заглавието се пренася, срокът вдясно (на телефон – под заглавието). */
body.ws .sh-task-row {
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 8px;
  padding-left: 8px;
}
body.ws .sh-task-row .ws-row-title {
  font-size: 14px;
  font-weight: 500;
}
body.ws .sh-check {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: 0;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}
body.ws .sh-check input {
  -webkit-appearance: none;
  appearance: none;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin: 0;
  border: 1.5px solid var(--line-strong);
  border-radius: 6px;
  background: var(--paper);
  cursor: pointer;
  transition:
    background-color var(--ws-dur-1) ease,
    border-color var(--ws-dur-1) ease;
}
body.ws .sh-check input::after {
  content: '';
  width: 10px;
  height: 6px;
  border: solid var(--paper);
  border-width: 0 0 2px 2px;
  transform: rotate(-45deg) translate(1px, -1px) scale(0);
  transition: transform var(--ws-dur-2) var(--ws-ease);
}
body.ws .sh-check input:checked {
  border-color: var(--success);
  background: var(--success);
}
body.ws .sh-check input:checked::after {
  transform: rotate(-45deg) translate(1px, -1px) scale(1);
}
body.ws .sh-check input:focus-visible {
  outline: none;
  box-shadow: var(--ws-focus);
}
body.ws .sh-task-row.is-done .ws-row-title > span:first-child {
  color: var(--ink-muted);
  text-decoration: line-through;
  text-decoration-color: var(--line-strong);
}
body.ws .sh-due {
  font: 500 12px/16px var(--font-body);
  font-variant-numeric: tabular-nums;
  color: var(--ink-muted);
  white-space: nowrap;
}
@media (max-width: 760px) {
  body.ws .sh-task-row {
    grid-template-columns: 44px minmax(0, 1fr);
    align-items: start;
    row-gap: 4px;
  }
  body.ws .sh-task-row > .sh-check {
    grid-row: 1 / 3;
  }
  body.ws .sh-task-row > :is(.ws-chip, .sh-due) {
    grid-column: 2;
    justify-self: start;
  }
}
/* Срещи и съобщения. */
body.ws .sh-meet-row {
  grid-template-columns: var(--ws-date-w) minmax(0, 1fr) auto;
}
body.ws .sh-msg-row {
  grid-template-columns: 32px minmax(0, 1fr) auto;
}
body.ws .sh-msg-ico {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--ws-accent-soft);
  color: var(--ws-accent-ink);
}
body.ws .sh-msg-ico svg {
  width: 16px;
  height: 16px;
}
body.ws .sh-msg-preview {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}
/* Телефон: „Следващо събитие“ най-горе (на компютър е в статуса на горната лента). */
body.ws .sh-next {
  display: none;
}
@media (max-width: 760px) {
  body.ws .sh-next {
    display: grid;
    gap: 4px;
    padding: 16px;
    border: 1px solid var(--ws-accent-line);
    border-radius: var(--ws-radius-lg);
    background: var(--cream);
  }
  body.ws .sh-next-when {
    font: 600 12px/16px var(--font-body);
    color: var(--ws-accent-ink);
  }
  body.ws .sh-next h2 {
    margin: 0;
    font: 500 22px/28px var(--font-display);
    color: var(--ink);
    text-wrap: balance;
  }
  body.ws .sh-next p {
    margin: 0;
    font: 400 13px/18px var(--font-body);
    color: var(--ink-muted);
  }
  body.ws .sh-next-acts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 10px;
  }
  body.ws .sh-next-acts.is-one {
    grid-template-columns: 1fr;
  }
  body.ws .sh-next-acts .ws-btn {
    min-height: 44px;
    padding: 0 12px;
  }
  body.ws #staff-home {
    gap: 12px;
    padding-bottom: calc(var(--ws-tabbar-h) + 32px + env(safe-area-inset-bottom, 0px));
  }
}
@media (prefers-reduced-motion: reduce) {
  body.ws .sh-new-btn svg,
  body.ws .sh-check input::after {
    transition: none;
  }
}

/* ---------- Двуфакторният вход (DP3-02): тънък ред вместо карта със златна лява рамка ---------- */
body.ws-staff main.portal > .ws-tfa {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: var(--ws-content-max);
  min-height: 56px;
  margin: 0 auto 16px;
  padding: 6px 6px 6px 14px;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: var(--ws-radius-md);
  background: var(--paper);
}
body.ws-staff .ws-tfa .ws-next-ico {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--ws-accent-soft);
  color: var(--ws-accent-ink);
}
body.ws-staff .ws-tfa .ws-next-ico svg {
  width: 16px;
  height: 16px;
}
body.ws-staff .ws-tfa .ws-next-text {
  margin: 0;
  font: 600 14px/20px var(--font-body);
  color: var(--ink);
}
body.ws-staff .ws-tfa .ws-next-text span {
  display: block;
  font: 400 13px/18px var(--font-body);
  color: var(--ink-muted);
}
body.ws-staff .ws-tfa-acts {
  display: flex;
  align-items: center;
  gap: 4px;
}
/* Телефон: заглавие + „×“ в първия ред, „Обнови базата“ под заглавието (без отрязан текст). */
@media (max-width: 760px) {
  body.ws-staff main.portal > .ws-tfa {
    grid-template-columns: 32px minmax(0, 1fr) 44px;
    gap: 4px 10px;
    padding: 8px 4px 10px 12px;
    margin-bottom: 12px;
  }
  body.ws-staff .ws-tfa.is-short .ws-next-text span {
    display: none;
  }
  body.ws-staff .ws-tfa-acts {
    display: contents;
  }
  body.ws-staff .ws-tfa-acts .ws-icon-btn {
    grid-column: 3;
    grid-row: 1;
  }
  body.ws-staff .ws-tfa-acts .ws-btn {
    grid-column: 2;
    grid-row: 2;
    justify-self: start;
  }
}

/* ---------- Значката „нови заявки“ (DP3-06) ---------- */
body.ws .ws-staff-menu .ws-item .ws-badge {
  margin-left: auto;
}
/* Релса (свито меню): значката е в горния десен ъгъл на иконата. */
body.ws.ws-rail .ws-staff-menu .ws-item .ws-badge,
body.ws.pl-wide .ws-staff-menu .ws-item .ws-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  font-size: 10px;
}
@media (min-width: 761px) and (max-width: 1199px) {
  body.ws:not(.ws-rail-open) .ws-staff-menu .ws-item {
    position: relative;
  }
  body.ws:not(.ws-rail-open) .ws-staff-menu .ws-item .ws-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    font-size: 10px;
  }
}
body.ws.ws-rail .ws-staff-menu .ws-item {
  position: relative;
}

/* =====================================================================================================================
   Оферти и заявки (events.php, DP3-07): пътят на заявките (7 етапа-филтъра), лента с инструменти, списък-таблица.
   ===================================================================================================================== */
body.ws #events-page {
  container: ev / inline-size;
  display: grid;
  gap: 16px;
}
/* Етапите – една лента, всеки сегмент е бутон-филтър: име + число; натиснатият – фон, долна линия и ромб (не само цвят).
   „Отказани“ е отделено вдясно с вертикален разделител. */
body.ws .ws-stages {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr)) 12px minmax(0, 0.9fr);
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--ws-radius-md);
  background: var(--paper);
}
body.ws .ws-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  min-height: 64px;
  margin: 0;
  padding: 10px 14px;
  border: 0;
  border-left: 1px solid var(--ws-divider);
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color var(--ws-dur-1) ease;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}
body.ws .ws-stage:first-child {
  border-left: 0;
}
body.ws .ws-stage.stage-rejected {
  grid-column: 8;
  border-left: 1px solid var(--line);
}
body.ws .ws-stages::after {
  content: '';
  grid-column: 7;
  grid-row: 1;
  background: var(--cream);
  border-left: 1px solid var(--line);
}
body.ws .ws-stage-name {
  font: 600 12px/16px var(--font-body);
  color: var(--ink-muted);
  overflow-wrap: anywhere;
}
body.ws .ws-stage-n {
  font: 600 20px/24px var(--font-body);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
body.ws .ws-stage[aria-pressed='true'] {
  background: var(--ws-accent-wash);
  box-shadow: inset 0 -2px 0 var(--ws-accent);
}
body.ws .ws-stage[aria-pressed='true'] .ws-stage-name {
  color: var(--ws-accent-ink);
}
body.ws .ws-stage[aria-pressed='true'] .ws-stage-name::after {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-left: 6px;
  vertical-align: middle;
  transform: rotate(45deg);
  background: var(--ws-accent-ink);
}
body.ws .ws-stage:active {
  background: var(--ws-accent-wash);
}
body.ws .ws-stage:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--gold-ink);
}
@media (hover: hover) and (pointer: fine) {
  body.ws .ws-stage:hover {
    background: var(--paper-sunk);
  }
  body.ws .ws-stage[aria-pressed='true']:hover {
    background: var(--ws-accent-wash);
  }
}
/* Лента с инструменти: търсене · период · подреди · профили · задачи. */
body.ws .ws-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 0;
}
body.ws .ws-search {
  position: relative;
  display: flex;
  align-items: center;
  flex: 0 1 320px;
  min-width: 200px;
  margin: 0;
}
body.ws .ws-search svg {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--ink-muted);
  pointer-events: none;
}
body.ws .ws-search input {
  width: 100%;
  min-height: var(--ws-ctl-h);
  margin: 0;
  padding: 0 14px 0 40px;
  border: 1px solid var(--line-strong);
  border-radius: var(--ws-radius-pill);
  background: var(--paper);
  font: 400 14px/1 var(--font-body);
}
body.ws .ws-search input:focus-visible,
body.ws .ws-select select:focus-visible {
  outline: none;
  border-color: var(--ws-accent);
  box-shadow: var(--ws-focus);
}
body.ws .ws-toolbar-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
body.ws .ws-select,
body.ws .ws-toolbar-filters > label[data-lux-kind] {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font: 500 13px/1 var(--font-body);
  color: var(--ink-muted);
}
body.ws .ws-select select,
body.ws .ws-toolbar-filters > label[data-lux-kind] select {
  min-height: var(--ws-ctl-h);
  margin: 0;
  padding: 0 32px 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--ws-radius-pill);
  background-color: var(--paper);
  color: var(--ink);
  font: 600 13px/1 var(--font-body);
}
body.ws .ws-toolbar-filters > label[data-lux-kind][hidden] {
  display: none;
}
body.ws .ws-filters-btn {
  display: none;
}
body.ws .ev-tasks-toggle {
  min-height: var(--ws-ctl-h);
  margin-left: auto;
  padding: 0 14px;
}
body.ws .ev-tasks-toggle .ws-badge {
  background: var(--paper-sunk);
  color: var(--ink);
}
body.ws .ev-tasks-toggle.has-late .ws-badge {
  background: var(--blush);
  color: var(--ink-on-blush);
}
body.ws .ev-tasks-toggle[aria-expanded='true'] {
  border-color: var(--ws-accent);
  background: var(--ws-accent-wash);
}
/* Тяло: списъкът + страничен панел със задачите (360 px), когато е отворен. */
body.ws .ev-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
body.ws #events-agenda:not(.is-open) {
  display: none;
}
@container ev (min-width: 1000px) {
  body.ws .ev-body.has-agenda {
    grid-template-columns: minmax(0, 1fr) 360px;
  }
  body.ws .ev-body.has-agenda #events-agenda {
    grid-column: 2;
    grid-row: 1;
    position: sticky;
    top: 16px;
  }
}
/* Таблица: ред 64 px, заглавен ред на месеца (Montserrat 13/600, лепкав), не Lora 24. */
body.ws .ev-table {
  border: 1px solid var(--line);
  border-radius: var(--ws-radius-md);
  background: var(--paper);
}
body.ws .ev-thead,
body.ws .ev-row {
  display: grid;
  grid-template-columns: var(--ws-date-w) minmax(0, 2fr) minmax(0, 1fr) 132px 64px 150px 104px 44px;
  align-items: center;
  column-gap: 16px;
}
body.ws .ev-thead {
  min-height: 40px;
  padding: 0 12px 0 20px;
  border-bottom: 1px solid var(--line);
  font: 600 11px/16px var(--font-body);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
body.ws .ev-thead .ev-h-sum {
  text-align: right;
}
body.ws .ev-month {
  position: sticky;
  top: 0;
  z-index: 2;
  display: block;
  margin: 0;
  padding: 8px 20px;
  border-top: 1px solid var(--line);
  background: var(--cream);
  font: 600 13px/18px var(--font-body);
  color: var(--ink);
}
body.ws .ev-group:first-of-type .ev-month,
body.ws .ev-thead + .ev-group .ev-month {
  border-top: 0;
}
body.ws .ev-month small {
  margin-left: 8px;
  font: 500 13px/18px var(--font-body);
  font-variant-numeric: tabular-nums;
  color: var(--ink-muted);
}
body.ws .ev-row.ws-row {
  min-height: 64px;
  margin: 0;
  padding: 8px 12px 8px 20px;
  border: 0;
  border-top: 1px solid var(--ws-divider);
  border-radius: 0;
  background: none;
  box-shadow: none;
}
body.ws .ev-month + .ev-row.ws-row {
  border-top: 0;
}
body.ws .ev-row > :is(.ev-c-date, .ev-c-main, .ev-c-client, .ev-c-stage, .ev-c-pipe, .ev-c-sum) {
  pointer-events: none;
}
body.ws .ev-row.stage-rejected .ws-row-title {
  color: var(--ink-muted);
}
body.ws .ev-c-client {
  font: 400 13px/18px var(--font-body);
  color: var(--ink);
  overflow-wrap: anywhere;
}
body.ws .ev-sub-client {
  display: none;
}
body.ws .ev-c-sum small {
  display: block;
}
body.ws-staff .ws-date.is-empty {
  border-style: dashed;
}
body.ws-staff .ws-date.is-empty span {
  font-size: 10px;
  line-height: 12px;
  text-align: center;
}
/* Напредък: 4 точки по 8 px (пълна / кръг / черта), текстът – в aria-label. */
body.ws .ev-dots {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
body.ws .ev-dots i {
  display: block;
  width: 8px;
  height: 8px;
  box-sizing: border-box;
  border: 1.5px solid var(--line-strong);
  border-radius: 50%;
}
body.ws .ev-dots i.is-done {
  border-color: var(--ws-accent);
  background: var(--ws-accent);
}
body.ws .ev-dots i.is-part {
  border-color: var(--ws-accent);
  background: linear-gradient(90deg, var(--ws-accent) 50%, transparent 50%);
}
body.ws .ev-dots i.is-skip {
  width: 8px;
  height: 2px;
  border: 0;
  border-radius: 1px;
  background: var(--line-strong);
}
body.ws .ev-dots i.is-current {
  box-shadow: 0 0 0 3px var(--ws-accent-soft);
  border-color: var(--ws-accent-ink);
}
body.ws .ev-dots.is-rejected i:not(.is-done) {
  border-color: var(--rose);
}
/* Задачи: компактен бутон „2/7“. */
body.ws .ev-c-tasks .ev-tasks-btn {
  min-height: 32px;
  margin: 0;
  padding: 4px 10px 4px 6px;
  font: 600 12px/1 var(--font-body);
  white-space: nowrap;
}
body.ws .ev-c-tasks .ev-tasks-btn.is-empty {
  padding-left: 10px;
}
body.ws .ev-c-tasks .ev-tasks-btn b {
  display: none;
}
/* „⋯“: иконен бутон 44 px, менюто – над съдържанието. */
body.ws .ev-c-more .ev-more summary {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--ink-muted);
}
body.ws .ev-c-more .ev-more summary svg {
  width: 20px;
  height: 20px;
}
body.ws .ev-c-more .ev-more[open] summary {
  background: var(--paper-sunk);
  color: var(--ink);
}
body.ws .ev-c-more .ev-menu {
  z-index: 30;
  border-radius: var(--ws-radius-md);
  box-shadow: var(--ws-shadow-2);
  animation: ws-pop var(--ws-dur-2) var(--ws-ease);
}
body.ws .ev-c-more .ev-menu > :is(.button, button, a) {
  min-height: 40px;
}
body.ws .ev-menu-main {
  background: var(--ink) !important;
  border-color: var(--ink) !important;
  color: var(--paper) !important;
}
@media (hover: hover) and (pointer: fine) {
  body.ws .ev-c-more .ev-more summary:hover {
    background: var(--paper-sunk);
    color: var(--ink);
  }
}
body.ws .events-hidden {
  margin: 0;
  font-size: 13px;
}
/* Средна ширина: без колоните „Клиент“ и „Напредък“ (клиентът слиза в подреда). */
@container ev (max-width: 999px) {
  body.ws .ev-thead,
  body.ws .ev-row {
    grid-template-columns: var(--ws-date-w) minmax(0, 1fr) 124px 144px 92px 44px;
  }
  body.ws :is(.ev-thead, .ev-row) > :is(.ev-c-client, .ev-c-pipe) {
    display: none;
  }
  body.ws .ev-sub-client {
    display: inline;
  }
}
/* Телефон (преглед + бързо действие): етапите – 2 реда по 4 (сегментна мрежа, без лента встрани); филтрите – зад
   „Филтри“; редът – карта: дата, имена, вид, чип вдясно; „⋯“ – действията. */
@media (max-width: 760px) {
  body.ws .ws-stages {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  body.ws .ws-stages::after {
    display: none;
  }
  body.ws .ws-stage {
    min-height: 56px;
    padding: 8px;
    border-top: 1px solid var(--ws-divider);
  }
  body.ws .ws-stage:nth-child(-n + 4) {
    border-top: 0;
  }
  body.ws .ws-stage:nth-child(4n + 1) {
    border-left: 0;
  }
  body.ws .ws-stage.stage-rejected {
    grid-column: auto;
    border-left: 1px solid var(--ws-divider);
  }
  body.ws .ws-stage-name {
    font-size: 11px;
    line-height: 14px;
    letter-spacing: -0.01em;
    overflow-wrap: normal;
    hyphens: auto;
  }
  body.ws .ws-stage-n {
    font-size: 18px;
    line-height: 22px;
  }
  body.ws .ws-search {
    flex: 1 1 auto;
    min-width: 0;
  }
  body.ws .ws-search input,
  body.ws .ws-select select,
  body.ws .ws-toolbar-filters > label[data-lux-kind] select {
    min-height: 44px;
    font-size: 16px;
  }
  body.ws .ws-filters-btn {
    display: inline-flex;
    min-height: 44px;
    padding: 0 14px;
  }
  body.ws .ws-toolbar-filters {
    display: none;
    flex: 1 1 100%;
    flex-direction: column;
    align-items: stretch;
  }
  body.ws .ws-toolbar-filters.is-open {
    display: flex;
  }
  body.ws .ws-toolbar-filters .ws-select,
  body.ws .ws-toolbar-filters > label[data-lux-kind] {
    justify-content: space-between;
  }
  body.ws .ev-tasks-toggle {
    min-height: 44px;
    margin-left: 0;
  }
  body.ws .ev-thead {
    display: none;
  }
  body.ws .ev-row.ws-row {
    grid-template-columns: var(--ws-date-w) minmax(0, 1fr) auto;
    grid-template-areas: 'date main more' 'date stage more';
    align-items: center;
    row-gap: 6px;
    min-height: 72px;
    padding: 10px 4px 10px 16px;
  }
  body.ws .ev-row > .ev-c-date {
    grid-area: date;
  }
  body.ws .ev-row > .ev-c-main {
    grid-area: main;
  }
  body.ws .ev-row > .ev-c-stage {
    grid-area: stage;
  }
  body.ws .ev-row > .ev-c-more {
    grid-area: more;
  }
  body.ws .ev-row > :is(.ev-c-client, .ev-c-pipe, .ev-c-sum, .ev-c-tasks) {
    display: none;
  }
  body.ws .ev-sub-client {
    display: none;
  }
  body.ws .ev-c-more .ev-more summary {
    width: 44px;
    height: 44px;
  }
  body.ws .ev-c-more .ev-menu {
    width: min(300px, calc(100vw - 32px));
  }
  body.ws .ev-c-more .ev-menu > :is(.button, button, a) {
    min-height: 44px;
  }
  body.ws .ev-month {
    padding: 8px 16px;
  }
}
/* По-тясно съдържание (1024 с релсата): етикетите „Период“/„Подреди“ са само за екранния четец – лентата остава на 1 ред. */
@container ev (min-width: 761px) and (max-width: 1099px) {
  body.ws .ev-toolbar .ws-select > span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  body.ws .ev-toolbar .ws-search {
    flex-basis: 240px;
  }
}

/* =====================================================================================================================
   Плащания (payments.php, DP3-11): 4 равни KPI, „Чакат капаро“ като панел с редове, „Получени плащания“ – таблица.
   ===================================================================================================================== */
body.ws #payments-page {
  display: grid;
  gap: 16px;
}
body.ws .pay-row {
  grid-template-columns: minmax(0, 1fr) auto auto auto;
}
body.ws .pay-row.is-focus {
  background: var(--ws-accent-wash);
  transition: background-color 1.2s ease 1.5s;
}
body.ws .ws-table {
  width: 100%;
  border-collapse: collapse;
  font: 400 14px/20px var(--font-body);
  color: var(--ink);
}
body.ws .ws-table th {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  font: 600 11px/16px var(--font-body);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: left;
  color: var(--ink-muted);
}
body.ws .ws-table td {
  padding: 12px;
  border-top: 1px solid var(--ws-divider);
  vertical-align: middle;
}
body.ws .ws-table :is(th, td):first-child {
  padding-left: 20px;
}
body.ws .ws-table :is(th, td):last-child {
  padding-right: 20px;
}
body.ws .ws-table td small {
  display: block;
  font-size: 12px;
  color: var(--ink-muted);
}
body.ws .ws-table a {
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}
body.ws .ws-table .ws-amt {
  text-align: right;
}
body.ws .ws-table .pay-month-h :is(th, td) {
  padding-top: 10px;
  padding-bottom: 10px;
  border-top: 1px solid var(--line);
  background: var(--cream);
  font: 600 13px/18px var(--font-body);
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
}
body.ws .pay-d {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
@media (hover: hover) and (pointer: fine) {
  body.ws .ws-table a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
  }
}
@media (max-width: 760px) {
  body.ws .pay-row {
    grid-template-columns: minmax(0, 1fr) auto;
    row-gap: 6px;
  }
  body.ws .pay-row > .ws-row-main {
    grid-column: 1;
    grid-row: 1;
  }
  body.ws .pay-row > .ws-chip {
    grid-column: 1;
    grid-row: 2;
    justify-self: start;
  }
  body.ws .pay-row > .ws-amt {
    grid-column: 2;
    grid-row: 1 / 3;
  }
  body.ws .pay-row > .pay-record {
    grid-column: 1 / -1;
    justify-self: stretch;
    min-height: 44px;
  }
  body.ws .pay-table :is(th, td):nth-child(3),
  body.ws .pay-table :is(th, td):nth-child(4) {
    display: none;
  }
  body.ws .ws-table :is(th, td):first-child {
    padding-left: 16px;
  }
  body.ws .ws-table :is(th, td):last-child {
    padding-right: 16px;
  }
}

/* =====================================================================================================================
   Календар (calendar.php, DP3-10): месецът 8/12 + „Предстоящи“ 4/12, годината – отделен изглед, филтрите – в един ред.
   ===================================================================================================================== */
body.ws[data-page='calendar'] #workspace {
  display: grid;
  gap: 16px;
  container: cal / inline-size;
}
body.ws[data-page='calendar'] #event-calendar {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
}
/* Филтрите (Статус, Вид събитие, Профили) – един ред с инструменти, не карта. */
body.ws[data-page='calendar'] #page-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
}
body.ws[data-page='calendar'] #page-filters label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font: 500 13px/1 var(--font-body);
  color: var(--ink-muted);
}
body.ws[data-page='calendar'] #page-filters label[hidden] {
  display: none;
}
body.ws[data-page='calendar'] #page-filters :is(select, input) {
  min-height: var(--ws-ctl-h);
  width: auto;
  margin: 0;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--ws-radius-pill);
  background-color: var(--paper);
  color: var(--ink);
  font: 600 13px/1 var(--font-body);
}
body.ws[data-page='calendar'] #page-filters select {
  padding-right: 32px;
}
body.ws[data-page='calendar'] #page-filters input {
  width: 200px;
  font-weight: 500;
}
body.ws[data-page='calendar'] #page-filters #page-reset {
  min-height: var(--ws-ctl-h);
  margin: 0 0 0 auto;
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--ws-accent-ink);
  font: 600 13px/1 var(--font-body);
}
/* Горната лента: сегменти Месец | Година, стрелки и „Днес“. */
body.ws .ws-switch {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--ws-radius-pill);
  background: var(--paper);
}
body.ws .ws-switch button {
  min-height: 34px;
  margin: 0;
  padding: 0 14px;
  border: 0;
  border-radius: var(--ws-radius-pill);
  background: none;
  box-shadow: none;
  color: var(--ink-muted);
  font: 600 13px/1 var(--font-body);
  touch-action: manipulation;
}
body.ws .ws-switch button[aria-pressed='true'] {
  background: var(--ink);
  color: var(--paper);
}
body.ws .cal-nav {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
body.ws .cal-nav .ws-icon-btn {
  width: 40px;
  height: 40px;
  min-height: 40px;
}
@media (pointer: coarse) {
  body.ws .ws-switch button {
    min-height: 38px;
  }
  body.ws .cal-nav .ws-icon-btn {
    width: 44px;
    height: 44px;
  }
}
/* Месечният изглед. */
body.ws .cal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
@container cal (min-width: 900px) {
  body.ws .cal-layout {
    grid-template-columns: minmax(0, 8fr) minmax(0, 4fr);
    gap: 24px;
  }
  body.ws .cal-up {
    position: sticky;
    top: 16px;
  }
}
body.ws .cal-month .ws-panel-head {
  flex-wrap: wrap;
}
body.ws .cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 0 0 0 auto;
  font: 500 12px/16px var(--font-body);
  color: var(--ink-muted);
}
body.ws .cal-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
/* Формата по етап: пълна точка – потвърдено; кръг – чака; полупълна – приета (чака капаро); черта – отказано. */
body.ws :is(.cal-shape, .cal-ev > i, .cal-dots > i) {
  display: inline-block;
  flex: none;
  width: 8px;
  height: 8px;
  box-sizing: border-box;
  border: 1.5px solid var(--ws-accent);
  border-radius: 50%;
  background: transparent;
}
body.ws :is(.cal-shape, .cal-ev > i, .cal-dots > i).approved {
  border-color: var(--success);
  background: var(--success);
}
body.ws :is(.cal-shape, .cal-ev > i, .cal-dots > i).client_approved {
  border-color: var(--ws-accent);
  background: linear-gradient(90deg, var(--ws-accent) 50%, transparent 50%);
}
body.ws :is(.cal-shape, .cal-ev > i, .cal-dots > i).rejected {
  height: 2px;
  border: 0;
  border-radius: 1px;
  background: var(--rose);
}
body.ws .cal-ev.approved > i {
  border-color: var(--success);
  background: var(--success);
}
body.ws .cal-ev.client_approved > i {
  background: linear-gradient(90deg, var(--ws-accent) 50%, transparent 50%);
}
body.ws .cal-ev.rejected > i {
  height: 2px;
  border: 0;
  background: var(--rose);
}
body.ws #event-calendar .cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0;
  padding: 0;
  border: 0;
  background: none;
}
body.ws #event-calendar .cal-grid .weekday {
  padding: 10px 10px 6px;
  font: 600 11px/16px var(--font-body);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  background: none;
}
body.ws #event-calendar .cal-grid .calendar-blank {
  border-top: 1px solid var(--ws-divider);
}
body.ws #event-calendar .cal-grid .cal-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 4px;
  min-width: 0;
  min-height: 96px;
  margin: 0;
  padding: 8px;
  border: 0;
  border-top: 1px solid var(--ws-divider);
  border-left: 1px solid var(--ws-divider);
  border-radius: 0;
  background: var(--paper);
  box-shadow: none;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color var(--ws-dur-1) ease;
}
body.ws #event-calendar .cal-grid .cal-cell.is-weekend {
  background: var(--cream);
}
body.ws #event-calendar .cal-grid .cal-cell > b {
  font: 600 13px/18px var(--font-body);
  font-variant-numeric: tabular-nums;
}
body.ws #event-calendar .cal-grid .cal-cell.today > b {
  display: inline-grid;
  place-items: center;
  align-self: flex-start;
  min-width: 24px;
  height: 24px;
  margin: -3px 0 0 -4px;
  border-radius: var(--ws-radius-pill);
  background: var(--ink);
  color: var(--paper);
}
body.ws #event-calendar .cal-grid .cal-cell.selected {
  background: var(--ws-accent-wash);
  box-shadow: inset 0 0 0 1.5px var(--ws-accent);
}
body.ws #event-calendar .cal-grid .cal-cell:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--gold-ink);
}
body.ws #event-calendar .cal-grid .cal-cell:active {
  background: var(--ws-accent-wash);
}
@media (hover: hover) and (pointer: fine) {
  body.ws #event-calendar .cal-grid .cal-cell:hover {
    background: var(--paper-sunk);
  }
}
body.ws .cal-ev {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font: 600 12px/16px var(--font-body);
  color: var(--ink);
}
body.ws .cal-ev > span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
body.ws .cal-more {
  font: 500 11px/14px var(--font-body);
  color: var(--ink-muted);
}
body.ws .cal-dots {
  display: none;
}
body.ws #calendar-detail:empty {
  display: none;
}
body.ws #calendar-detail {
  padding: 16px 20px;
  border-top: 1px solid var(--line);
}
body.ws #calendar-detail h3 {
  margin: 0 0 8px;
  font: 500 18px/24px var(--font-display);
}
body.ws .cal-up-row .ws-row-main > .ws-chip {
  margin-top: 6px;
}
/* Година: 4×3 месеца, отделен изглед. */
body.ws #year-board .yb-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
@container cal (max-width: 899px) {
  body.ws #year-board .yb-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
/* „Оферти по период“ – сгънато под календара. */
body.ws .cal-offers > summary {
  cursor: pointer;
  list-style: none;
}
body.ws .cal-offers > summary::-webkit-details-marker {
  display: none;
}
body.ws .cal-offers > summary::after {
  content: '';
  width: 8px;
  height: 8px;
  margin-left: auto;
  margin-right: 8px;
  border: solid var(--ink-muted);
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
  transition: transform var(--ws-dur-2) var(--ws-ease);
}
body.ws .cal-offers[open] > summary::after {
  transform: rotate(-135deg);
}
body.ws .cal-offers:not([open]) > summary {
  border-bottom: 0;
}
body.ws .cal-offers-body {
  display: grid;
  gap: 12px;
  padding: 16px 20px 20px;
}
body.ws .cal-offers-body #offers-list > h2 {
  display: none;
}
/* Телефон: „Предстоящи“ първо, месецът под него – клетката е цел 44×44 с точки под числото. */
@media (max-width: 760px) {
  body.ws[data-page='calendar'] #page-filters :is(select, input) {
    min-height: 44px;
    font-size: 16px;
  }
  body.ws[data-page='calendar'] #page-filters input {
    width: 100%;
  }
  body.ws[data-page='calendar'] #page-filters label {
    flex: 1 1 100%;
    justify-content: space-between;
  }
  body.ws .cal-layout .cal-up {
    order: -1;
  }
  body.ws #event-calendar .cal-grid .cal-cell {
    align-items: center;
    min-height: 48px;
    padding: 6px 2px;
  }
  body.ws #event-calendar .cal-grid .cal-cell > b {
    font-size: 14px;
  }
  body.ws #event-calendar .cal-grid .cal-cell.today > b {
    margin: 0;
  }
  body.ws .cal-ev,
  body.ws .cal-more {
    display: none;
  }
  body.ws .cal-dots {
    display: flex;
    gap: 3px;
  }
  body.ws .cal-dots > i {
    width: 6px;
    height: 6px;
  }
  body.ws .cal-legend {
    margin: 4px 0 0;
    flex: 1 1 100%;
  }
  body.ws #event-calendar .cal-grid .weekday {
    padding: 8px 0 4px;
    text-align: center;
    letter-spacing: 0;
  }
  body.ws #year-board .yb-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  body.ws .ws-switch button {
    padding: 0 10px;
  }
}
body.ws #event-calendar .cal-grid .cal-cell.today {
  border-color: var(--ws-divider);
  box-shadow: none;
}
body.ws #event-calendar .cal-grid .cal-cell.today b {
  color: var(--paper);
}
body.ws #event-calendar .cal-grid .cal-cell.today.selected {
  box-shadow: inset 0 0 0 1.5px var(--ws-accent);
}
body.ws[data-page='calendar'] #page-filters select {
  max-width: 260px;
}
body.ws #event-calendar .cal-grid {
  min-width: 0;
  width: auto;
}
@media (max-width: 760px) {
  body.ws .cal-nav [data-cal-today] {
    display: none;
  }
  body.ws .cal-nav .ws-icon-btn {
    width: 40px;
  }
  body.ws .ws-switch button {
    min-height: 36px;
    padding: 0 8px;
    font-size: 12px;
  }
}

/* =====================================================================================================================
   Финанси (finance.php, DP3-12): табовете – линия 2 px, периодът – лентата под тях, действията – в горната лента,
   KPI в стила на екипа, панелите – ws-panel, колоните: пълна = приходи, контур = разходи.
   ===================================================================================================================== */
body.ws #finance-page {
  display: grid;
  gap: 16px;
}
body.ws .ws-tabs {
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0;
  overflow-x: auto;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: none;
  box-shadow: none;
  scrollbar-width: none;
}
body.ws .ws-tabs::-webkit-scrollbar {
  display: none;
}
body.ws .ws-tabs > button {
  flex: none;
  min-height: 44px;
  margin: 0 0 -1px;
  padding: 0 14px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: var(--ink-muted);
  font: 600 14px/1 var(--font-body);
  white-space: nowrap;
  touch-action: manipulation;
}
body.ws .ws-tabs > button.active,
body.ws .ws-tabs > button[aria-selected='true'] {
  border-bottom-color: var(--ws-accent);
  color: var(--ink);
}
body.ws .ws-tabs > button:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--gold-ink);
}
@media (hover: hover) and (pointer: fine) {
  body.ws .ws-tabs > button:hover {
    color: var(--ink);
  }
}
body.ws #finance-page .fin-period {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
}
body.ws #finance-page .fin-period[hidden] {
  display: none;
}
body.ws #finance-page .fin-period > label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font: 500 13px/1 var(--font-body);
  color: var(--ink-muted);
}
body.ws #finance-page .fin-period > label[hidden] {
  display: none;
}
body.ws #finance-page .fin-period :is(select, input) {
  min-height: var(--ws-ctl-h);
  width: auto;
  margin: 0;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--ws-radius-pill);
  background-color: var(--paper);
  color: var(--ink);
  font: 600 13px/1 var(--font-body);
}
body.ws #finance-page .fin-period select {
  padding-right: 32px;
}
/* Действията са в горната лента – тук остават скрити (бутоните в лентата ги пускат). */
body.ws #finance-page .fin-add {
  display: none;
}
body.ws #finance-page .fin-kpi {
  border-top: 1px solid var(--line);
}
body.ws #finance-page .fin-grid {
  gap: 16px;
}
body.ws #finance-page .fin-card {
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-top-width: 1px;
  border-radius: var(--ws-radius-md);
  background: var(--paper);
  box-shadow: none;
  overflow: hidden;
}
body.ws #finance-page .fin-card > h3 {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  margin: 0;
  min-height: var(--ws-panel-head-h);
  padding: 16px 20px 12px;
  box-sizing: border-box;
  border-bottom: 1px solid var(--ws-divider);
  font: 500 18px/24px var(--font-display);
  color: var(--ink);
}
body.ws #finance-page .fin-card > h3 small {
  font: 500 13px/18px var(--font-body);
  color: var(--ink-muted);
}
body.ws #finance-page .fin-card > :not(h3) {
  margin-left: 20px;
  margin-right: 20px;
}
body.ws #finance-page .fin-card > :last-child {
  margin-bottom: 16px;
}
body.ws #finance-page .fin-card > :nth-child(2) {
  margin-top: 12px;
}
body.ws #finance-page .fin-chart .fin-b-inc {
  fill: var(--ws-accent);
}
body.ws #finance-page .fin-chart .fin-b-exp {
  fill: var(--paper);
  stroke: var(--ink-muted);
  stroke-width: 1.5;
}
body.ws #finance-page .fin-legend i {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 6px;
  vertical-align: -1px;
  border-radius: 3px;
  box-sizing: border-box;
}
body.ws #finance-page .fin-legend .fin-l-inc {
  background: var(--ws-accent);
}
body.ws #finance-page .fin-legend .fin-l-exp {
  border: 1.5px solid var(--ink-muted);
  background: var(--paper);
}
body.ws #finance-page .fin-empty {
  color: var(--ink-muted);
}
@media (max-width: 760px) {
  body.ws .fin-h-snap,
  body.ws .fin-h-exp {
    display: none;
  }
  body.ws #finance-page .fin-period :is(select, input) {
    min-height: 44px;
    font-size: 16px;
  }
}
@media (min-width: 761px) and (max-width: 1199px) {
  body.ws .fin-h-snap span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
  body.ws .fin-h-snap {
    width: 44px;
    padding: 0;
  }
}
body.ws .ws-tabs {
  flex-wrap: nowrap;
}
@media (max-width: 760px) {
  body.ws.has-lux-tabbar .fin-fab {
    bottom: calc(var(--ws-tabbar-h) + 16px + env(safe-area-inset-bottom, 0px));
  }
}

/* =====================================================================================================================
   Настройки (settings.php, DP3-09): вертикално подменю 240 px с групи, потребителите – таблица, формата – страничен
   панел 480 px. На телефон – native <select> за раздела.
   ===================================================================================================================== */
body.ws.settings-page #users-panel.settings-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  width: 100%;
  max-width: var(--ws-content-max);
  margin: 0 auto;
}
body.ws.settings-page #users-panel > h1,
body.ws.settings-page #users-panel > #users-back,
body.ws.settings-page #users-panel > .settings-head {
  display: none;
}
body.ws.settings-page #users-panel > :is(.portal-lang-note) {
  grid-column: 1 / -1;
  margin: 0;
}
body.ws .settings-phone-nav {
  display: none;
}
body.ws .ws-subnav {
  position: sticky;
  top: 16px;
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  overflow: visible;
  border: 0;
  background: none;
  box-shadow: none;
}
body.ws .ws-subnav-group {
  display: grid;
  gap: 2px;
}
body.ws .ws-subnav-title {
  margin: 0 0 4px;
  padding: 0 12px;
  font: 600 11px/16px var(--font-body);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
body.ws .ws-subnav [data-settings-tab] {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 40px;
  margin: 0;
  padding: 8px 12px;
  border: 0;
  border-radius: var(--ws-radius-sm);
  background: none;
  box-shadow: none;
  color: var(--ink);
  font: 500 14px/1.3 var(--font-body);
  text-align: left;
  touch-action: manipulation;
}
body.ws .ws-subnav [data-settings-tab] svg {
  flex: none;
  width: 18px;
  height: 18px;
  color: var(--ink-muted);
}
body.ws .ws-subnav [data-settings-tab] small {
  display: none;
}
body.ws .ws-subnav [data-settings-tab] strong {
  font-weight: 500;
}
body.ws .ws-subnav [data-settings-tab][aria-selected='true'] {
  background: var(--gold-soft);
}
body.ws .ws-subnav [data-settings-tab][aria-selected='true'] strong {
  font-weight: 600;
}
body.ws .ws-subnav [data-settings-tab][aria-selected='true'] svg {
  color: var(--ink);
}
body.ws .ws-subnav [data-settings-tab]:focus-visible {
  outline: none;
  box-shadow: var(--ws-focus);
}
@media (hover: hover) and (pointer: fine) {
  body.ws .ws-subnav [data-settings-tab]:not([aria-selected='true']):hover {
    background: var(--paper-sunk);
  }
}
body.ws .settings-body {
  min-width: 0;
}
body.ws .settings-body > .settings-pane {
  margin: 0;
}
/* Потребители: лента (търсене, вид, брой), таблица на цялата ширина; „+ Нов профил“ – в горната лента. */
body.ws.settings-page .users-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 0 0 16px;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
}
body.ws.settings-page .users-toolbar #users-add {
  display: none;
}
body.ws.settings-page .users-toolbar :is(input, select) {
  min-height: var(--ws-ctl-h);
  margin: 0;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--ws-radius-pill);
  background-color: var(--paper);
  font: 500 14px/1 var(--font-body);
}
body.ws.settings-page .users-toolbar select {
  padding-right: 32px;
  border-color: var(--line);
  font-weight: 600;
  font-size: 13px;
}
body.ws.settings-page .users-search {
  flex: 0 1 320px;
  margin: 0;
}
body.ws.settings-page .users-search input {
  width: 100%;
}
body.ws.settings-page .users-count {
  font: 500 13px/1 var(--font-body);
  font-variant-numeric: tabular-nums;
  color: var(--ink-muted);
}
body.ws.settings-page .user-columns {
  display: block;
}
body.ws.settings-page #users-list {
  display: block;
  overflow: visible;
  border: 1px solid var(--line);
  border-radius: var(--ws-radius-md);
  background: var(--paper);
}
body.ws.settings-page .user-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1.4fr) minmax(0, 1.2fr) minmax(0, 0.8fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 60px;
  margin: 0;
  padding: 8px 12px 8px 20px;
  border: 0;
  border-top: 1px solid var(--ws-divider);
  border-radius: 0;
  background: none;
  box-shadow: none;
}
body.ws.settings-page .user-row:first-child {
  border-top: 0;
}
body.ws.settings-page .user-row[hidden] {
  display: none;
}
body.ws.settings-page .user-row.user-row-focus {
  background: var(--ws-accent-wash);
}
body.ws.settings-page .user-avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gold-soft);
  color: var(--gold-ink);
  font: 600 13px/1 var(--font-body);
}
body.ws.settings-page .user-main {
  display: contents;
}
body.ws.settings-page .user-main > strong {
  grid-column: 2;
  grid-row: 1;
  align-self: end;
  font: 600 15px/20px var(--font-body);
  color: var(--ink);
  overflow-wrap: anywhere;
}
body.ws.settings-page .user-main > span {
  grid-column: 2;
  grid-row: 2;
  align-self: start;
  font: 400 13px/18px var(--font-body);
  color: var(--ink-muted);
  overflow-wrap: anywhere;
}
body.ws.settings-page .user-row > .user-avatar {
  grid-row: 1 / 3;
}
body.ws.settings-page .user-tags {
  grid-column: 3;
  grid-row: 1 / 3;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  margin: 0;
}
body.ws.settings-page .user-rep {
  grid-column: 4;
  grid-row: 1 / 3;
  font: 400 13px/18px var(--font-body);
  color: var(--ink);
  overflow-wrap: anywhere;
}
body.ws.settings-page .user-actions {
  grid-column: 5;
  grid-row: 1 / 3;
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
}
body.ws.settings-page .user-actions .user-edit {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--ws-radius-pill);
  background: var(--paper);
  color: var(--ink);
  font: 600 13px/1 var(--font-body);
}
body.ws.settings-page .user-more summary {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--ink-muted);
}
body.ws.settings-page .user-more summary svg {
  width: 20px;
  height: 20px;
}
body.ws.settings-page .user-more .ev-menu {
  z-index: 30;
  border-radius: var(--ws-radius-md);
  box-shadow: var(--ws-shadow-2);
}
body.ws.settings-page .user-more .ev-menu > button {
  min-height: 40px;
}
body.ws.settings-page .user-tag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: var(--ws-radius-pill);
  font: 600 11px/1 var(--font-body);
  font-style: normal;
}
/* Формата – страничен панел вдясно. */
body.ws.settings-page #user-form {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 1001;
  width: min(480px, 100vw);
  margin: 0;
  padding: 24px 24px calc(24px + env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  background: var(--paper);
  box-shadow: var(--ws-shadow-2);
  transform: translateX(105%);
  visibility: hidden;
  transition:
    transform var(--ws-dur-4) var(--ws-ease),
    visibility 0s linear var(--ws-dur-4);
}
body.ws.settings-page.users-form-open #user-form {
  transform: none;
  visibility: visible;
  transition: transform var(--ws-dur-4) var(--ws-ease);
}
body.ws.settings-page #user-form #user-heading {
  margin: 0 48px 16px 0;
  font: 500 22px/28px var(--font-display);
}
body.ws.settings-page .users-drawer-close {
  position: absolute;
  top: 16px;
  right: 16px;
}
body.ws .users-scrim {
  display: none;
}
body.ws.settings-page.users-form-open .users-scrim {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: block;
  background: var(--ws-scrim);
  animation: ws-fade var(--ws-dur-3) ease both;
}
@keyframes ws-fade {
  from {
    opacity: 0;
  }
}
body.ws.settings-page #user-form :is(input:not([type='checkbox']), select) {
  min-height: 44px;
}
@media (prefers-reduced-motion: reduce) {
  body.ws.settings-page #user-form {
    transition: none;
  }
}
/* Средна ширина: без колоната „Представител“ (името е в етикета). */
@media (max-width: 1199px) {
  body.ws.settings-page .user-row {
    grid-template-columns: 36px minmax(0, 1.3fr) minmax(0, 1fr) auto;
  }
  body.ws.settings-page .user-rep {
    display: none;
  }
  body.ws.settings-page .user-actions {
    grid-column: 4;
  }
}
@media (max-width: 1023px) and (min-width: 761px) {
  body.ws.settings-page #users-panel.settings-layout {
    grid-template-columns: 200px minmax(0, 1fr);
    gap: 16px;
  }
}
@media (max-width: 760px) {
  body.ws.settings-page #users-panel.settings-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
  body.ws .ws-subnav {
    display: none;
  }
  body.ws .settings-phone-nav {
    display: flex;
  }
  body.ws .settings-phone-nav select {
    width: 100%;
    min-height: 48px;
    padding: 0 40px 0 16px;
    border: 1px solid var(--line-strong);
    border-radius: var(--ws-radius-md);
    background-color: var(--paper);
    font: 600 16px/1 var(--font-body);
    color: var(--ink);
  }
  body.ws.settings-page .users-toolbar :is(input, select) {
    min-height: 44px;
    font-size: 16px;
  }
  body.ws.settings-page .users-search {
    flex: 1 1 100%;
  }
  body.ws.settings-page .user-row {
    grid-template-columns: 36px minmax(0, 1fr) auto;
    gap: 4px 12px;
    padding: 10px 4px 10px 16px;
  }
  body.ws.settings-page .user-tags {
    grid-column: 2;
    grid-row: 3;
  }
  body.ws.settings-page .user-actions {
    grid-column: 3;
    grid-row: 1 / 4;
  }
  body.ws.settings-page .user-actions .user-edit {
    display: none;
  }
  body.ws.settings-page .user-more summary {
    width: 44px;
    height: 44px;
  }
  body.ws.settings-page .user-more .ev-menu::before {
    content: none;
  }
}
/* Подменюто – над старите правила на .settings-tabs (карти 218×94 в мрежа). */
body.ws.settings-page .settings-tabs.ws-subnav {
  grid-template-columns: minmax(0, 1fr);
  margin: 0;
}
body.ws.settings-page .settings-tabs.ws-subnav button {
  padding: 8px 12px;
  border: 0;
  border-radius: var(--ws-radius-sm);
  background: none;
  box-shadow: none;
}
body.ws.settings-page .settings-tabs.ws-subnav button.active {
  background: var(--gold-soft);
  box-shadow: none;
}
body.ws.settings-page .settings-tabs.ws-subnav svg,
body.ws.settings-page .settings-tabs.ws-subnav button.active svg {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  padding: 0;
  border-radius: 0;
  background: none;
  color: var(--ink-muted);
}
body.ws.settings-page .settings-tabs.ws-subnav button.active svg {
  color: var(--ink);
}
body.ws.settings-page .settings-tabs.ws-subnav strong {
  font-size: 14px;
}
body.ws.settings-page .settings-tabs.ws-subnav small {
  display: none;
}
@media (hover: hover) and (pointer: fine) {
  body.ws.settings-page .settings-tabs.ws-subnav button:not(.active):hover {
    border-color: transparent;
    background: var(--paper-sunk);
  }
}
@media (max-width: 760px) {
  body.ws.settings-page .settings-tabs.ws-subnav {
    display: none;
  }
}
/* 2FA редът на Настройки – над двете колони. */
body.ws.settings-page main.portal > .ws-tfa {
  max-width: var(--ws-content-max);
}

/* Дизайн студио без миграция 057 (DP3-16): само обяснението в рамката на портала. */
body.ws[data-page='studio'] #workspace > :not(#ws-page-top, #studio-off) {
  display: none;
}
body.ws[data-page='studio'] #studio-off {
  max-width: 640px;
  margin: 48px auto 0;
}

/* =====================================================================================================================
   Планер на клиент от страна на екипа (DP3-08): контекстната секция „Планер · {имена}“ в менюто на екипа.
   ===================================================================================================================== */
body.ws .ws-sec--planner {
  margin-bottom: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
body.ws .ws-sec-title--planner {
  display: grid;
  gap: 2px;
}
body.ws .ws-sec-title--planner b {
  overflow: hidden;
  font: 500 15px/20px var(--font-display);
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
  white-space: nowrap;
  text-overflow: ellipsis;
}
body.ws .ws-sec-sub {
  margin: 10px 12px 2px;
  font: 600 11px/14px var(--font-body);
  color: var(--ink-muted);
}
body.ws .ws-item--back {
  color: var(--ws-accent-ink);
}
body.ws .ws-item--back svg {
  color: var(--ws-accent-ink);
}
/* Релса: само иконите (подзаглавията и имената – скрити). */
@media (min-width: 761px) and (max-width: 1199px) {
  body.ws:not(.ws-rail-open) .ws-sec--planner :is(.ws-sec-sub, .ws-sec-title--planner b) {
    display: none;
  }
}
body.ws.ws-rail:not(.ws-rail-open) .ws-sec--planner :is(.ws-sec-sub, .ws-sec-title--planner b),
body.ws.pl-wide:not(.ws-rail-open) .ws-sec--planner :is(.ws-sec-sub, .ws-sec-title--planner b) {
  display: none;
}
/* Превключвателят на събитията на клиента – в горната лента (и за екипа). */
body.ws-staff #planner > .pl-top:empty {
  display: none;
}

/* Планери (списъкът, DP3-14): ред 56 px, колоните подравнени, числата tabular, само градът. */
body.ws #planner {
  container-name: pl;
}
body.ws .pl-list-tools {
  margin: 0 0 16px;
}
body.ws .ws-ptable {
  display: block;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--ws-radius-md);
  background: var(--paper);
}
body.ws .ws-ptable .pl-row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.2fr) 104px 96px 116px minmax(0, 0.9fr) 104px 64px;
  align-items: center;
  column-gap: 16px;
  min-height: 56px;
  margin: 0;
  padding: 8px 20px;
  border: 0;
  border-top: 1px solid var(--ws-divider);
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: var(--ink);
  font: 400 13px/18px var(--font-body);
  font-variant-numeric: tabular-nums;
  text-decoration: none;
  transition: background-color var(--ws-dur-1) ease;
}
body.ws .ws-ptable .pl-row.pl-head {
  min-height: 40px;
  border-top: 0;
  border-bottom: 1px solid var(--line);
  font: 600 11px/16px var(--font-body);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
body.ws .ws-ptable .pl-head + .pl-row {
  border-top: 0;
}
body.ws .ws-ptable .pl-c-main strong {
  display: block;
  font: 600 15px/20px var(--font-body);
  overflow-wrap: anywhere;
}
body.ws .ws-ptable .pl-c-main small {
  display: block;
  font: 400 13px/18px var(--font-body);
  color: var(--ink-muted);
}
body.ws .ws-ptable :is(.pl-c-budget, .pl-h-num) {
  text-align: right;
}
body.ws .ws-ptable .pl-c-date {
  white-space: nowrap;
}
body.ws .ws-ptable .pl-c-upd {
  color: var(--ink-muted);
}
body.ws .ws-ptable .pl-none {
  color: var(--ink-muted);
}
body.ws .pl-mini {
  display: grid;
  grid-template-columns: 48px auto;
  align-items: center;
  gap: 8px;
}
body.ws .pl-mini .ws-bar {
  height: 4px;
}
body.ws .ws-ptable .pl-row:not(.pl-head):active {
  background: var(--ws-accent-wash);
}
body.ws .ws-ptable .pl-row:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--gold-ink);
}
@media (hover: hover) and (pointer: fine) {
  body.ws .ws-ptable .pl-row:not(.pl-head):hover {
    background: var(--ws-accent-wash);
  }
}
@container pl (max-width: 1099px) {
  body.ws .ws-ptable .pl-row {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1.2fr) 100px 92px 108px 96px;
  }
  body.ws .ws-ptable .pl-row > :is(:nth-child(6), :nth-child(8)) {
    display: none;
  }
}
/* Телефон: карта 72 px – имената, дата · остават, задачите вдясно. */
@media (max-width: 760px) {
  body.ws .ws-ptable .pl-head {
    display: none;
  }
  body.ws .ws-ptable .pl-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: 'main left' 'date tasks';
    row-gap: 6px;
    min-height: 72px;
    padding: 12px 16px;
  }
  body.ws .ws-ptable .pl-c-main {
    grid-area: main;
  }
  body.ws .ws-ptable .pl-c-left {
    grid-area: left;
    justify-self: end;
  }
  body.ws .ws-ptable .pl-c-date {
    grid-area: date;
    color: var(--ink-muted);
  }
  body.ws .ws-ptable .pl-c-tasks {
    grid-area: tasks;
    justify-self: end;
  }
  body.ws .ws-ptable .pl-row > :is(.pl-c-client, .pl-c-guests, .pl-c-budget, .pl-c-upd) {
    display: none;
  }
  body.ws .pl-list-tools .ws-search {
    flex: 1 1 100%;
  }
  body.ws .pl-list-tools .ws-select {
    flex: 1 1 100%;
    justify-content: space-between;
  }
  body.ws .pl-list-tools :is(input, select) {
    min-height: 44px;
    font-size: 16px;
  }
}
body.ws #planner .ws-toolbar .ws-search input,
body.ws #planner .ws-toolbar .ws-select select {
  min-height: var(--ws-ctl-h);
  border-radius: var(--ws-radius-pill);
}
body.ws #planner .ws-toolbar .ws-select select {
  padding: 0 32px 0 14px;
  border-color: var(--line);
  font: 600 13px/1 var(--font-body);
}

/* =====================================================================================================================
   Каталог (catalog.php, екипът; DP3-13): един H1 в горната лента, без двата бутона в лявата колона (в лентата са),
   3 изгледа (Списък · Мрежа · Галерия). Клиентът вижда каталога както досега.
   ===================================================================================================================== */
body.ws.cat-staff .sidebar-admin {
  display: none !important;
}
body.ws.cat-staff main.catalog-page #ws-page-top {
  display: block;
}
/* Заглавната зона е позиционирана спрямо страницата (както в портала) – main на каталога не е позиционен. */
body.ws.cat-staff main.catalog-page {
  position: static;
}

/* =====================================================================================================================
   Редактор на оферти (editor.php, DP3-15) – само рамката: горна лента 64 px на цял екран (работен режим), без
   маркетинговото заглавие; стъпките 1–4 – табове под лентата (лепкави); „Изпрати“ – единственото златно действие.
   ===================================================================================================================== */
body.ed-frame > header.ed-top {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 16px;
  box-sizing: border-box;
  height: 64px;
  min-height: 0;
  margin: 0;
  padding: 0 24px 0 12px;
  border-bottom: 1px solid var(--line);
  background: var(--cream);
  box-shadow: none;
}
body.ed-frame #ed-top .ed-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 12px 0 8px;
  border-radius: var(--ws-radius-pill);
  color: var(--ink);
  font: 600 13px/1 var(--font-body);
  text-decoration: none;
  white-space: nowrap;
}
body.ed-frame #ed-top .ed-back svg {
  width: 20px;
  height: 20px;
}
body.ed-frame #ed-top .ed-title {
  flex: 1 1 auto;
  min-width: 0;
  padding-left: 16px;
  border-left: 1px solid var(--line);
}
body.ed-frame #ed-top .ed-title h1 {
  margin: 0;
  overflow: hidden;
  font: 500 20px/26px var(--font-display);
  color: var(--ink);
  white-space: nowrap;
  text-overflow: ellipsis;
}
body.ed-frame #ed-top .ed-title p {
  margin: 0;
  font: 500 13px/18px var(--font-body);
  color: var(--ink-muted);
}
body.ed-frame #ed-top .ed-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
body.ed-frame #ed-top .ed-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  margin: 0;
  padding: 0 18px;
  border: 1px solid var(--line-strong);
  border-radius: var(--ws-radius-pill);
  background: var(--paper);
  box-shadow: none;
  color: var(--ink);
  font: 600 14px/1 var(--font-body);
  white-space: nowrap;
  cursor: pointer;
  touch-action: manipulation;
  text-decoration: none;
  transition: transform 100ms ease, background-color var(--ws-dur-1) ease;
}
/* „Лист за товарене“ (BIZ-43) е връзка към друга страница – на тесен екран отстъпва място на „Изпрати“ и „⋯“. */
body.ed-frame #ed-top a.ed-btn[hidden] {
  display: none;
}
@media (max-width: 760px) {
  body.ed-frame #ed-top #ed-load {
    display: none;
  }
}
body.ed-frame #ed-top .ed-btn:active {
  transform: scale(0.98);
}
body.ed-frame #ed-top .ed-btn--gold {
  border-color: var(--gold-deep);
  background: var(--gold-deep);
  color: #fff;
}
body.ed-frame #ed-top .ed-btn:disabled {
  opacity: 0.55;
  cursor: default;
}
body.ed-frame #ed-top .ed-icon {
  width: 40px;
  padding: 0;
  list-style: none;
}
body.ed-frame #ed-top .ed-icon::-webkit-details-marker {
  display: none;
}
body.ed-frame #ed-top .ed-icon svg {
  width: 20px;
  height: 20px;
}
body.ed-frame #ed-top .ed-more {
  position: relative;
}
body.ed-frame #ed-top .ed-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 50;
  display: grid;
  gap: 2px;
  width: max-content;
  min-width: 240px;
  max-width: calc(100vw - 24px);
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--ws-radius-md);
  background: var(--paper);
  box-shadow: var(--ws-shadow-2);
}
body.ed-frame #ed-top .ed-menu > :is(button, .button) {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 0 12px;
  border: 0;
  border-radius: var(--ws-radius-sm);
  background: none;
  box-shadow: none;
  color: var(--ink);
  font: 500 14px/1.2 var(--font-body);
  text-align: left;
}
body.ed-frame #ed-top .ed-menu svg {
  flex: none;
  width: 18px;
  height: 18px;
  color: var(--ink-muted);
}
body.ed-frame #ed-top :is(.ed-back, .ed-btn):focus-visible,
body.ed-frame #ed-top .ed-menu > :is(button, .button):focus-visible {
  outline: none;
  box-shadow: var(--ws-focus);
}
@media (hover: hover) and (pointer: fine) {
  body.ed-frame #ed-top .ed-back:hover,
  body.ed-frame #ed-top .ed-btn:not(.ed-btn--gold):hover,
  body.ed-frame #ed-top .ed-menu > :is(button, .button):hover {
    background: var(--paper-sunk);
  }
  body.ed-frame #ed-top .ed-btn--gold:hover {
    background: var(--gold-ink);
  }
}
/* „Преглед за печат“ е в лентата – бутонът над прегледа не се дублира (остава за лентата). */
body.ed-frame .preview-head #print-preview {
  display: none;
}
/* Стъпките 1–4 – табове под лентата, лепкави. */
body.ed-frame .editor > nav {
  position: sticky;
  top: 64px;
  z-index: 30;
  margin-top: 0;
  background: var(--bg, #f5f5f3);
}
@media (max-width: 1023px) {
  body.ed-frame #ed-top .ed-back span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
  body.ed-frame #ed-print {
    display: none;
  }
}
/* Телефон: полета 16 px (без увеличаване на iOS), цели 44 px. */
@media (max-width: 760px) {
  body.ed-frame > header.ed-top {
    gap: 8px;
    height: 60px;
    padding: 0 8px 0 4px;
  }
  body.ed-frame #ed-top .ed-title {
    padding-left: 8px;
  }
  body.ed-frame #ed-top .ed-title h1 {
    font-size: 18px;
    line-height: 22px;
  }
  body.ed-frame #ed-top .ed-title p {
    font-size: 12px;
    line-height: 16px;
  }
  body.ed-frame #ed-top .ed-btn {
    min-height: 44px;
  }
  body.ed-frame #ed-top .ed-icon {
    width: 44px;
  }
  body.ed-frame #ed-top .ed-btn--gold {
    padding: 0 14px;
  }
  body.ed-frame .editor > nav {
    top: 60px;
  }
  body.ed-frame :is(input:not([type='checkbox'], [type='radio'], [type='color'], [type='file']), select, textarea) {
    font-size: 16px;
  }
}
/* style.css на телефон крие децата на лентата (body > header > div > :not(#notifications-open), !important) – рамката
   на редактора ги показва (също с !important – единственото място, нужно заради правилото там). */
@media (max-width: 760px) {
  body.ed-frame #ed-top > div > :is(h1, p, .ed-more) {
    display: block !important;
  }
  body.ed-frame #ed-top > div > #ed-publish:not([hidden]) {
    display: inline-flex !important;
  }
}
body.ed-frame #ed-top .ed-more > summary.ed-btn {
  border-radius: var(--ws-radius-pill);
  display: inline-flex;
}
/* Редакторът не зарежда workspace.css – токените на рамката (същите стойности като workspace.css :root). */
body.ed-frame {
  --ws-radius-sm: 8px;
  --ws-radius-md: 12px;
  --ws-radius-pill: 999px;
  --ws-focus: 0 0 0 2px var(--paper), 0 0 0 4px var(--gold-ink);
  --ws-shadow-2: var(--shadow-pop);
  --ws-dur-1: 150ms;
}

/* DP3-17: цели ≥ 44 px на тъч и в менютата „⋯“ и превключвателя Месец | Година. */
@media (pointer: coarse) {
  body.ws .ev-menu > :is(button, .button, a),
  body.ws .ev-menu .ev-status button {
    min-height: 44px;
  }
  body.ws .ws-switch button {
    min-height: 44px;
  }
  body.ws .ev-more > summary {
    min-width: 44px;
    min-height: 44px;
  }
}
@media (pointer: coarse) {
  body.ws.settings-page .user-more .ev-menu > button,
  body.ws.settings-page #users-list .user-actions button {
    min-height: 44px;
  }
}

/* ---------- „Като клиентката“ (планер на клиент, решение на собственика 15.10.2026) ----------
   UX-NTF-01: пил-меню в горната лента (planner.js plVaPillAdd; стилът на пила е в theme.css при .pl-hdr-tag). Тук – бутонът
   за смяна в менюто и body.pl-va – скритите действия. */
.pl-va-switch {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  margin: 12px 0 0;
  padding: 0 18px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: var(--paper);
  color: var(--ink);
  font: 600 14px/1.2 var(--font-body);
  cursor: pointer;
}
.pl-va-switch svg {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.pl-va-switch:active {
  background: var(--cream);
}
.pl-va-switch:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
@media (hover: hover) and (pointer: fine) {
  .pl-va-switch:hover {
    background: var(--cream);
  }
}
body.pl-va .pl-va-hide,
body.pl-va #planner .ws-fab {
  display: none !important;
}
/* VA-01: само за преглед (planner.js plCanWrite) – съдържанието, което иначе е бутон за редакция (заглавието на задачата,
   картата на менюто, името на доставчика), е обикновен текст: без ръка и без фон при посочване. */
#planner div.pl-task-main,
#planner div.plmn-card-open,
body.ws #planner div.plp-v-open {
  cursor: default;
}
#planner div.pl-task-main:hover {
  background: none;
}

/* ---------- CS-01b: статусът на плащането (calendar.js payStatusTag) ----------
   Три състояния, форма + текст (не само цвят): кръг = неплатено, половин = частично платено (+ „остава X“ на втори
   ред), отметка = платено. Капарото, ако е изискано и не е покрито – най-тихият ред под тях. */
body.ws .pay-tag {
  display: inline-grid;
  justify-items: start;
  max-width: 100%;
  font: 500 12px/16px var(--font-body);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-muted);
  text-align: left;
  white-space: normal;
}
body.ws .pay-tag-st {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
body.ws :is(.pay-tag-sum, .pay-tag-dep) {
  padding-left: 13px;
}
body.ws .pay-tag-dep {
  font: 400 11px/14px var(--font-body);
  color: var(--ink-muted);
}
body.ws .pay-tag-st > i {
  flex: none;
  width: 7px;
  height: 7px;
  border: 1.5px solid var(--gold);
  border-radius: 50%;
}
body.ws .pay-tag--partial .pay-tag-st > i {
  background: linear-gradient(90deg, var(--gold) 50%, transparent 50%);
}
body.ws .pay-tag--unpaid .pay-tag-st > i {
  border-color: var(--line-strong);
}
body.ws .pay-tag--paid {
  color: var(--success);
}
body.ws .pay-tag-st > svg {
  flex: none;
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* „Оферти и заявки“: под сумата, дясно подравнено; на телефон сумата я няма – етикетът е под чипа на етапа. */
body.ws .ev-c-sum small.ev-pay {
  margin-top: 2px;
  white-space: normal;
}
body.ws .ev-c-sum small.ev-pay .pay-tag {
  justify-items: end;
  text-align: right;
}
body.ws .ev-c-sum small.ev-pay :is(.pay-tag-sum, .pay-tag-dep) {
  padding-left: 0;
}
body.ws .ev-pay-m {
  display: none;
}
@media (max-width: 760px) {
  body.ws .ev-row > .ev-c-stage {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 10px;
  }
  body.ws .ev-pay-m {
    display: inline-flex;
    min-width: 0;
  }
}
/* Календар: „Предстоящи“, денят, плочките и картите на офертите. */
body.ws .cal-up-row .cal-up-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  margin-top: 6px;
}
body.ws .cal-detail-head strong .pay-tag {
  display: grid;
  margin-top: 2px;
}
body.ws .upcoming-offer-tile > .pay-tag {
  margin: 8px 0 0;
}
body.ws .offer-summary > .pay-tag {
  margin: 0 8px 0 4px;
  vertical-align: middle;
}

/* ---------- CS-02: „Приключено“ (ръчна отметка на екипа, миграция 081) ----------
   Лентата с етапите: „Приключени“ е до „Отказани“ (извън пътя на заявката), само ако отметката е налична. */
body.ws #events-stages.has-done {
  grid-template-columns: repeat(6, minmax(0, 1fr)) 12px repeat(2, minmax(0, 1fr));
}
body.ws #events-stages.has-done .ws-stage {
  padding-inline: 12px;
}
body.ws .ws-stage.stage-completed {
  grid-column: 9;
  border-left: 1px solid var(--ws-divider);
}
body.ws .ev-row.stage-completed .ws-row-title {
  color: var(--ink-muted);
}
/* Подсказката след датата: тих ред под вида на събитието; бутонът е над връзката на реда. */
body.ws .ev-done-hint {
  display: block;
  margin-top: 4px;
}
body.ws .ev-done-hint button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 0;
  border: 0;
  background: none;
  font: 500 12px/16px var(--font-body);
  color: var(--gold-ink);
  text-align: left;
  white-space: normal;
  max-width: 100%;
  cursor: pointer;
  pointer-events: auto;
}
body.ws .ev-done-hint button .ws-ico {
  flex: none;
  width: 14px;
  height: 14px;
}
@media (hover: hover) and (pointer: fine) {
  body.ws .ev-done-hint button:hover span {
    text-decoration: underline;
    text-underline-offset: 3px;
  }
}
@media (max-width: 760px) {
  body.ws #events-stages.has-done {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  body.ws #events-stages.has-done .ws-stage {
    padding-inline: 8px;
  }
  body.ws .ws-stage.stage-completed {
    grid-column: auto;
  }
  body.ws .ev-done-hint button {
    min-height: 32px;
  }
}
