/* «Поток» — визуальная идентичность мини-CRM (поверх Tabler). */
:root {
  --potok-ink: #0f172a;
  --potok-muted: #64748b;
  --potok-line: #e2e8f0;
  --potok-bg: #f8fafc;
  --potok-teal: #0f766e;
  --potok-teal-dark: #0d5f59;
  --potok-teal-soft: #ccfbf1;
  --potok-sidebar: #0b1220;
  --potok-sidebar-2: #121a2b;
  --tblr-primary: #0f766e;
  --tblr-primary-rgb: 15, 118, 110;
  --tblr-link-color: #0f766e;
  --tblr-link-hover-color: #0d5f59;
}

body {
  background: var(--potok-bg);
  color: var(--potok-ink);
}

/* Сайдбар */
aside.navbar-vertical.navbar-dark {
  background: linear-gradient(180deg, var(--potok-sidebar) 0%, #0e1628 100%) !important;
}
aside.navbar-vertical .navbar-brand {
  padding: .9rem 1rem .5rem;
}
.potok-brand {
  display: flex;
  align-items: center;
  gap: .7rem;
  text-decoration: none !important;
  color: #fff !important;
}
.potok-brand-mark {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}
.potok-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
}
.potok-brand-product {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -.02em;
}
.potok-brand-clinic {
  font-size: .75rem;
  color: rgba(255, 255, 255, .55);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 10.5rem;
}
aside.navbar-vertical .nav-link.active {
  background: rgba(15, 118, 110, .28) !important;
  color: #fff !important;
}
aside.navbar-vertical .nav-link:hover {
  background: rgba(255, 255, 255, .06);
}
aside.navbar-vertical .btn-secondary {
  background: rgba(255, 255, 255, .08);
  border-color: transparent;
  color: rgba(255, 255, 255, .85);
}
aside.navbar-vertical .btn-secondary:hover {
  background: rgba(15, 118, 110, .35);
  color: #fff;
}

/* Навигация: группы с лёгкими отступами */
.potok-nav {
  gap: .1rem;
  padding: 0 .15rem .25rem;
}
.potok-nav > .nav-item[data-nav-item="Клиенты"] {
  margin-bottom: .35rem;
  padding-bottom: .35rem;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.potok-nav > .nav-item[data-nav-item="Сводка"] {
  margin-top: .35rem;
  padding-top: .35rem;
  border-top: 1px solid rgba(255, 255, 255, .07);
}
.potok-nav .nav-link {
  border-radius: .4rem;
  margin: 0 .2rem;
  padding: .42rem .7rem;
}
.potok-nav .nav-link-icon {
  width: 1.15rem;
  text-align: center;
  opacity: .8;
}
.potok-nav .nav-link.active .nav-link-icon,
.potok-nav .nav-link:hover .nav-link-icon {
  opacity: 1;
}

/* Мини-календарь в сайдбаре (между брендом и меню) */
.sidebar-cal {
  margin: .1rem .7rem .55rem;
  padding: .4rem .4rem .45rem;
  border-radius: .45rem;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .08);
  color: rgba(255, 255, 255, .85);
  user-select: none;
}
.sidebar-cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .35rem;
  margin-bottom: .3rem;
  padding: 0 .1rem;
}
.sidebar-cal-month {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: -.01em;
  color: #fff;
}
.sidebar-cal-nav {
  display: flex;
  gap: .1rem;
}
.sidebar-cal-btn {
  width: 1.5rem;
  height: 1.5rem;
  border: 0;
  border-radius: .3rem;
  background: transparent;
  color: rgba(255, 255, 255, .55);
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.sidebar-cal-btn:hover {
  background: rgba(255, 255, 255, .08);
  color: #fff;
}
.sidebar-cal-wd {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0;
  margin-bottom: .2rem;
  text-align: center;
  font-size: .65rem;
  color: rgba(255, 255, 255, .38);
  text-transform: lowercase;
}
.sidebar-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: .12rem 0;
  text-align: center;
}
.sidebar-cal-empty {
  display: block;
  height: 1.45rem;
}
.sidebar-cal-day {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 1.45rem;
  border-radius: .3rem;
  font-size: .74rem;
  font-weight: 600;
  color: rgba(255, 255, 255, .82);
  text-decoration: none !important;
  position: relative;
}
.sidebar-cal-day:hover {
  background: rgba(255, 255, 255, .1);
  color: #fff;
}
.sidebar-cal-day.is-weekend {
  color: rgba(255, 255, 255, .45);
}
.sidebar-cal-day.is-today:not(.is-selected)::after {
  content: "";
  position: absolute;
  left: 22%;
  right: 22%;
  bottom: .18rem;
  height: 2px;
  border-radius: 1px;
  background: var(--potok-teal);
}
.sidebar-cal-day.is-selected {
  background: var(--potok-teal);
  color: #fff;
}
.sidebar-cal-day.is-selected:hover {
  background: var(--potok-teal-dark);
  color: #fff;
}
@media (max-width: 991.98px) {
  .sidebar-cal {
    max-width: 16rem;
  }
}

/* Flyout настроек — в тон бренду */
.settings-toggle:checked ~ .settings-cat-label { background: var(--potok-sidebar-2); }
.settings-flyout { background: var(--potok-sidebar-2); }

/* Кнопки */
.btn-primary {
  --tblr-btn-bg: var(--potok-teal);
  --tblr-btn-border-color: var(--potok-teal);
  --tblr-btn-hover-bg: var(--potok-teal-dark);
  --tblr-btn-hover-border-color: var(--potok-teal-dark);
  background-color: var(--potok-teal);
  border-color: var(--potok-teal);
}
.btn-primary:hover {
  background-color: var(--potok-teal-dark);
  border-color: var(--potok-teal-dark);
}
.btn-outline-primary {
  --tblr-btn-color: var(--potok-teal);
  --tblr-btn-border-color: var(--potok-teal);
  color: var(--potok-teal);
  border-color: var(--potok-teal);
}

/* Логин */
.potok-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(15, 118, 110, .18), transparent 55%),
    radial-gradient(ellipse 70% 50% at 90% 90%, rgba(15, 118, 110, .12), transparent 50%),
    linear-gradient(165deg, #f0fdfa 0%, #f8fafc 45%, #eef2ff 100%);
}
.potok-login-card {
  width: 380px;
  max-width: 92vw;
  border: 1px solid var(--potok-line);
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, .08);
  background: #fff;
  overflow: hidden;
}
.potok-login-card .card-body {
  /* Tabler/form-footer иначе прилипают к краям карточки */
  padding: 1rem 1.5rem 1.5rem !important;
}
.potok-login-card .form-footer {
  margin: 0 !important;
  padding: .25rem 0 0 !important;
  border: 0 !important;
  background: transparent !important;
}
.potok-login-card .form-label {
  margin-left: 0;
  padding-left: 0;
}
.potok-login-card .form-control {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.potok-login-head {
  text-align: center;
  padding: 1.75rem 1.5rem .25rem;
}
.potok-login-head img {
  width: 52px;
  height: 52px;
  margin-bottom: .75rem;
}
.potok-login-head .product {
  font-weight: 800;
  font-size: 1.45rem;
  letter-spacing: -.03em;
  color: var(--potok-ink);
  margin: 0;
}
.potok-login-head .clinic {
  color: var(--potok-muted);
  font-size: .95rem;
  margin: .35rem 0 0;
}
.potok-login-head .tag {
  display: inline-block;
  margin-top: .85rem;
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--potok-teal-dark);
  background: var(--potok-teal-soft);
  padding: .25rem .65rem;
  border-radius: 99px;
}

/* Информеры срочности в правом верхнем углу */
.page-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.page-header-main {
  flex: 1 1 auto;
  min-width: 0;
}
.page-header-inbox {
  flex: 0 0 auto;
  padding-top: .15rem;
}
.inbox-bar {
  min-height: 2rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
/* Плашка «Звонит» — по центру экрана, над контентом/backdrop, но под drawer’ами */
.inbox-call-strip {
  position: fixed;
  top: .75rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1045;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem .85rem;
  border-radius: .5rem;
  text-decoration: none !important;
  font-size: .85rem;
  font-weight: 700;
  line-height: 1.2;
  color: #fff !important;
  background: #0f766e;
  border: 1px solid #0d9488;
  box-shadow: 0 6px 20px rgba(15, 23, 42, .18);
  animation: inbox-breathe 1.2s ease-in-out infinite;
  max-width: min(36rem, calc(100vw - 2rem));
  pointer-events: auto;
}
.inbox-call-strip:hover {
  background: #0d9488;
  color: #fff !important;
}
.inbox-call-strip-label {
  text-transform: uppercase;
  letter-spacing: .04em;
  font-size: .72rem;
  opacity: .92;
}
.inbox-call-strip-phone {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.inbox-call-strip-name {
  font-weight: 600;
  opacity: .95;
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.on-call-drawer {
  z-index: 1055;
}
.on-call-head-icon {
  color: #0f766e;
  margin-right: .35rem;
}
.on-call-phone {
  font-size: 1.25rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.on-call-name {
  font-size: 1.05rem;
  font-weight: 600;
}
.on-call-new-client .form-label {
  font-weight: 600;
  color: var(--tblr-body-color, #1e293b);
}
.on-call-info dt {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--tblr-secondary, #6c7a91);
  margin-top: .5rem;
}
.on-call-info dd {
  margin-bottom: 0;
}
.on-call-bookings-wrap > summary.on-call-bookings-summary {
  cursor: pointer;
  list-style: none;
  font-size: .8rem;
  font-weight: 600;
  color: var(--tblr-secondary, #6c7a91);
  user-select: none;
}
.on-call-bookings-wrap > summary.on-call-bookings-summary::-webkit-details-marker {
  display: none;
}
.on-call-bookings-wrap > summary.on-call-bookings-summary::before {
  content: "▸";
  display: inline-block;
  width: 1rem;
  flex-shrink: 0;
  color: #64748b;
  font-size: .85rem;
  font-weight: 700;
  line-height: 1;
  transition: transform .15s ease;
}
.on-call-bookings-wrap[open] > summary.on-call-bookings-summary::before {
  transform: rotate(90deg);
}
.on-call-chip-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .4rem;
}
.on-call-chip-grid .btn {
  color: var(--potok-teal-dark, #0f766e) !important;
  background: #fff !important;
  border-color: var(--potok-teal, #0d9488) !important;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.on-call-chip-grid .btn.on-call-chip-primary:not(.active) {
  background: #ecfdf5 !important;
  border-width: 2px !important;
}
.on-call-chip-grid .btn:hover {
  color: #fff !important;
  background: var(--potok-teal, #0d9488) !important;
  border-color: var(--potok-teal, #0d9488) !important;
}
.on-call-chip-grid .btn.active,
.on-call-chip-grid .btn.active:hover {
  color: #fff !important;
  background: var(--potok-teal-dark, #0f766e) !important;
  border-color: var(--potok-teal-dark, #0f766e) !important;
}
.on-call-sales {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.on-call-sales-certs {
  margin: 0;
}
.on-call-certs .on-call-cert {
  border-radius: .4rem;
  margin-bottom: .35rem;
  border: 1px solid transparent;
  padding: .55rem .65rem;
}
.on-call-certs .on-call-cert:last-child {
  margin-bottom: 0;
}
.on-call-cert-usable {
  background: #ecfdf5;
  border-color: #a7f3d0 !important;
}
.on-call-cert-other {
  background: #f8fafc;
  border-color: #e2e8f0 !important;
  opacity: .92;
}
.on-call-sales-section {
  border: 1px solid var(--potok-line, #e2e8f0);
  border-radius: .5rem;
  background: #fff;
  padding: .75rem .85rem;
}
.on-call-sales-cart {
  border: 1px solid var(--potok-line, #e2e8f0);
  border-radius: .4rem;
  background: #f8fafc;
  padding: .65rem .7rem;
}
.on-call-sale-just {
  background: #ecfdf5;
}
.on-call-orders .potok-accordion {
  background: #fff;
}
.on-call-orders .potok-accordion.on-call-sale-just {
  background: #ecfdf5;
}
.on-call-orders .potok-accordion-summary {
  line-height: 1.35;
}
.on-call-product-catalog {
  max-height: 16rem;
  overflow-y: auto;
  border: 1px solid var(--potok-line, #e2e8f0);
  border-radius: .4rem;
  background: #f8fafc;
  -webkit-overflow-scrolling: touch;
}
.on-call-product-catalog .list-group-item {
  background: transparent;
  border-color: var(--potok-line, #e2e8f0);
}
.on-call-product-catalog .list-group-item:first-child {
  border-top: 0;
}
.on-call-product-search input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}
.inbox-bar-list {
  display: flex;
  align-items: center;
  gap: .4rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.inbox-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .35rem .55rem;
  border-radius: .45rem;
  text-decoration: none !important;
  font-size: .85rem;
  font-weight: 700;
  line-height: 1;
  border: 1px solid transparent;
  transition: background .15s ease, color .15s ease;
}
.inbox-chip i {
  font-size: .85rem;
  opacity: .9;
}
.inbox-chip-count {
  font-variant-numeric: tabular-nums;
  min-width: .9rem;
  text-align: center;
}
.inbox-chip-dual {
  display: inline-flex;
  align-items: baseline;
  gap: .12rem;
  font-variant-numeric: tabular-nums;
}
.inbox-chip-sep {
  opacity: .55;
  font-weight: 600;
}
.inbox-chip-new {
  color: inherit;
}
.inbox-chip-open {
  opacity: .85;
}
/* Чип без задач — без пульса, но виден */
.inbox-chip:not(.is-live) {
  opacity: .72;
}
.inbox-key-owner_dm:not(.is-live) {
  opacity: .72;
}
.owner-dm-dual-badge {
  display: inline-flex;
  align-items: baseline;
  gap: .15rem;
  margin-left: .35rem;
  padding: .15rem .45rem;
  border-radius: .4rem;
  background: #1d4ed8;
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  vertical-align: middle;
}
.owner-dm-dual-sep {
  opacity: .7;
  font-weight: 600;
}
.inbox-chip-danger {
  color: #b91c1c;
  background: #fef2f2;
  border-color: #fecaca;
}
.inbox-chip-danger:hover {
  background: #fee2e2;
  color: #991b1b;
}
.inbox-chip-warning {
  color: #b45309;
  background: #fffbeb;
  border-color: #fde68a;
}
.inbox-chip-warning:hover {
  background: #fef3c7;
  color: #92400e;
}
.inbox-chip-secondary {
  color: #475569;
  background: #f1f5f9;
  border-color: #e2e8f0;
}
.inbox-chip-secondary:hover {
  background: #e2e8f0;
  color: #334155;
}
.inbox-chip-info {
  color: #1d4ed8;
  background: #eff6ff;
  border-color: #bfdbfe;
}
.inbox-chip-info:hover {
  background: #dbeafe;
  color: #1e40af;
}
.inbox-chip-success {
  color: #15803d;
  background: #f0fdf4;
  border-color: #bbf7d0;
}
.inbox-chip-success:hover {
  background: #dcfce7;
  color: #166534;
}
.inbox-chip-success.is-live {
  animation-name: inbox-breathe-success;
  animation-duration: 1.4s;
}
@keyframes inbox-breathe-success {
  0%, 100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, .35); }
  50% { box-shadow: 0 0 0 .35rem rgba(22, 163, 74, 0); }
}
/* Постоянный пульс, пока есть задачи; частота = срочность */
.inbox-chip.is-live {
  animation: inbox-breathe 2.4s ease-in-out infinite;
}
.inbox-chip-danger.is-live {
  animation-name: inbox-breathe-danger;
}
.inbox-chip-warning.is-live {
  animation-name: inbox-breathe-warn;
}
.inbox-chip-info.is-live {
  animation-name: inbox-breathe-info;
}
.inbox-key-calls.is-live {
  animation-duration: 1.1s; /* самый горячий */
}
.inbox-key-confirm.is-live {
  animation-duration: 1.6s;
}
.inbox-key-move.is-live {
  animation-duration: 2.0s;
}
.inbox-key-leads.is-live {
  animation-duration: 3.2s; /* самый спокойный */
}
.inbox-key-owner_dm.is-live {
  animation-duration: 1.8s;
}
.inbox-chip.is-grew {
  animation: inbox-pop .7s ease-out 1, inbox-breathe 2.4s ease-in-out .7s infinite;
}
.inbox-chip-danger.is-grew {
  animation-name: inbox-pop, inbox-breathe-danger;
}
.inbox-chip-warning.is-grew {
  animation-name: inbox-pop-warn, inbox-breathe-warn;
}
.inbox-chip-info.is-grew {
  animation-name: inbox-pop-info, inbox-breathe-info;
}
.inbox-key-calls.is-grew {
  animation-duration: .55s, 1.1s;
}
.inbox-key-confirm.is-grew {
  animation-duration: .6s, 1.6s;
}
.inbox-key-move.is-grew {
  animation-duration: .65s, 2.0s;
}
.inbox-key-leads.is-grew {
  animation-duration: .7s, 3.2s;
}
.inbox-key-owner_dm.is-grew {
  animation-duration: .6s, 1.8s;
}
@keyframes inbox-breathe {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(71, 85, 105, 0); }
  50% { transform: scale(1.07); box-shadow: 0 0 0 4px rgba(71, 85, 105, .12); }
}
@keyframes inbox-breathe-danger {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(185, 28, 28, 0); }
  50% { transform: scale(1.08); box-shadow: 0 0 0 5px rgba(185, 28, 28, .18); }
}
@keyframes inbox-breathe-warn {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(180, 83, 9, 0); }
  50% { transform: scale(1.07); box-shadow: 0 0 0 4px rgba(180, 83, 9, .16); }
}
@keyframes inbox-breathe-info {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(29, 78, 216, 0); }
  50% { transform: scale(1.07); box-shadow: 0 0 0 4px rgba(29, 78, 216, .16); }
}
@keyframes inbox-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.14); }
  100% { transform: scale(1); }
}
@keyframes inbox-pop-warn {
  0% { transform: scale(1); }
  40% { transform: scale(1.12); }
  100% { transform: scale(1); }
}
@keyframes inbox-pop-info {
  0% { transform: scale(1); }
  40% { transform: scale(1.12); }
  100% { transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .inbox-chip.is-live,
  .inbox-chip.is-grew {
    animation: none;
  }
}

/* Короткий success-тост (сохранение форм) */
.potok-toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  z-index: 1090;
  transform: translateX(-50%) translateY(0.5rem);
  max-width: min(22rem, calc(100vw - 2rem));
  padding: .7rem 1.15rem;
  border-radius: .55rem;
  background: #0f766e;
  color: #fff;
  font-size: .925rem;
  font-weight: 600;
  line-height: 1.35;
  box-shadow: 0 10px 28px rgba(15, 118, 110, .35);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.potok-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

/* Тост-напоминание о срочных задачах */
.inbox-toast {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 1080;
  max-width: min(22rem, calc(100vw - 2rem));
  background: #fff;
  color: var(--potok-ink);
  border: 1px solid var(--potok-line);
  border-radius: .65rem;
  box-shadow: 0 12px 40px rgba(15, 23, 42, .16);
  padding: .9rem 1rem;
}
.inbox-toast-text {
  font-size: .92rem;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: .75rem;
}
.inbox-toast-actions {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}
@media (max-width: 575.98px) {
  .page-header-row {
    flex-wrap: wrap;
  }
  .page-header-inbox {
    width: 100%;
  }
  .inbox-bar-list {
    justify-content: flex-start;
  }
  .inbox-toast {
    right: .75rem;
    left: .75rem;
    bottom: .75rem;
    max-width: none;
  }
}

/* —— «Сегодня»: дневная сетка —— */
.today-root { position: relative; }
.today-day-label { font-variant-numeric: tabular-nums; }
.today-day {
  overflow: hidden;
}
/* Вертикальный скролл — весь кадр; по X скроллятся только колонки */
.today-day-frame {
  position: relative;
  max-height: calc(100vh - 11rem);
  overflow-x: hidden;
  overflow-y: auto;
}
.today-sticky-head {
  position: sticky;
  top: 0;
  z-index: 12;
  display: flex;
  align-items: stretch;
  background: #fff;
  border-bottom: 1px solid var(--potok-line);
}
.today-axis-cap {
  flex: 0 0 3.5rem;
  background: #fff;
}
.today-cols-head-scroller {
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
.today-cols-head-scroller::-webkit-scrollbar { display: none; }
.today-cols-head {
  display: flex;
  min-width: min-content;
}
.today-body-row {
  display: flex;
  align-items: flex-start;
  position: relative;
  /* Место под первую метку часа (tick с translateY(-50%) не уезжает под шапку) */
  padding-top: .65rem;
  padding-bottom: .4rem;
}
.today-axis {
  flex: 0 0 3.5rem;
  z-index: 4;
  background: #fff;
  align-self: flex-start;
}
.today-axis-left { border-right: 1px solid var(--potok-line); }
.today-axis-right { border-left: 1px solid var(--potok-line); }
.today-axis-body { position: relative; }
.today-tick {
  position: absolute;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  font-size: .65rem;
  color: var(--potok-muted);
  text-align: right;
  padding-right: .4rem;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  pointer-events: none;
}
.today-axis-right .today-tick {
  text-align: left;
  padding-left: .4rem;
  padding-right: 0;
}
.today-tick-hour {
  font-size: .82rem;
  font-weight: 700;
  color: var(--potok-ink);
}
.today-tick-h { font-weight: 700; }
.today-tick-m {
  font-size: .55em;
  font-weight: 600;
  margin-left: .05em;
}
.today-cols-scroller {
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  overflow-y: visible;
  padding-bottom: 5rem;
}
.today-cols {
  display: flex;
  min-width: min-content;
  position: relative;
  align-items: flex-start;
  overflow: visible;
}
.today-col {
  flex: 0 0 11.5rem;
  border-right: 1px solid var(--potok-line);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: visible;
}
.today-col-wide {
  flex: 1 1 18rem;
  min-width: 16rem;
}
.today-col-head {
  flex: 0 0 11.5rem;
  width: 11.5rem;
  background: #fff;
  padding: .25rem .35rem;
  height: 3.25rem;
  min-height: 3.25rem;
  max-height: 3.25rem;
  box-sizing: border-box;
  overflow: hidden;
  border-right: 1px solid var(--potok-line);
}
.today-col-head.today-col-wide {
  flex: 1 1 18rem;
  min-width: 16rem;
  width: auto;
}
.today-now {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 9;
  pointer-events: none;
  height: 0;
}
.today-now-badge {
  position: absolute;
  left: .2rem;
  top: 0;
  transform: translateY(-50%);
  z-index: 2;
  background: #2d2d2d;
  color: #f5c518;
  font-size: .7rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: .12rem .38rem;
  border-radius: .25rem;
  line-height: 1.2;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .2);
  white-space: nowrap;
}
.today-now-line {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  border-top: 1.5px solid #1a1a1a;
  z-index: 1;
}
.today-col-name-btn {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  padding: .15rem .2rem;
  text-align: left;
  cursor: pointer;
  border-radius: .3rem;
  color: inherit;
}
.today-col-name-btn:hover {
  background: var(--potok-teal-soft);
}
.today-col-name {
  display: block;
  font-weight: 700;
  font-size: .82rem;
  line-height: 1.2;
  color: var(--potok-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.today-col-sub {
  display: block;
  font-size: .65rem;
  color: var(--potok-muted);
  text-transform: uppercase;
  letter-spacing: .03em;
  margin-top: .1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.today-col-body {
  position: relative;
  flex: 1 1 auto;
  cursor: default;
  overflow: visible;
  background: repeating-linear-gradient(
    to bottom,
    transparent,
    transparent calc(12px * 12 - 1px),
    #f1f5f9 calc(12px * 12 - 1px),
    #f1f5f9 calc(12px * 12)
  );
}
.today-ghost {
  position: absolute;
  left: .25rem;
  right: .25rem;
  z-index: 2;
  pointer-events: none;
  background: var(--potok-teal);
  color: #fff;
  border-radius: .35rem;
  padding: 0 .45rem;
  font-size: .72rem;
  font-weight: 600;
  line-height: 1.35;
  display: flex;
  align-items: center;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .12);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  min-height: 22px;
}
.today-ghost-label {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}
.today-col-sub.today-col-off {
  color: #b45309;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
}
.today-overlay {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 1;
  pointer-events: none;
}
.today-overlay-off {
  background: repeating-linear-gradient(
    -45deg,
    rgba(148, 163, 184, .18),
    rgba(148, 163, 184, .18) 6px,
    rgba(148, 163, 184, .08) 6px,
    rgba(148, 163, 184, .08) 12px
  );
}
.today-overlay-break {
  background: rgba(251, 191, 36, .22);
}
.today-hline {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px solid #e8edf3;
  pointer-events: none;
  z-index: 0;
}
.today-col-banner {
  position: absolute;
  left: .35rem;
  right: .35rem;
  top: .5rem;
  z-index: 2;
  pointer-events: none;
  text-align: center;
  font-size: .72rem;
  font-weight: 700;
  color: #92400e;
  background: rgba(254, 243, 199, .92);
  border: 1px solid #f59e0b;
  border-radius: .35rem;
  padding: .35rem .4rem;
}
.today-card-oos {
  outline: 2px solid #ea580c;
  outline-offset: -1px;
}
.today-card-oos .today-card-head {
  background: #c2410c;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .25rem;
}
.today-card-oos-badge {
  flex: 0 0 auto;
  font-size: .62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  background: rgba(255, 255, 255, .2);
  padding: .05rem .3rem;
  border-radius: .2rem;
}
.today-card-attn {
  flex: 0 0 auto;
  font-size: .62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  padding: .05rem .3rem;
  border-radius: .2rem;
  background: rgba(255, 255, 255, .22);
}
.today-card-attn-previsit {
  background: rgba(13, 148, 136, .35);
}
.today-card-attn-verify_change {
  background: rgba(234, 88, 12, .4);
}
.today-outside-warn {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  margin-bottom: 1.1rem;
  padding: .9rem 1rem;
  border-radius: .5rem;
  border: 1px solid #f0c36a;
  background: linear-gradient(180deg, #fff8eb 0%, #fff3d6 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7);
}
.today-outside-warn-head {
  display: flex;
  align-items: flex-start;
  gap: .7rem;
}
.today-outside-warn-icon {
  flex: 0 0 auto;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: #c2410c;
  color: #fff;
  font-size: .95rem;
  font-weight: 800;
  line-height: 1.6rem;
  text-align: center;
}
.today-outside-warn-title {
  font-size: .95rem;
  font-weight: 700;
  color: #9a3412;
  line-height: 1.25;
}
.today-outside-warn-meta {
  margin-top: .2rem;
  display: inline-block;
  font-size: .72rem;
  font-weight: 600;
  color: #92400e;
  background: rgba(255, 255, 255, .7);
  border: 1px solid #f0c36a;
  border-radius: .3rem;
  padding: .12rem .45rem;
  line-height: 1.3;
}
.today-outside-warn-text {
  margin: 0;
  font-size: .84rem;
  line-height: 1.45;
  color: #78350f;
}
.today-outside-confirm {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  margin: 0;
  padding: .7rem .75rem;
  border-radius: .4rem;
  background: #fff;
  border: 1px solid #e8c07a;
  cursor: pointer;
}
.today-outside-confirm input {
  flex: 0 0 auto;
  width: 1.1rem;
  height: 1.1rem;
  margin: .15rem 0 0;
  accent-color: var(--potok-teal);
  cursor: pointer;
}
.today-duration-row {
  display: flex;
  align-items: center;
  gap: .3rem;
}
.today-duration-row .form-control {
  width: 2.85rem;
  flex: 0 0 auto;
  padding-left: .3rem;
  padding-right: .3rem;
  text-align: center;
}
.today-duration-row .text-secondary {
  font-size: .78rem;
  line-height: 1;
}
.today-time-block {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-end;
  gap: .35rem .4rem;
}
.today-time-field {
  flex: 0 0 auto;
  min-width: 0;
}
.today-time-field .form-label {
  margin-bottom: .1rem;
  font-size: .72rem;
  line-height: 1.15;
  white-space: nowrap;
}
.today-time-field input[type="time"] {
  width: 6.4rem;
  max-width: 100%;
  padding-left: .4rem;
  padding-right: .3rem;
}
.today-time-duration {
  flex: 1 1 auto;
}
.today-time-duration .today-duration-row {
  min-height: calc(1.4285714em + .5rem + 2px);
}
.today-book-meta-row {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: .4rem .55rem;
  align-items: end;
}
.today-book-meta-field .form-label {
  margin-bottom: .1rem;
  font-size: .72rem;
  line-height: 1.15;
}
.today-book-meta-status .form-label {
  font-weight: 600;
}
.today-book-meta-status .form-select {
  font-size: .8rem;
  font-weight: 600;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.06);
}
.today-book-meta-status--pending .form-label { color: #92400e; }
.today-book-meta-status--pending .form-select {
  border-color: #f59e0b;
  background-color: #fef3c7;
  color: #92400e;
}
.today-book-meta-status--pending .form-select:focus {
  border-color: #d97706;
  box-shadow: 0 0 0 0.2rem rgba(245, 158, 11, 0.3);
}
.today-book-meta-status--confirmed .form-label { color: #075985; }
.today-book-meta-status--confirmed .form-select {
  border-color: #38bdf8;
  background-color: #e0f2fe;
  color: #075985;
}
.today-book-meta-status--confirmed .form-select:focus {
  border-color: #0284c7;
  box-shadow: 0 0 0 0.2rem rgba(14, 165, 233, 0.3);
}
.today-book-meta-status--done .form-label { color: #166534; }
.today-book-meta-status--done .form-select {
  border-color: #4ade80;
  background-color: #dcfce7;
  color: #166534;
}
.today-book-meta-status--done .form-select:focus {
  border-color: #16a34a;
  box-shadow: 0 0 0 0.2rem rgba(34, 197, 94, 0.3);
}
.today-book-meta-status--no_show .form-label { color: #991b1b; }
.today-book-meta-status--no_show .form-select {
  border-color: #f87171;
  background-color: #fee2e2;
  color: #991b1b;
}
.today-book-meta-status--no_show .form-select:focus {
  border-color: #dc2626;
  box-shadow: 0 0 0 0.2rem rgba(239, 68, 68, 0.3);
}
.today-book-meta-status--cancelled .form-label { color: #475569; }
.today-book-meta-status--cancelled .form-select {
  border-color: #94a3b8;
  background-color: #e2e8f0;
  color: #475569;
}
.today-book-meta-status--cancelled .form-select:focus {
  border-color: #64748b;
  box-shadow: 0 0 0 0.2rem rgba(100, 116, 139, 0.3);
}
/* Запись: тело растёт, Сохранить/Допродажа прижаты к низу drawer. */
#today-panel-booking > .today-drawer-form {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
#today-panel-booking > .today-drawer-form > .today-drawer-body {
  padding: .65rem .85rem .55rem;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
}
/* Edit: услуги — сосед формы; скролл списка, не обёртки (иначе клип подсказок). */
#today-panel-booking:has(> .today-booking-svc-wrap) > .today-drawer-form {
  flex: 0 1 auto;
  max-height: 48%;
}
#today-panel-booking > .today-booking-svc-wrap {
  flex: 1 1 auto;
  min-height: 0;
  padding: .45rem .85rem .35rem;
  overflow: visible;
  display: flex;
  flex-direction: column;
}
#today-panel-booking > .today-booking-svc-wrap .today-pay-items,
#today-panel-booking > .today-booking-svc-wrap #today-booking-svc-lines {
  flex: 1 1 auto;
  min-height: 0;
  max-height: min(40vh, 14rem);
  overflow-y: auto;
}
/* Create: услуги внутри body — не резать absolute-подсказки. */
#today-panel-booking .today-drawer-body .today-booking-svc-wrap {
  overflow: visible;
}
#today-panel-booking > .today-drawer-foot {
  flex: 0 0 auto;
  margin-top: auto;
  gap: .4rem;
  padding: .55rem .85rem;
}
.today-services-list {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  max-height: 11.5rem;
  overflow-y: auto;
  border: 1px solid rgba(15, 23, 42, .12);
  border-radius: .4rem;
  padding: .35rem .4rem;
  background: #fff;
}
.today-service-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: .45rem;
  align-items: start;
  margin: 0;
  padding: .3rem .25rem;
  border-radius: .3rem;
  cursor: pointer;
  font-size: .82rem;
  line-height: 1.25;
}
.today-service-item:hover {
  background: rgba(13, 148, 136, .06);
}
.today-service-item input {
  margin-top: .15rem;
  accent-color: var(--potok-teal);
}
.today-service-name {
  color: var(--potok-ink);
}
.today-service-dur {
  color: var(--potok-muted);
  font-size: .75rem;
}
.today-services-locked {
  background: #f8fafc;
  cursor: default;
}
.today-services-locked .today-service-item { cursor: default; }
.today-services-locked .today-service-item:hover { background: transparent; }
.today-charge-readonly {
  display: flex;
  flex-direction: column;
  gap: .25rem;
}
.today-charge-row {
  display: flex;
  gap: .45rem;
  align-items: baseline;
  padding: .25rem .15rem;
  font-size: .82rem;
  line-height: 1.25;
}
.today-charge-name { color: var(--potok-ink); flex: 1; min-width: 0; }
.today-charge-meta {
  color: var(--potok-muted);
  font-size: .75rem;
  white-space: nowrap;
  flex-shrink: 0;
}
.today-charge-sum {
  color: var(--potok-ink);
  font-weight: 600;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.today-charge-row .today-pay-kind {
  margin-left: .35rem;
  font-size: .68rem;
  font-weight: 600;
  color: #64748b;
  text-transform: lowercase;
}

.today-client-field {
  position: relative;
}
.today-client-suggest {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 20;
  margin-top: .2rem;
}
/* В сетке «Люди» (имя+телефон) — на всю ширину блока, не только своего поля. */
.today-people-grid > .today-client-field:not(.today-people-phone) .today-client-suggest {
  left: 0;
  right: calc(-100% * 1 / 1.15 - .5rem);
  width: auto;
  min-width: 20rem;
}
.today-people-grid > .today-people-phone .today-client-suggest {
  left: calc(-100% * 1.15 / 1 - .5rem);
  right: 0;
  width: auto;
  min-width: 20rem;
}
.today-client-suggest-list {
  list-style: none;
  margin: 0;
  padding: .25rem;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, .14);
  border-radius: .4rem;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .12);
  max-height: 12rem;
  overflow-y: auto;
}
.today-client-suggest-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .1rem;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: .4rem .5rem;
  border-radius: .3rem;
  cursor: pointer;
  font-size: .85rem;
}
.today-client-suggest-item:hover,
.today-client-suggest-item:focus {
  background: rgba(13, 148, 136, .1);
  outline: none;
}
.today-client-suggest-name {
  color: var(--potok-ink);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.today-client-suggest-phone {
  color: var(--potok-muted);
  font-size: .78rem;
  white-space: nowrap;
}
.today-phone-row {
  display: flex;
  align-items: stretch;
  gap: 0;
}
.today-phone-prefix {
  display: inline-flex;
  align-items: center;
  padding: 0 .55rem;
  border: 1px solid rgba(15, 23, 42, .12);
  border-right: 0;
  border-radius: .4rem 0 0 .4rem;
  background: rgba(15, 23, 42, .04);
  color: var(--potok-ink);
  font-weight: 600;
  font-size: .82rem;
}
.today-phone-row .form-control {
  border-radius: 0 .4rem .4rem 0;
}
.today-autofill-trap {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}
.form-hint {
  line-height: 1.35;
}
@media (max-width: 420px) {
  .today-time-block {
    flex-wrap: wrap;
  }
  .today-time-duration {
    order: 3;
    flex: 1 1 100%;
  }
  .today-time-field input[type="time"] {
    width: 100%;
  }
  .today-book-meta-row,
  .today-people-grid {
    grid-template-columns: 1fr;
  }
  .today-people-grid > .today-client-field:not(.today-people-phone) .today-client-suggest,
  .today-people-grid > .today-people-phone .today-client-suggest {
    left: 0;
    right: 0;
    width: auto;
    min-width: 0;
  }
}

.today-card {
  position: absolute;
  left: .25rem;
  right: .25rem;
  z-index: 3;
  border: 0;
  padding: 0;
  text-align: left;
  border-radius: .4rem;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .08);
  display: flex;
  flex-direction: column;
  min-height: 24px;
  background: transparent;
  color: inherit;
  font: inherit;
  box-sizing: border-box;
  transition: box-shadow .12s ease;
}
/* Раскрытие при наведении на тело — полная ширина/высота, вся инфа */
.today-card:has(.today-card-body:hover):not(.today-card-dragging) {
  height: auto !important;
  min-height: var(--card-h, 48px);
  left: .15rem !important;
  width: calc(100% - .3rem) !important;
  right: auto !important;
  overflow: visible;
  z-index: 40 !important;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .2);
}
.today-card:hover:not(.today-card-dragging):not(:has(.today-card-body:hover)) {
  z-index: 30 !important;
}
.today-card-stacked {
  outline: 1px solid rgba(255, 255, 255, .65);
}
.today-card-stacked:has(.today-card-body:hover):not(.today-card-dragging) {
  outline: 1px solid rgba(15, 23, 42, .12);
}
.today-card-stacked .today-card-body {
  background: color-mix(in srgb, var(--potok-teal-soft) 82%, transparent);
}
.today-card-stacked.today-card-pending .today-card-body {
  background: color-mix(in srgb, #fef9c3 82%, transparent);
}
.today-card-stacked.today-card-done .today-card-body {
  background: color-mix(in srgb, #dcfce7 82%, transparent);
}
.today-card-stacked.today-card-no_show .today-card-body {
  background: color-mix(in srgb, #fee2e2 82%, transparent);
}
.today-card-stacked:hover .today-card-body {
  background: var(--potok-teal-soft);
}
.today-card-stacked.today-card-pending:hover .today-card-body { background: #fef9c3; }
.today-card-stacked.today-card-done:hover .today-card-body { background: #dcfce7; }
.today-card-stacked.today-card-no_show:hover .today-card-body { background: #fee2e2; }
.today-card-head {
  background: var(--potok-teal);
  color: #fff;
  font-size: .68rem;
  font-weight: 600;
  padding: .2rem .4rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 0 0 auto;
  cursor: grab;
  user-select: none;
  touch-action: none;
  display: flex;
  align-items: center;
  gap: .25rem;
}
.today-card-head-title {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
}
.today-card-head > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.today-card-head-action {
  flex: 0 0 auto;
  margin-left: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  padding: 0;
  border: 0;
  border-radius: .25rem;
  background: rgba(0, 0, 0, .18);
  color: #fff;
  font-size: .7rem;
  line-height: 1;
  cursor: pointer;
  opacity: .85;
}
.today-card-head > button.today-card-head-action:first-of-type {
  margin-left: auto;
}
.today-card-head-action:hover,
.today-card-head-action:focus-visible {
  opacity: 1;
  outline: none;
}
.today-card-head-action:active {
  transform: scale(.96);
}
.today-card-move:hover,
.today-card-move:focus-visible {
  background: rgba(13, 148, 136, .92);
}
.today-card-delete:hover,
.today-card-delete:focus-visible {
  background: rgba(185, 28, 28, .92);
}
.today-card-cancel-open:hover,
.today-card-cancel-open:focus-visible {
  background: rgba(180, 83, 9, .92);
}
.today-card-in-buffer {
  outline: 2px solid var(--potok-teal);
  outline-offset: 1px;
  box-shadow: 0 0 0 3px rgba(13, 148, 136, .25);
}
.today-move-strip {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: .5rem;
  padding: .45rem .75rem;
  border-radius: .5rem;
  background: rgba(13, 148, 136, .12);
  border: 1px solid rgba(13, 148, 136, .35);
  color: #0f766e;
  font-size: .875rem;
}
.today-move-strip[hidden] {
  display: none !important;
}
.today-move-strip-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .35rem .65rem;
}
.today-move-strip-label {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  font-size: .72rem;
  opacity: .85;
}
.today-move-strip-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.today-move-strip-close {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  border: 0;
  border-radius: .35rem;
  background: rgba(15, 118, 110, .15);
  color: #0f766e;
  cursor: pointer;
}
.today-move-strip-close:hover,
.today-move-strip-close:focus-visible {
  background: rgba(185, 28, 28, .15);
  color: #b91c1c;
  outline: none;
}
.today-root.today-has-move-buffer .today-ghost-label {
  font-weight: 700;
}
.today-day-picker {
  width: auto;
  min-width: 9.5rem;
}
.today-card-dragging {
  opacity: .35;
  pointer-events: none;
  z-index: 8;
}
body.today-dragging {
  cursor: grabbing !important;
  user-select: none;
}
body.today-dragging .today-card-head {
  cursor: grabbing;
}
.today-col-body.today-drop-over {
  background-color: rgba(13, 148, 136, .06);
}
.today-drop-preview {
  position: absolute;
  left: .25rem;
  right: .25rem;
  z-index: 7;
  pointer-events: none;
  border: 2px dashed var(--potok-teal);
  background: rgba(13, 148, 136, .18);
  border-radius: .4rem;
  color: var(--potok-teal);
  font-size: .72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  padding: 0 .45rem;
  box-sizing: border-box;
}
.today-card-body {
  background: var(--potok-teal-soft);
  color: var(--potok-ink);
  padding: .25rem .4rem .35rem;
  flex: 1 1 auto;
  font-size: .75rem;
  line-height: 1.25;
  overflow: hidden;
  min-height: 1.15rem;
}
.today-card-tall .today-card-body {
  overflow: hidden;
}
.today-card:has(.today-card-body:hover):not(.today-card-dragging) .today-card-body {
  overflow: visible;
  padding-bottom: .5rem;
}
.today-card-who {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.today-card-via {
  color: var(--potok-muted);
  font-size: .65rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.today-card-phone {
  color: var(--potok-muted);
  font-size: .7rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.today-card-meta {
  display: flex;
  align-items: center;
  gap: .35rem;
  margin-top: .2rem;
  line-height: 1;
}
.today-card-icon {
  font-size: .7rem;
  opacity: .85;
}
.today-card-icon-source { color: #475569; }
.today-card-icon-visit-yes { color: #15803d; }
.today-card-icon-visit-no { color: #b45309; }
.today-card-icon-visit-skip { color: #94a3b8; opacity: .55; }
.today-card-icon-pay-paid { color: #15803d; }
.today-card-icon-pay-unpaid { color: #b91c1c; }
.today-card-icon-pay-waived { color: #94a3b8; opacity: .55; }
.today-card-icon-fulfill-rendered { color: #0f766e; }
.today-queue-miss,
.today-queue-dismiss {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .25rem;
}
.today-card-details {
  display: none;
  margin-top: .35rem;
  padding-top: .35rem;
  border-top: 1px solid rgba(15, 23, 42, .08);
}
.today-card-tall .today-card-details,
.today-card:has(.today-card-body:hover):not(.today-card-dragging) .today-card-details {
  display: block;
}
.today-card-tall .today-card-who,
.today-card-tall .today-card-phone,
.today-card-tall .today-card-service,
.today-card:has(.today-card-body:hover):not(.today-card-dragging) .today-card-who,
.today-card:has(.today-card-body:hover):not(.today-card-dragging) .today-card-phone,
.today-card:has(.today-card-body:hover):not(.today-card-dragging) .today-card-service {
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  word-break: break-word;
}
.today-card-service {
  font-size: .72rem;
  font-weight: 600;
  margin-bottom: .2rem;
  color: var(--potok-ink);
}
.today-card-comment {
  margin-top: .3rem;
  font-size: .7rem;
  line-height: 1.3;
  color: var(--potok-muted);
  white-space: pre-wrap;
  word-break: break-word;
}
.today-card-tall .today-card-comment {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
  overflow: hidden;
}
.today-card:has(.today-card-body:hover):not(.today-card-dragging) .today-card-comment {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
}
.today-card-status {
  display: inline-block;
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  padding: .15rem .4rem;
  border-radius: .25rem;
  background: rgba(15, 23, 42, .08);
  color: var(--potok-ink);
}
.today-card-pending .today-card-status { background: #fde68a; color: #92400e; }
.today-card-confirmed .today-card-status,
.today-card:not(.today-card-pending):not(.today-card-done):not(.today-card-no_show) .today-card-status {
  background: rgba(13, 148, 136, .18);
  color: #0f766e;
}
.today-card-done .today-card-status { background: #bbf7d0; color: #166534; }
.today-card-no_show .today-card-status { background: #fecaca; color: #991b1b; }
.today-card-oos .today-card-status { background: #ffedd5; color: #c2410c; }
.today-card-pending .today-card-head { background: #ca8a04; }
.today-card-pending .today-card-body { background: #fef9c3; }
.today-card-done .today-card-head { background: #15803d; }
.today-card-done .today-card-body { background: #dcfce7; }
.today-card-no_show .today-card-head { background: #b91c1c; }
.today-card-no_show .today-card-body { background: #fee2e2; }
/* Черновик новой записи: слот «занят формой», без клика/drag. */
.today-card-draft-hold {
  pointer-events: none;
  opacity: .92;
}
.today-card-draft-hold .today-card-head {
  background: #64748b;
}
.today-card-draft-hold .today-card-body {
  background: #e2e8f0;
  color: #475569;
}
.today-card-draft-hold .today-card-who {
  color: #334155;
  font-weight: 600;
}
.today-card-draft-hold .today-card-status {
  background: #cbd5e1;
  color: #475569;
}

.today-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .35);
  z-index: 1040;
}
/* Сертификат поверх «На линии» — без смены страницы. */
#gift-overlay-root:empty {
  display: none;
}
#gift-overlay-root .today-backdrop {
  z-index: 1060;
}
#gift-overlay-root .gift-card-drawer {
  z-index: 1061;
}
.today-drawer {
  --today-drawer-w: min(24rem, 100vw);
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: var(--today-drawer-w);
  background: #fff;
  z-index: 1050;
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 32px rgba(15, 23, 42, .12);
  overscroll-behavior: contain;
}
/* Продажи / «На линии» поверх drawer записи (оба с .today-drawer). */
.today-drawer.on-call-drawer {
  z-index: 1055;
}
#sales-root .today-backdrop,
#on-call-root .today-backdrop {
  z-index: 1054;
}
/* Оплата/продажи из карточки клиента — поверх карточки (1050). */
#sales-root .today-drawer {
  z-index: 1055;
}
/* Расход кассы короткий — без собственного скролла (иначе колесо уезжает на страницу). */
#cash-expense-drawer {
  overflow: hidden;
}
#cash-expense-drawer .today-drawer-body {
  overflow: visible;
  flex: 1 1 auto;
}
#cash-expense-drawer .today-drawer-form {
  overflow: hidden;
}
/* Пока overlay-drawer открыт — страница под ним не скроллится. */
body.potok-overlay-open {
  overflow: hidden;
}
/* Диалог — слева от очереди (стек от правого края) */
.today-drawer-chat {
  --today-chat-w: min(28rem, calc(100vw - 24rem));
  right: var(--today-drawer-w);
  width: var(--today-chat-w);
  z-index: 1049;
  box-shadow: -4px 0 24px rgba(15, 23, 42, .08);
}
/* ЛС: список пуст — чат один у правого края */
.today-drawer-chat-solo {
  right: 0;
  width: var(--today-drawer-w);
  z-index: 1050;
  box-shadow: -8px 0 32px rgba(15, 23, 42, .12);
}
/* Журнал Диалогов: чат шире очереди, список под затемнением */
.chat-journal-drawer.today-drawer-chat-solo {
  --today-drawer-w: min(28rem, 100vw);
}
.chat-channel-cell {
  width: 2.25rem;
  text-align: center;
  vertical-align: middle;
  padding-right: 0 !important;
}
.chat-channel-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  font-size: 1.15rem;
  line-height: 1;
}
.chat-channel-ico-telegram { color: #229ed9; }
.chat-channel-ico-vk { color: #0077ff; }
.chat-channel-ico-max { color: #4b5563; }
@media (max-width: 900px) {
  .today-drawer-chat {
    right: 0;
    width: 100vw;
    z-index: 1051;
  }
}
.today-attempts-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.today-attempts-link:hover {
  color: var(--tblr-primary);
}
.today-queue-item-active {
  background: rgba(32, 107, 196, .06);
  margin: 0 -.75rem;
  padding-left: .75rem !important;
  padding-right: .75rem !important;
  border-radius: .35rem;
}
.today-chat-head-text {
  min-width: 0;
  flex: 1;
  padding-right: .5rem;
}
.today-chat-head-owner {
  flex-direction: column;
  align-items: stretch;
  gap: .65rem;
}
.today-chat-head-row {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  min-width: 0;
}
.today-chat-avatar {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: #e2e8f0;
}
.today-chat-avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  font-weight: 700;
  color: #1e3a5f;
  background: #dbeafe;
}
.today-chat-head-badges {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  margin-top: .35rem;
}
.today-chat-head-meta {
  line-height: 1.35;
}
.today-chat-toolbar-head {
  margin-bottom: 0;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: .1rem;
}
.today-chat-toolbar-head .btn {
  white-space: nowrap;
  flex: 0 0 auto;
}
.today-lead-active {
  background: rgba(32, 107, 196, .06);
  margin: 0 -.75rem;
  padding-left: .75rem !important;
  padding-right: .75rem !important;
  border-radius: .35rem;
}
/* Компактный выбор причины «Завершить» — справа, не по центру */
.today-lead-close-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .28);
  z-index: 1055;
}
.today-lead-close-sheet {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 1056;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 4.25rem .85rem 1rem;
  pointer-events: none;
}
.today-lead-close-card {
  pointer-events: auto;
  width: min(18.5rem, calc(100vw - 1.5rem));
  background: #fff;
  border-radius: .5rem;
  box-shadow: -6px 10px 36px rgba(15, 23, 42, .2);
  padding: .9rem 1rem 1rem;
}
.today-lead-close-card h4 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}
.today-chat-head-text h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.today-chat-thread {
  background: #e8eef5;
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.owner-dm-draft-hint {
  line-height: 1.3;
}
.owner-dm-draft-hint:not(.d-none) {
  display: block;
}
.today-chat-row {
  display: flex;
  width: 100%;
}
.today-chat-row-in {
  justify-content: flex-start;
}
.today-chat-row-out {
  justify-content: flex-end;
}
.today-chat-bubble {
  max-width: 85%;
  padding: .4rem .7rem .35rem;
  border-radius: .85rem;
  font-size: .9rem;
  line-height: 1.35;
  box-shadow: 0 1px 1px rgba(15, 23, 42, .06);
}
.today-chat-in {
  background: #fff;
  color: var(--potok-ink);
  border-bottom-left-radius: .25rem;
}
.today-chat-out {
  background: var(--potok-teal);
  color: #fff;
  border-bottom-right-radius: .25rem;
}
.today-chat-out-op {
  background: #0d9488;
  color: #fff;
  border-bottom-right-radius: .25rem;
}
.today-chat-who {
  font-size: .65rem;
  font-weight: 600;
  letter-spacing: .02em;
  margin-bottom: .15rem;
  opacity: .7;
  text-transform: uppercase;
}
.today-chat-who-peer {
  text-transform: none;
  letter-spacing: 0;
  font-size: .7rem;
  opacity: .85;
  white-space: normal;
  word-break: break-word;
}
.today-chat-out .today-chat-who,
.today-chat-out-op .today-chat-who {
  color: rgba(255, 255, 255, .85);
  opacity: 1;
}
.today-chat-text {
  white-space: pre-wrap;
  word-break: break-word;
}
.today-chat-meta {
  margin-top: .2rem;
  font-size: .65rem;
  text-align: right;
  opacity: .65;
}
.today-chat-out .today-chat-meta,
.today-chat-out-op .today-chat-meta {
  color: rgba(255, 255, 255, .8);
  opacity: 1;
}
.today-chat-compose {
  flex-direction: column;
  align-items: stretch;
}
.today-chat-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  align-items: center;
  margin-bottom: .55rem;
}
.today-chat-form {
  display: flex;
  gap: .5rem;
  align-items: flex-end;
}
.today-chat-form textarea {
  flex: 1;
  min-height: 2.5rem;
  resize: vertical;
}
.today-chat-send {
  flex: 0 0 auto;
  width: 2.6rem;
  height: 2.6rem;
  padding: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.today-chat-send i {
  font-size: 1rem;
  margin-left: .1rem; /* оптика paper-plane */
}
.today-drawer-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 3rem 1rem 1.15rem;
  border-bottom: 1px solid var(--potok-line);
}
.today-drawer-head-text {
  min-width: 0;
  padding-right: .5rem;
}
.today-drawer-head h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}
.today-drawer-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem .55rem;
}
.today-drawer-badge {
  display: inline-flex;
  align-items: center;
  padding: .12rem .45rem;
  border-radius: .3rem;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  line-height: 1.2;
  vertical-align: middle;
}
.today-drawer-badge--draft {
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #f59e0b;
}
.today-drawer-badge--dirty {
  color: #9a3412;
  background: #ffedd5;
  border: 1px solid #fb923c;
}
.today-pay-gate-hint {
  margin: -.2rem 0 .45rem;
  padding: .35rem .55rem;
  border-radius: .35rem;
  font-size: .78rem;
  line-height: 1.3;
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fcd34d;
}
.today-pay-gate-hint.is-flash {
  animation: today-pay-gate-flash .55s ease;
}
@keyframes today-pay-gate-flash {
  0%, 100% { background: #fffbeb; }
  35% { background: #fde68a; }
}
.today-drawer-head-sub {
  margin-top: .15rem;
  font-size: .8rem;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.today-people-block {
  padding: .45rem .55rem .4rem;
  border: 1px solid #e2e8f0;
  border-radius: .45rem;
  background: #f8fafc;
}
.today-people-label {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: .35rem;
}
.today-people-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: .35rem .5rem;
  margin-bottom: .35rem;
}
.today-people-block .today-client-field { margin-bottom: 0; }
.today-people-block .today-people-phone { margin-bottom: 0; }
.today-people-block .form-label {
  margin-bottom: .1rem;
  font-size: .72rem;
}
.today-for-other-check {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin: 0;
  min-height: 1.25rem;
}
.today-for-other-check .form-check-input {
  margin-top: 0;
  flex: 0 0 auto;
}
.today-for-other-check .form-check-label {
  font-size: .8rem;
  color: #334155;
}
.today-people-block .today-visitor-field {
  margin-top: .35rem;
  padding-top: .4rem;
  border-top: 1px solid #e2e8f0;
}
.today-visitor-kind {
  display: inline-flex;
  gap: .15rem;
  padding: .12rem;
  margin: 0 0 .35rem;
  border-radius: .35rem;
  background: #e2e8f0;
}
.today-visitor-kind-opt {
  margin: 0;
  cursor: pointer;
}
.today-visitor-kind-opt input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.today-visitor-kind-opt span {
  display: block;
  padding: .2rem .55rem;
  border-radius: .28rem;
  font-size: .76rem;
  font-weight: 600;
  color: #475569;
  line-height: 1.15;
  user-select: none;
}
.today-visitor-kind-opt.is-active span {
  background: #fff;
  color: #0f172a;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .08);
}
.today-visitor-phone-wrap {
  margin-top: .35rem;
}

/* Крестик закрытия панелей: заметный круг + тёмный X, одинаковые отступы от угла.
   Tabler рисует X через -webkit-mask — без mask:none круг не виден. */
.today-drawer-head .btn-close,
.wh-drawer-head .btn-close {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  z-index: 2;
  width: 2rem;
  height: 2rem;
  padding: 0;
  margin: 0;
  border-radius: 50%;
  border: 1px solid #64748b;
  -webkit-mask: none !important;
  mask: none !important;
  background: #e2e8f0 url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%230f172a'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e") center / 0.8em auto no-repeat !important;
  opacity: 1 !important;
  filter: none !important;
  flex-shrink: 0;
  box-sizing: border-box;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .12);
}
.today-drawer-head .btn-close:hover,
.wh-drawer-head .btn-close:hover {
  background-color: #cbd5e1 !important;
  border-color: #334155;
  opacity: 1 !important;
}
.today-drawer-head .btn-close:focus,
.wh-drawer-head .btn-close:focus {
  box-shadow: 0 0 0 0.2rem rgba(14, 165, 233, .3);
  opacity: 1 !important;
}
.today-queue-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.4rem;
  margin-left: 0.4rem;
  border-radius: 999px;
  background: #dc2626;
  color: #fff !important;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  vertical-align: middle;
}
.today-queue-count.ms-1 {
  margin-left: 0.25rem;
}
.owner-dm-msg-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: #2563eb;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
}
.today-drawer-form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.today-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.15rem 1.25rem;
}
.today-drawer-foot {
  display: flex;
  flex-direction: column;
  gap: .55rem;
  padding: .85rem 1.15rem;
  border-top: 1px solid var(--potok-line);
  background: #f8fafc;
}
.today-cancel-pay-hint {
  margin: 0;
  padding: .4rem .55rem;
  font-size: .75rem;
  line-height: 1.35;
  color: #9a3412;
  background: #fff7ed;
  border: 1px solid #fdba74;
  border-radius: .35rem;
}
.today-drawer-foot-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: .5rem;
  width: 100%;
}
.today-drawer-foot-row > .btn {
  width: 100%;
  min-width: 0;
}
.today-drawer-foot-row--streams {
  grid-auto-columns: 1fr;
}
.today-book-upsell {
  margin-top: .15rem;
  padding: .55rem .6rem .6rem;
  border: 1px dashed color-mix(in srgb, var(--potok-teal) 45%, #94a3b8);
  border-radius: .5rem;
  background: color-mix(in srgb, var(--potok-teal) 6%, #fff);
}
.today-book-upsell-label {
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--potok-teal);
  margin: 0 0 .4rem;
  line-height: 1.2;
}
.today-book-upsell .today-drawer-foot-row {
  gap: .4rem;
}
.today-booking-svc-wrap {
  border-top: 1px solid var(--potok-line);
  padding-top: .75rem;
}

/* Группы на экране Интеграции (Телеграм / Телефония) */
.integ-group-title {
  display: flex;
  align-items: center;
  margin: 0 0 .85rem;
  font-size: 1rem;
  font-weight: 650;
  color: #0f172a;
  letter-spacing: .01em;
}
.integ-group-title i {
  color: #0f766e;
}
.integ-group + .integ-group {
  padding-top: .35rem;
  border-top: 1px solid var(--potok-line);
  padding-top: 1.15rem;
}

/* Exclusive-аккордеон «Поток»: одновременно открыта одна группа.
   JS: assets/potok-accordion.js (обёртка .potok-accordion-group). */
.potok-accordion-group {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.potok-accordion {
  border: 1px solid var(--potok-line);
  border-radius: .5rem;
  background: #f8fafc;
  padding: 0 .85rem .15rem;
}
.potok-accordion-summary {
  cursor: pointer;
  list-style: none;
  font-size: .875rem;
  font-weight: 600;
  color: #334155;
  padding: .7rem 0;
  user-select: none;
}
.potok-accordion-summary::-webkit-details-marker {
  display: none;
}
.potok-accordion-summary::before {
  content: "▸";
  display: inline-block;
  width: 1rem;
  flex-shrink: 0;
  color: #64748b;
  font-size: .85rem;
  font-weight: 700;
  line-height: 1;
  transition: transform .15s ease;
}
.potok-accordion[open] > .potok-accordion-summary::before {
  transform: rotate(90deg);
}
.potok-accordion-body {
  border-top: 1px solid var(--potok-line);
  padding-bottom: .35rem;
}

/* Фразы для бота: заголовок группы в summary */
.nlu-kw-summary {
  display: flex;
  align-items: center;
  gap: .5rem;
}
.nlu-kw-summary-label {
  flex: 1 1 auto;
  min-width: 0;
}
.nlu-kw-summary-meta {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  font-weight: 400;
}

/* Вкладки drawer записи: desktop tabs / mobile accordion-заголовки */
.today-book-nav {
  display: flex;
  gap: .3rem;
  margin: 0 0 .45rem;
  padding: .15rem;
  background: #f1f5f9;
  border-radius: .45rem;
}
.today-book-nav-btn {
  flex: 1;
  border: 0;
  background: transparent;
  border-radius: .35rem;
  padding: .35rem .5rem;
  font-size: .84rem;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
}
.today-book-nav-btn.is-active {
  background: #fff;
  color: #0f172a;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .08);
}
.today-book-panel { display: none; }
.today-book-panel.is-active {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.today-book-panel.is-active .today-drawer-form,
.today-book-panel.is-active .today-check-form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
/* Обёртка gate не должна ломать flex: иначе «Принять» уезжает за край drawer. */
#today-pay-gate-content {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}
#today-pay-gate-content > .today-check-form {
  flex: 1 1 auto;
  min-height: 0;
}
.today-check-tab-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: .65rem .85rem .55rem;
}
.today-check-foot {
  flex: 0 0 auto;
  gap: .4rem;
  padding: .55rem .85rem;
}
.today-pay-void-panel {
  padding: .55rem .85rem .15rem;
}
.today-pay-void-card {
  border: 1px solid #fecaca;
  background: #fff7f7;
  border-radius: .5rem;
  padding: .65rem .75rem;
}
.today-pay-void-title {
  font-weight: 700;
  font-size: .9rem;
  margin-bottom: .35rem;
  color: #7f1d1d;
}
.today-pay-void-dest {
  display: flex;
  align-items: center;
  gap: .35rem;
  margin: .2rem 0;
  cursor: pointer;
}
.today-pay-void-actions {
  display: flex;
  justify-content: flex-end;
  gap: .4rem;
  margin-top: .55rem;
}
.today-check-embed-code {
  font-size: .82rem;
  font-weight: 700;
  color: #0f172a;
}
.today-book-nav-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.today-book-acc-only { display: none; }
@media (max-width: 639px) {
  .today-book-nav { display: none; }
  .today-book-panel { display: block !important; }
  /* Оплата: колонка flex, чтобы «Принять» не обрезалась */
  #today-panel-check {
    display: flex !important;
    flex-direction: column;
    min-height: 0;
  }
  .today-book-panel + .today-book-panel {
    margin-top: 1rem;
    padding-top: .85rem;
    border-top: 1px solid var(--potok-line);
  }
  .today-book-acc-only {
    display: block;
    font-weight: 700;
    font-size: .95rem;
    margin-bottom: .65rem;
    color: #0f172a;
  }
}

.today-drawer-check {
  --today-drawer-w: min(28rem, 100vw);
}
.today-check-code {
  font-variant-numeric: tabular-nums;
  letter-spacing: .08em;
  font-weight: 700;
  color: #0f766e;
  margin-left: .15rem;
}
.today-check-meta-sub { margin-top: .25rem; line-height: 1.35; }
.today-check-acc-summary {
  display: flex;
  align-items: center;
  gap: .5rem;
}
.today-check-acc-label {
  flex: 1 1 auto;
  min-width: 0;
}
.today-check-acc-meta {
  flex: 0 0 auto;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #64748b;
  font-size: .8rem;
}
.today-check-sections .potok-accordion-body .today-pay-items {
  margin-top: .35rem;
}
.today-check-due-block {
  padding: .45rem .6rem;
  background: #f8fafc;
  border-radius: .4rem;
  border: 1px solid #e2e8f0;
}
.today-check-due-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-weight: 600;
  font-size: .9rem;
}
.today-check-due-row + .today-check-due-row {
  margin-top: .2rem;
}
.today-check-due-row--muted {
  font-weight: 500;
  font-size: .82rem;
  color: #64748b;
}
.today-check-due {
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}

.today-pay-meta { position: relative; }
.today-pay-who { font-weight: 700; font-size: .95rem; }
.today-pay-meta-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem .65rem;
  margin-top: .35rem;
}
.today-pay-badges { display: inline-flex; flex-wrap: wrap; gap: .3rem; }
.today-pay-badge {
  display: inline-block;
  font-size: .72rem;
  font-weight: 600;
  padding: .15rem .45rem;
  border-radius: .3rem;
  line-height: 1.2;
}
.today-pay-badge-paid { background: #dcfce7; color: #166534; }
.today-pay-badge-unpaid { background: #fee2e2; color: #991b1b; }
.today-pay-badge-waived { background: #e2e8f0; color: #475569; }
.today-pay-badge-rendered { background: #ccfbf1; color: #0f766e; }
.today-pay-fulfill .form-check-input { margin-top: .35rem; }
.today-pay-status-done { background: #dcfce7; color: #166534; }
.today-pay-status-confirmed { background: #e0f2fe; color: #075985; }
.today-pay-status-pending { background: #fef3c7; color: #92400e; }
.today-pay-status-no_show { background: #fee2e2; color: #991b1b; }
.today-pay-status-cancelled { background: #e2e8f0; color: #475569; }
.today-pay-doctor { margin-top: -.15rem; }
.today-pay-section-label {
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: #64748b;
  margin-bottom: .45rem;
}
.today-pay-items { display: flex; flex-direction: column; gap: .4rem; }
.today-pay-item {
  padding: .4rem .5rem;
  background: #e8eef5;
  border: 1px solid #d5dee9;
  border-radius: .4rem;
}
.today-pay-item-name {
  font-weight: 600;
  font-size: .88rem;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.today-pay-kind {
  font-size: .68rem;
  font-weight: 600;
  color: #64748b;
  margin-left: .3rem;
}
.today-pay-item-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: .35rem;
  min-width: 0;
}
.today-pay-item-row-main .today-pay-item-name { flex: 1 1 auto; }
.today-pay-qty { display: flex; align-items: center; gap: .15rem; flex: 0 0 auto; }
.today-pay-qty-btn {
  width: 1.55rem;
  height: 1.55rem;
  padding: 0;
  border: 1px solid #cbd5e1;
  border-radius: .3rem;
  background: #fff;
  color: #334155;
  font-size: .85rem;
  line-height: 1;
  cursor: pointer;
}
.today-pay-qty-btn:hover { background: #f1f5f9; }
.today-pay-qty-input { width: 2.6rem; text-align: center; padding-left: .2rem; padding-right: .2rem; }
.today-pay-price {
  display: flex;
  align-items: center;
  gap: .2rem;
  flex: 0 0 auto;
}
.today-pay-price-input { width: 4.75rem; text-align: right; }
.today-pay-line-qty {
  width: 3rem;
  flex: 0 0 auto;
  text-align: center;
  padding-left: .25rem;
  padding-right: .25rem;
}
.today-pay-rub { color: #64748b; font-size: .8rem; }
.today-pay-line {
  font-weight: 600;
  font-size: .85rem;
  min-width: 3.6rem;
  text-align: right;
  flex: 0 0 auto;
  white-space: nowrap;
}
.today-pay-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.55rem;
  height: 1.55rem;
  flex: 0 0 auto;
  border: 0;
  border-radius: .3rem;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  padding: 0;
}
.today-pay-remove:hover { color: #991b1b; background: #fee2e2; }
.today-pay-add { display: flex; flex-direction: column; gap: .4rem; }
.today-pay-service-combo { align-items: flex-start; }
.today-pay-service-field {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
}
.today-pay-service-suggest {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 40;
  margin-top: .2rem;
}
.today-pay-service-suggest .today-client-suggest-list {
  max-height: min(50vh, 16rem);
}
.today-pay-service-suggest .today-client-suggest-item.is-active {
  background: rgba(13, 148, 136, .14);
}
.today-pay-service-empty {
  padding: .45rem .55rem;
  color: #64748b;
  font-size: .8rem;
}
.today-pay-add-row {
  display: flex;
  flex-wrap: nowrap;
  gap: .35rem;
  align-items: center;
}
.today-pay-add-row .form-select { flex: 1 1 auto; min-width: 0; }
.today-pay-add-qty { width: 3.2rem; flex: 0 0 auto; text-align: center; }
.today-pay-add-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  flex: 0 0 auto;
  border: 1px solid #0d9488;
  border-radius: .4rem;
  background: #f0fdfa;
  color: #0f766e;
  cursor: pointer;
  padding: 0;
}
.today-pay-add-btn:hover { background: #ccfbf1; }
.today-pay-discount { display: flex; gap: .4rem; }
.today-pay-discount .form-select { flex: 1.4; }
.today-pay-discount .form-control { flex: 1; }
.today-pay-discount-calc {
  display: flex;
  flex-direction: column;
  gap: .15rem;
}
.today-pay-cert-no-discount {
  color: #92400e;
}
.today-pay-cover {
  border: 1px solid #e2e8f0;
  border-radius: .45rem;
  padding: .55rem .65rem;
  background: #fff;
}
.today-pay-cover-title {
  font-weight: 600;
  font-size: .85rem;
  margin-bottom: .45rem;
  color: #0f172a;
}
.today-pay-cover-block { margin-bottom: .55rem; }
.today-pay-cover-label {
  font-size: .7rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .02em;
  margin-bottom: .25rem;
}
.today-pay-now-row {
  display: flex;
  align-items: center;
  gap: .35rem;
  max-width: 11rem;
}
.today-pay-now-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .5rem;
}
.today-pay-now-field {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  margin: 0;
}
.today-pay-now-field-label {
  font-size: .75rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .02em;
}
.today-pay-extras {
  display: flex;
  flex-direction: column;
  gap: .55rem;
}
.today-pay-flags {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .4rem;
}
.today-pay-flag {
  position: relative;
  display: block;
  margin: 0;
  cursor: pointer;
  user-select: none;
}
.today-pay-flag.is-disabled {
  cursor: not-allowed;
  opacity: .55;
}
.today-pay-flag.is-static {
  cursor: default;
  pointer-events: none;
}
.today-pay-flag-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.today-pay-flag-ui {
  display: flex;
  align-items: flex-start;
  gap: .55rem;
  min-height: 2.75rem;
  padding: .5rem .6rem;
  border: 1px solid #e2e8f0;
  border-radius: .45rem;
  background: #fff;
  transition: border-color .12s ease, background .12s ease, box-shadow .12s ease;
}
.today-pay-flag:hover:not(.is-disabled) .today-pay-flag-ui {
  border-color: #94a3b8;
}
.today-pay-flag.is-on .today-pay-flag-ui,
.today-pay-flag-input:checked + .today-pay-flag-ui {
  border-color: #0d9488;
  background: #f0fdfa;
  box-shadow: inset 0 0 0 1px #0d9488;
}
.today-pay-flag--waived.is-on .today-pay-flag-ui,
.today-pay-flag--waived .today-pay-flag-input:checked + .today-pay-flag-ui {
  border-color: #d97706;
  background: #fffbeb;
  box-shadow: inset 0 0 0 1px #d97706;
}
.today-pay-flag--partial.is-on .today-pay-flag-ui {
  border-color: #ea580c;
  background: #fff7ed;
  box-shadow: inset 0 0 0 1px #ea580c;
}
.today-pay-flag-box {
  flex: 0 0 auto;
  width: 1.05rem;
  height: 1.05rem;
  margin-top: .1rem;
  border: 1.5px solid #94a3b8;
  border-radius: .25rem;
  background: #fff;
  position: relative;
}
.today-pay-flag.is-on .today-pay-flag-box,
.today-pay-flag-input:checked + .today-pay-flag-ui .today-pay-flag-box {
  border-color: #0f766e;
  background: #0d9488;
}
.today-pay-flag--waived.is-on .today-pay-flag-box,
.today-pay-flag--waived .today-pay-flag-input:checked + .today-pay-flag-ui .today-pay-flag-box {
  border-color: #b45309;
  background: #d97706;
}
.today-pay-flag--partial.is-on .today-pay-flag-box {
  border-color: #c2410c;
  background: #ea580c;
}
.today-pay-flag.is-on .today-pay-flag-box::after,
.today-pay-flag-input:checked + .today-pay-flag-ui .today-pay-flag-box::after {
  content: "";
  position: absolute;
  left: .28rem;
  top: .08rem;
  width: .28rem;
  height: .5rem;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.today-pay-flag-copy {
  display: flex;
  flex-direction: column;
  gap: .05rem;
  min-width: 0;
}
.today-pay-flag-title {
  font-size: .84rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
}
.today-pay-flag-hint {
  font-size: .68rem;
  color: #64748b;
  line-height: 1.25;
}
.today-pay-flag.is-on .today-pay-flag-title,
.today-pay-flag-input:checked + .today-pay-flag-ui .today-pay-flag-title {
  color: #0f766e;
}
.today-pay-flag--waived.is-on .today-pay-flag-title,
.today-pay-flag--waived .today-pay-flag-input:checked + .today-pay-flag-ui .today-pay-flag-title {
  color: #92400e;
}
.today-pay-flag--partial.is-on .today-pay-flag-title {
  color: #c2410c;
}
.today-pay-note {
  min-height: 4.5rem;
  resize: vertical;
}
.today-pay-cover-pure-debt {
  margin-top: .35rem;
}
#today-pay-pure-debt-hint {
  margin-top: .35rem;
}
@media (max-width: 360px) {
  .today-pay-flags { grid-template-columns: 1fr; }
}
button.today-pay-method {
  font: inherit;
  color: inherit;
  appearance: none;
  -webkit-appearance: none;
}
.today-pay-cover-summary {
  border-top: 1px solid #e2e8f0;
  padding-top: .4rem;
  display: flex;
  flex-direction: column;
  gap: .15rem;
}
.today-pay-cover-sum-caption {
  font-weight: 600;
  margin-bottom: .1rem;
  color: #64748b;
}
.today-pay-cover-sum-row {
  display: flex;
  justify-content: space-between;
  font-size: .82rem;
  color: #334155;
}
.today-pay-cover-sum-debt.is-debt {
  color: #be123c;
  font-weight: 600;
}
.today-pay-cover-unused {
  color: #b45309 !important;
}
.today-pay-methods--now {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  grid-template-columns: unset;
}
.today-pay-methods--now .today-pay-method {
  flex: 1 1 0;
  flex-direction: row;
  gap: .35rem;
  min-height: 0;
  padding: .3rem .55rem;
  font-size: .78rem;
  border-radius: .35rem;
}
.today-pay-methods--now .today-pay-method i {
  font-size: .8rem;
}
.today-pay-cert-list {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.today-pay-cert-pick {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  margin: 0;
  padding: .45rem .55rem;
  border: 1px solid #e2e8f0;
  border-radius: .45rem;
  background: #f8fafc;
  cursor: pointer;
}
.today-pay-cert-pick.is-active {
  border-color: #0d9488;
  background: #f0fdfa;
}
.today-pay-cert-pick input {
  margin-top: .15rem;
}
.today-pay-cert-pick-main {
  display: flex;
  flex-direction: column;
  gap: .1rem;
  min-width: 0;
}
.today-pay-cert-pick-code {
  font-weight: 600;
  font-size: .9rem;
  color: #0f172a;
}
.today-pay-cert-pick-meta {
  font-size: .8rem;
  color: #64748b;
}
.today-pay-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: .45rem;
  font-size: .95rem;
}
.today-pay-total-row:not(.today-pay-total-row-strong) {
  color: #64748b;
  font-weight: 500;
}
.today-pay-total-row-strong {
  font-weight: 700;
  font-size: 1.15rem;
  gap: .75rem;
  color: #0f172a;
  margin-top: .15rem;
}
.today-pay-total-wrap {
  display: flex;
  align-items: center;
  gap: .35rem;
}
.today-pay-total-input {
  width: 7.5rem;
  text-align: right;
  font-weight: 700;
  font-size: 1.15rem;
  line-height: 1.2;
  padding: .4rem .55rem;
  height: auto;
}
.today-pay-total-rub {
  font-weight: 700;
  font-size: 1.15rem;
  color: #0f172a;
}
.today-pay-methods {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .35rem;
}
/* 4 частых исхода оплаты в drawer — одна строка; сертификат — в аккордеоне. */
.today-pay-methods--outcomes {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .25rem;
}
.today-pay-method {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .25rem;
  margin: 0;
  padding: .45rem .25rem;
  border: 1px solid #e2e8f0;
  border-radius: .45rem;
  background: #fff;
  cursor: pointer;
  text-align: center;
  color: #64748b;
  font-size: .68rem;
  font-weight: 600;
  line-height: 1.15;
  min-height: 3.4rem;
}
.today-pay-methods--outcomes .today-pay-method {
  gap: .15rem;
  padding: .35rem .15rem;
  font-size: .62rem;
  min-height: 2.75rem;
  border-radius: .35rem;
}
.today-pay-method input { position: absolute; opacity: 0; width: 0; height: 0; }
.today-pay-method i { font-size: 1.05rem; color: #94a3b8; }
.today-pay-methods--outcomes .today-pay-method i { font-size: .9rem; }
.today-pay-method.is-active {
  border-color: #0d9488;
  background: #f0fdfa;
  color: #0f766e;
  box-shadow: inset 0 0 0 1px #0d9488;
}
.today-pay-method.is-active i { color: #0f766e; }
.today-pay-method:hover { border-color: #94a3b8; }
@media (max-width: 380px) {
  .today-pay-methods { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .today-pay-methods--outcomes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .today-pay-item-row { flex-wrap: wrap; }
}

/* Личка владельца: шаги 1→2→3 + кнопка у шага */
.owner-inbox-status .badge {
  font-weight: 600;
  font-size: 0.8rem;
  padding: 0.35rem 0.65rem;
}
.owner-inbox-howto {
  margin: 0 0 1rem;
  padding: 0.75rem 0.75rem 0.75rem 1.5rem;
  background: #f1f5f9;
  border-radius: 0.5rem;
  font-size: 0.85rem;
  line-height: 1.45;
  color: #334155;
}
.owner-inbox-howto li + li {
  margin-top: 0.4rem;
}
.owner-inbox-step {
  padding: 1rem 0 0.35rem;
  border-top: 1px solid var(--potok-line);
}
.owner-inbox-step:first-of-type {
  border-top: 0;
  padding-top: 0;
}
.owner-inbox-step-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.owner-inbox-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  background: #0f766e;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}
.owner-inbox-step-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #0f172a;
}
.owner-inbox-form .form-hint {
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: #64748b;
  line-height: 1.35;
}
.owner-inbox-foot {
  justify-content: space-between;
  gap: 0.5rem;
}

/* Список записей (Учёт): 2 строки в ячейке, без горизонтального скролла */
.booking-list-wrap { overflow-x: visible; }
.booking-list-table { width: 100%; }
.booking-list-table td { vertical-align: top; white-space: normal; }
.booking-cell {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  line-height: 1.25;
  max-width: 16rem;
}
.booking-cell-main { font-weight: 600; color: #0f172a; }
a.booking-cell-main.booking-slot-link {
  color: #0369a1;
  text-decoration: underline;
  text-underline-offset: 2px;
}
a.booking-cell-main.booking-slot-link:hover { color: #0c4a6e; }
.booking-cell-sub {
  font-size: .8rem;
  font-weight: 400;
  color: #64748b;
}
.booking-status-badge { font-size: .75rem; white-space: nowrap; }


/* Карточка, открытая в drawer (фокус со списка / клик) */
.today-card-focus {
  outline: 2px solid #0ea5e9;
  outline-offset: 1px;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, .25);
  z-index: 8 !important;
}

/* Карточка клиента (Учёт → Клиенты) */
.client-card-stack {
  --today-drawer-w: min(42rem, 100vw);
}
.client-card-drawer {
  --today-drawer-w: min(42rem, 100vw);
  z-index: 1050;
}
.client-card-chat.today-drawer-chat {
  --today-drawer-w: min(42rem, 100vw);
  --today-chat-w: min(28rem, calc(100vw - 42rem));
  right: var(--today-drawer-w);
  width: var(--today-chat-w);
  z-index: 1051;
  box-shadow: -4px 0 24px rgba(15, 23, 42, .08);
}
.client-card-peek-body {
  padding: .85rem 1rem 1.25rem;
}
.client-card-peek-h {
  font-size: .85rem;
  font-weight: 700;
  margin: .85rem 0 .35rem;
  color: #1e293b;
}
.client-card-peek-dl {
  margin: 0;
  display: grid;
  gap: .55rem;
}
.client-card-peek-dl > div {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: .5rem;
  align-items: start;
}
.client-card-peek-dl dt {
  margin: 0;
  font-size: .78rem;
  color: #64748b;
}
.client-card-peek-dl dd {
  margin: 0;
  font-size: .9rem;
  color: #0f172a;
}
.client-card-peek-lines {
  margin: 0;
  padding: 0;
}
.client-card-peek-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .75rem;
  padding: .4rem 0;
  border-bottom: 1px solid #e2e8f0;
  font-size: .9rem;
}
.client-card-peek-line:last-child {
  border-bottom: 0;
}
.client-card-peek-line-main {
  min-width: 0;
  flex: 1 1 auto;
}
.client-card-peek-line-money {
  display: inline-flex;
  align-items: baseline;
  gap: .65rem;
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
}
.client-card-peek-line-money strong {
  font-weight: 600;
  min-width: 4.5rem;
  text-align: right;
}
.client-card-peek-line-money .text-secondary {
  min-width: 4.5rem;
  text-align: right;
}
.client-card-pay-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: .35rem;
}
.client-card-pay-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem .55rem;
}
.client-card-pay-badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-weight: 600;
}
.client-card-pay-badge i {
  font-size: .85em;
}
.client-card-pay-when {
  font-size: .8rem;
}
@media (max-width: 900px) {
  .client-card-chat.today-drawer-chat {
    right: 0;
    width: 100vw;
    z-index: 1052;
  }
}
a.client-card-open {
  color: #0369a1;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
a.client-card-open:hover { color: #0c4a6e; }
.client-card-head {
  align-items: flex-start;
}
.client-card-head-main {
  flex: 1;
  min-width: 0;
  padding-right: 0;
}
.client-card-head h3 {
  margin-bottom: .25rem;
}
.client-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .5rem;
  align-items: center;
  font-size: .875rem;
}
.client-card-family {
  margin-top: .35rem;
}
.client-card-kpi {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: .25rem .4rem;
  padding: .55rem .75rem;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}
.client-card-kpi-item {
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
}
.client-card-kpi-val {
  font-weight: 700;
  font-size: .8rem;
  color: #0f172a;
  line-height: 1.15;
  word-break: break-word;
}
.client-card-kpi-lbl {
  font-size: .65rem;
  color: #64748b;
  text-transform: lowercase;
  line-height: 1.2;
}
.client-card-kpi-next {
  flex: 1 1 100%;
  text-align: left;
  padding-top: .35rem;
  margin-top: .15rem;
  border-top: 1px solid #e2e8f0;
}
.client-card-scope {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .35rem .5rem;
  padding: .5rem 1rem;
  border-bottom: 1px solid #e2e8f0;
}
.client-card-scope-hint {
  margin-left: .15rem;
  line-height: 1.25;
}
.client-card-body {
  padding: .75rem 1rem 1.5rem;
}
.client-card-section {
  margin-bottom: .5rem;
  border: 1px solid #e2e8f0;
  border-radius: .4rem;
  background: #fff;
  overflow: hidden;
}
.client-card-section-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .55rem;
  width: 100%;
  margin: 0;
  padding: .55rem .7rem;
  border: 0;
  background: #f8fafc;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.client-card-section-toggle::before {
  content: "▸";
  display: inline-block;
  width: 1rem;
  flex-shrink: 0;
  color: #64748b;
  font-size: .85rem;
  font-weight: 700;
  line-height: 1;
  transition: transform .15s ease;
}
.client-card-section.is-open > .client-card-section-toggle::before {
  transform: rotate(90deg);
}
.client-card-section-toggle:hover {
  background: #f1f5f9;
}
.client-card-section.is-open .client-card-section-toggle {
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
}
.client-card-section-title {
  flex: 1 1 auto;
  min-width: 0;
  font-size: .95rem;
  font-weight: 700;
}
.client-card-section-meta {
  display: flex;
  align-items: center;
  gap: .45rem;
  flex-shrink: 0;
}
.client-card-section-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0 .4rem;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
  font-size: .75rem;
  font-weight: 700;
  line-height: 1;
}
/* Индикатор — ::before слева; FA-шеврон в разметке скрыт. */
.client-card-section-chevron {
  display: none;
}
.client-card-section-body {
  padding: .65rem .7rem .75rem;
}
.client-card-section.client-card-soon {
  opacity: .75;
}
.client-card-section h4 {
  font-size: .95rem;
  font-weight: 700;
  margin-bottom: .5rem;
}
.client-card-timeline {
  list-style: none;
  padding: 0;
  margin: 0;
}
.client-card-timeline li {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: .5rem;
  padding: .4rem 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: .875rem;
}
.client-card-tl-when {
  color: #64748b;
  font-size: .8rem;
}
.client-card-table {
  font-size: .8rem;
}
.client-card-table tr.client-card-booking-debt > td {
  background: #fce7f3;
}
.client-card-table tr.client-card-booking-debt:hover > td {
  background: #fbcfe8;
}
.client-card-table tr.client-card-booking-row {
  cursor: pointer;
}
.client-card-table tr.client-card-booking-row-open > td {
  background: #f0fdfa;
}
.client-card-table tr.client-card-booking-row-open:hover > td {
  background: #ccfbf1;
}
.client-card-table tr.client-card-booking-debt.client-card-booking-row-open > td {
  background: #f0fdfa;
}
.client-card-amount-debt {
  color: #b91c1c;
  font-weight: 600;
}
.client-card-section-debts > .client-card-section-toggle {
  background: #fff1f2;
  border-color: #fecdd3;
}
.client-card-section-debts > .client-card-section-toggle:hover {
  background: #ffe4e6;
}
.client-card-section-debts.is-open > .client-card-section-toggle {
  border-color: #fda4af;
  background: #ffe4e6;
}
.client-card-section-debts > .client-card-section-body {
  background: #fff7f8;
  border-color: #fecdd3;
}
.client-card-section-debts .client-card-section-title {
  color: #881337;
}
.client-card-sub.client-card-sub-debt > .client-card-sub-toggle {
  background: #fff1f2;
}
.client-card-sub.client-card-sub-debt > .client-card-sub-toggle:hover {
  background: #ffe4e6;
}
.client-card-sub.client-card-sub-debt.is-open > .client-card-sub-body {
  background: #fff;
}
.client-card-debt-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .25rem;
}
.client-card-debt-open,
.client-card-debt-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .75rem;
  width: 100%;
  padding: .35rem .45rem;
  border-radius: .35rem;
  background: #fff;
  border: 1px solid #fecdd3;
  color: inherit;
  text-decoration: none;
  font-size: .875rem;
}
a.client-card-debt-open:hover {
  border-color: #fb7185;
  background: #fff7f8;
  color: #9f1239;
}
.client-card-debt-main {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .35rem .5rem;
  color: #0f172a;
}
.client-card-debt-main code {
  font-size: .8rem;
  background: #f1f5f9;
  border-radius: .25rem;
  padding: .05rem .35rem;
}
.client-card-debt-meta {
  color: #64748b;
  font-size: .8rem;
}
.client-card-sub.client-card-sale-debt > .client-card-sub-toggle {
  background: #fce7f3;
}
.client-card-sub.client-card-sale-debt > .client-card-sub-toggle:hover {
  background: #fbcfe8;
}
.client-card-sub.client-card-sale-debt.is-open > .client-card-sub-body {
  background: #fdf2f8;
}
.client-card-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: .875rem;
}
.client-card-list li {
  padding: .35rem 0;
  border-bottom: 1px solid #f1f5f9;
}
.client-card-chat-row {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  align-items: flex-start;
}
.client-card-chat-row-open {
  outline: 2px solid #0ea5e9;
  outline-offset: 1px;
  border-radius: .4rem;
  background: #f0f9ff;
  padding: .5rem .45rem !important;
  border-bottom-color: transparent !important;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, .15);
}
.client-card-tl-open {
  outline: 2px solid #0ea5e9;
  outline-offset: 1px;
  border-radius: .35rem;
  background: #f0f9ff;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, .12);
}
.client-card-chat-actions {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: .35rem;
}
.client-card-money-sum {
  font-size: .875rem;
  margin-bottom: .65rem;
}
.client-card-money-total { color: #0f172a; }
.client-card-receipts {
  display: grid;
  gap: .45rem;
}
.client-card-receipt-row {
  display: grid;
  grid-template-columns: 7.25rem minmax(0, 1fr) auto;
  gap: .55rem .75rem;
  align-items: start;
  padding: .55rem .65rem;
  border: 1px solid #e2e8f0;
  border-radius: .45rem;
  background: #fff;
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease;
}
.client-card-receipt-row:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}
.client-card-receipt-row-open {
  background: #f0fdfa;
  border-color: #99f6e4;
}
.client-card-receipt-row-open:hover {
  background: #ccfbf1;
}
.client-card-receipt-when {
  font-size: .78rem;
  color: #64748b;
  padding-top: .15rem;
}
.client-card-receipt-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem .5rem;
  margin-bottom: .15rem;
}
.client-card-receipt-title {
  font-size: .875rem;
  font-weight: 600;
  color: #0f172a;
}
.client-card-receipt-summary {
  font-size: .78rem;
  line-height: 1.35;
}
.client-card-receipt-pay {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.client-card-receipt-pay strong {
  font-size: .9rem;
  font-weight: 700;
  color: #0f172a;
}
.client-card-receipt-method {
  font-size: .72rem;
  margin-top: .1rem;
}
.client-card-tops {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: .85rem 1.25rem;
}
.client-card-tops-h {
  font-size: .8rem;
  font-weight: 700;
  margin: 0 0 .35rem;
  color: #334155;
}
.client-card-tops-list {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: tops;
}
.client-card-tops-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem;
  padding: .3rem 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: .85rem;
  counter-increment: tops;
}
.client-card-tops-list li::before {
  content: counter(tops) ".";
  color: #94a3b8;
  font-size: .75rem;
  min-width: 1.1rem;
}
.client-card-tops-name {
  flex: 1 1 auto;
  min-width: 0;
}
.client-card-tops-qty {
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 520px) {
  .client-card-receipt-row {
    grid-template-columns: 1fr auto;
  }
  .client-card-receipt-when {
    grid-column: 1 / -1;
  }
}
.client-card-cert-usable code {
  color: #15803d;
  font-weight: 600;
}
.client-card-cert-muted {
  color: #64748b;
}
.client-card-cert-muted code {
  color: #94a3b8;
}
.client-card-cert-muted strong {
  color: #64748b;
  font-weight: 500;
}
.client-card-sub {
  margin-bottom: .45rem;
  border: 1px solid #cbd5e1;
  border-radius: .35rem;
  background: #fff;
  overflow: hidden;
}
.client-card-sub:last-child {
  margin-bottom: 0;
}
.client-card-sub-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  width: 100%;
  margin: 0;
  padding: .45rem .55rem;
  border: 0;
  background: #eef2ff;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: #0f172a;
}
.client-card-sub-toggle::before {
  content: "▸";
  display: inline-block;
  width: 1rem;
  flex-shrink: 0;
  color: #64748b;
  font-size: .8rem;
  font-weight: 700;
  line-height: 1;
  transition: transform .15s ease;
}
.client-card-sub.is-open > .client-card-sub-toggle::before {
  transform: rotate(90deg);
}
.client-card-sub-toggle:hover {
  background: #e0e7ff;
}
.client-card-sub.is-open .client-card-sub-toggle {
  border-bottom: 1px solid #c7d2fe;
  background: #eef2ff;
}
.client-card-sub-title {
  flex: 1 1 auto;
  min-width: 0;
  font-size: .85rem;
  font-weight: 700;
  color: #1e293b;
}
.client-card-sub-meta {
  display: flex;
  align-items: center;
  gap: .4rem;
  flex-shrink: 0;
}
.client-card-sub-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 .35rem;
  border-radius: 999px;
  background: #c7d2fe;
  color: #312e81;
  font-size: .7rem;
  font-weight: 700;
  line-height: 1;
}
.client-card-sub-body {
  padding: .45rem .55rem .55rem;
  background: #fff;
}
@media (max-width: 640px) {
  .client-card-timeline li {
    grid-template-columns: 1fr;
  }
  .client-card-kpi {
    flex-wrap: wrap;
  }
  .client-card-kpi-item:not(.client-card-kpi-next) {
    flex: 1 1 30%;
  }
}

/* Подарочный сертификат — карточка для скрина / печати клиенту */
.gift-cert-stage {
  max-width: 36rem;
}
.gift-cert-stage-drawer {
  max-width: none;
}
.today-drawer.gift-card-drawer {
  --today-drawer-w: min(28rem, 100vw);
}
#gift-issue-drawer > .today-drawer-form {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
#gift-issue-drawer > .today-drawer-form > .today-drawer-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
}
#gift-issue-drawer > .today-drawer-form > .today-drawer-foot,
#gift-issue-drawer > .today-drawer-foot {
  flex: 0 0 auto;
}
.gift-issue-foot .gift-issue-bar {
  margin: 0;
}
.gift-card-drawer-foot {
  flex-wrap: wrap;
  gap: .35rem;
}
.gift-person-block {
  padding: .75rem .85rem;
  border-radius: .65rem;
  background: #f1f5f9;
  border: 1px solid var(--potok-line);
}
.gift-person-title {
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--potok-muted);
  margin-bottom: .5rem;
}
/* Покупатель с линии — только чтение, компактно */
.gift-buyer-locked {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .35rem .75rem;
  padding: .55rem .75rem;
  border-radius: .5rem;
  background: #f0fdfa;
  border: 1px solid #99f6e4;
}
.gift-buyer-locked-label {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #0f766e;
}
.gift-buyer-locked-main {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .35rem .65rem;
  min-width: 0;
}
.gift-buyer-locked-name {
  font-weight: 650;
  color: #0f172a;
}
.gift-buyer-locked-phone {
  font-variant-numeric: tabular-nums;
  color: #334155;
  font-size: .92rem;
}
.gift-issue-bar {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  align-items: center;
  padding: .65rem .7rem;
  border-radius: .65rem;
  background: linear-gradient(180deg, #f8fafc, #eef2f7);
  border: 1px solid var(--potok-line);
}
.gift-issue-bar .btn {
  margin: 0;
}
.gift-cert-card {
  position: relative;
  overflow: hidden;
  border-radius: 1rem;
  color: #f8fafc;
  background: #0b1220;
  box-shadow: 0 12px 40px rgba(15, 23, 42, .22);
  aspect-ratio: 16 / 10;
  min-height: 13.5rem;
}
.gift-cert-card-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(15, 118, 110, .55) 0%, transparent 55%),
    radial-gradient(90% 70% at 100% 100%, rgba(20, 184, 166, .28) 0%, transparent 50%),
    linear-gradient(145deg, #0b1220 0%, #132033 48%, #0f766e 160%);
}
.gift-cert-card-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    -18deg,
    transparent 0,
    transparent 11px,
    rgba(255, 255, 255, .025) 11px,
    rgba(255, 255, 255, .025) 12px
  );
  pointer-events: none;
}
.gift-cert-card-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  padding: 1.15rem 1.25rem 1.1rem;
}
.gift-cert-card-clinic {
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: rgba(248, 250, 252, .72);
}
.gift-cert-card-label {
  margin-top: .15rem;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -.02em;
}
.gift-cert-card-amount {
  font-size: clamp(2rem, 6vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: 1;
  margin-top: .35rem;
}
.gift-cert-card-rub {
  font-size: .55em;
  font-weight: 700;
  opacity: .85;
}
.gift-cert-card-meta {
  margin-top: .45rem;
  font-size: .8rem;
  color: rgba(248, 250, 252, .65);
}
.gift-cert-card-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
}
.gift-cert-card-code-label {
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(248, 250, 252, .55);
  margin-bottom: .2rem;
}
.gift-cert-card-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: .06em;
  user-select: all;
}
.gift-cert-card-qr {
  flex: 0 0 auto;
  width: 5.25rem;
  height: 5.25rem;
  padding: .35rem;
  border-radius: .55rem;
  background: #fff;
  color: #0b1220;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, .06);
}
.gift-cert-card-qr svg {
  display: block;
  width: 100%;
  height: 100%;
}
.gift-cert-stage-actions .btn-ghost {
  border: 0;
  color: var(--potok-muted);
}
@media print {
  body * {
    visibility: hidden !important;
  }
  #gift-card-drawer,
  #gift-card-drawer * {
    visibility: visible !important;
  }
  #gift-card-drawer {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    max-width: none;
    height: auto;
    box-shadow: none;
    border: 0;
  }
  .gift-cert-stage-hint,
  .gift-card-drawer-foot,
  .today-drawer-head,
  .today-backdrop,
  form.mt-3 {
    display: none !important;
  }
  .gift-cert-card {
    box-shadow: none;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* Учёт → Продажи: блоки фильтров / сводки / таблицы */
.sales-journal-root,
.chat-journal-root,
.gift-certs-root,
.clients-journal-root,
.cash-register-root {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.sales-journal-toolbar-card {
  padding: .85rem 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: .5rem;
}
.sales-journal-summary {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
}
.sales-journal-summary-item {
  display: flex;
  flex-direction: column;
  gap: .1rem;
  min-width: 7.5rem;
  padding: .55rem .75rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: .45rem;
}
.sales-journal-summary-label {
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #64748b;
}
.sales-journal-summary-value {
  font-size: .92rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.25;
}
.sales-journal-summary-item--debt {
  border-color: #fdba74;
  background: #fff7ed;
}
.sales-journal-summary-item--debt .sales-journal-summary-label {
  color: #c2410c;
}
.sales-journal-summary-item--debt .sales-journal-summary-value {
  color: #c2410c;
}
.sales-journal-summary-item--ok {
  border-color: #86efac;
  background: #f0fdf4;
}
.sales-journal-summary-item--ok .sales-journal-summary-label {
  color: #15803d;
}
.sales-journal-summary-item--ok .sales-journal-summary-value {
  color: #15803d;
}
/* Чип «Баланс клиентов» (+ аванс / долг в деталях) */
.sales-journal-summary-item--clients {
  border-color: #7dd3fc;
  background: #f0f9ff;
}
.sales-journal-summary-item--clients .sales-journal-summary-label {
  color: #0369a1;
}
.sales-journal-summary-item--clients .sales-journal-summary-value {
  color: #0369a1;
}
.cash-register-totals .cash-amt {
  font-weight: 700;
}
.cash-register-totals .cash-amt--wallet {
  color: #0369a1;
}
.cash-register-totals .cash-amt--prepaid {
  color: #0f766e;
}
.cash-register-totals .cash-amt--debt {
  color: #c2410c;
}
.cash-register-totals .sales-journal-summary-item {
  min-width: 12rem;
  flex: 1 1 12rem;
}
.cash-register-totals .sales-journal-summary-item.is-chip-active {
  box-shadow: 0 0 0 1px rgba(32, 107, 196, .35);
}
.cash-register-totals a.cash-chip-amt {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dotted currentColor;
  cursor: pointer;
}
.cash-register-totals a.cash-chip-amt:hover {
  opacity: .82;
  text-decoration: none;
  color: inherit;
}
.cash-register-totals a.cash-chip-amt.is-active {
  border-bottom-style: solid;
  font-weight: 800;
}
.cash-chip-filter-bar {
  display: flex;
  align-items: center;
  gap: .5rem;
  min-height: 1.75rem;
  margin: .35rem 0 .5rem;
  padding: .2rem .55rem;
  font-size: .78rem;
  line-height: 1.3;
  color: #334155;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: .35rem;
}
.cash-chip-filter-bar__text {
  flex: 1 1 auto;
  min-width: 0;
}
.cash-chip-filter-bar__clear {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  margin: 0;
  padding: 0;
  font-size: 1.15rem;
  line-height: 1;
  color: #64748b;
  text-decoration: none;
  border-radius: .25rem;
}
.cash-chip-filter-bar__clear:hover {
  color: #0f172a;
  background: #e2e8f0;
  text-decoration: none;
}
.cash-register-totals-detail {
  display: block;
  margin-top: .2rem;
  font-size: .72rem;
  font-weight: 500;
  color: #475569;
  line-height: 1.35;
}
.cash-register-root .sales-journal-toolbar {
  align-items: flex-end;
}
.cash-register-root .cash-register-period > .btn,
.cash-register-root .cash-register-dates > .form-control,
.cash-register-root .cash-register-dates > .input-group-text,
.cash-register-root .cash-register-dates > .btn,
.cash-register-root .cash-register-expense-btn {
  height: 2rem;
  min-height: 2rem;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-top: 0;
  padding-bottom: 0;
  line-height: 1.25;
  font-size: .8125rem;
}
.cash-register-root .cash-register-dates > .form-control {
  min-width: 9.5rem;
}
.cash-register-root .cash-register-meta {
  display: inline-flex;
  align-items: center;
  height: 2rem;
  margin: 0;
  white-space: nowrap;
}
.sales-journal-summary--chips {
  flex: 1 1 auto;
  align-items: stretch;
  margin: 0;
}
.sales-journal-scope-chip {
  text-decoration: none;
  color: inherit;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
  cursor: pointer;
}
.sales-journal-scope-chip:hover {
  border-color: #94a3b8;
  text-decoration: none;
  color: inherit;
}
.sales-journal-scope-chip.is-active {
  border-color: #206bc4;
  box-shadow: 0 0 0 1px #206bc4;
  background: #f0f7ff;
}
.sales-journal-scope-chip.is-active.sales-journal-summary-item--debt {
  border-color: #ea580c;
  box-shadow: 0 0 0 1px #ea580c;
  background: #fff7ed;
}
.sales-journal-root--v2 .sales-journal-toolbar {
  row-gap: .75rem;
}
.sales-journal-table-card {
  margin-bottom: 0;
}
.sales-journal-table-card tr.sales-journal-row-debt > td {
  background: #fff1f2;
}
.sales-journal-table-card tr.sales-journal-row-debt:hover > td {
  background: #ffe4e6;
}
.sales-journal-toolbar .sales-journal-filter .form-label {
  display: block;
  line-height: 1.25;
  min-height: 1.25rem;
  color: #64748b;
  font-weight: 600;
}
.sales-journal-toolbar .sales-journal-control,
.sales-journal-toolbar .sales-journal-control > .form-control,
.sales-journal-toolbar .sales-journal-control > .btn {
  height: 2rem;
  min-height: 2rem;
}
.sales-journal-toolbar .input-group-sm > .form-control,
.sales-journal-toolbar .input-group-sm > .btn {
  padding-top: 0;
  padding-bottom: 0;
  line-height: 1.9;
}
.sales-journal-toolbar .btn-group-sm > .btn {
  display: inline-flex;
  align-items: center;
  padding-top: 0;
  padding-bottom: 0;
  line-height: 1;
}

/* Баннер долгов плательщика в drawer записи */
.today-client-debt-host:empty {
  display: none;
}
.today-client-debt {
  border: 1px solid #fecdd3;
  border-radius: 0.5rem;
  background: #fff1f2;
  overflow: hidden;
}
.today-client-debt-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  cursor: pointer;
  list-style: none;
  color: #881337;
  font-weight: 600;
  font-size: 0.875rem;
}
.today-client-debt-summary::-webkit-details-marker {
  display: none;
}
.today-client-debt-summary::before {
  content: "▸";
  display: inline-block;
  width: 1rem;
  flex-shrink: 0;
  color: #be123c;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1;
  transition: transform 0.15s ease;
}
.today-client-debt[open] > .today-client-debt-summary::before {
  transform: rotate(90deg);
}
.today-client-debt-title {
  flex: 1 1 auto;
  min-width: 0;
}
.today-client-debt-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}
.today-client-debt-count {
  font-weight: 600;
  font-size: 0.8rem;
  color: #9f1239;
}
.today-client-debt-body {
  border-top: 1px solid #fecdd3;
  background: #fff7f8;
  padding: 0.4rem 0.5rem 0.55rem;
}
.today-client-debt-group + .today-client-debt-group {
  margin-top: 0.45rem;
}
.today-client-debt-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.15rem 0.25rem 0.3rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #9f1239;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.today-client-debt .client-card-debt-list {
  margin: 0;
}

/* «Ещё» → подтверждение визита: одна строка */
.today-previsit-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .35rem .5rem;
}
.today-previsit-row .form-label {
  margin-bottom: 0;
  white-space: nowrap;
  font-size: .8rem;
}
.today-previsit-days-input {
  width: 3.25rem;
  flex: 0 0 auto;
  text-align: center;
  padding-left: .35rem;
  padding-right: .35rem;
}
.today-previsit-unit {
  font-size: .8rem;
  color: #475569;
  flex-shrink: 0;
}
.today-previsit-hint {
  margin-left: .15rem;
  white-space: nowrap;
}

/* —— Итог дня —— */
.today-day-close-btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-weight: 600;
}
.today-day-close-dot {
  width: .55rem;
  height: .55rem;
  border-radius: 50%;
  background: #d97706;
  display: inline-block;
}
.today-day-close-drawer {
  --today-drawer-w: min(26rem, 100vw);
}
.today-day-close-docs-drawer {
  --today-docs-w: min(22rem, calc(100vw - 26rem));
  right: min(26rem, 100vw);
  width: var(--today-docs-w);
  z-index: 1049;
  box-shadow: -4px 0 24px rgba(15, 23, 42, .08);
}
@media (max-width: 720px) {
  .today-day-close-docs-drawer {
    right: 0;
    width: min(26rem, 100vw);
    z-index: 1051;
  }
}
.today-day-close-drawer .today-drawer-body {
  display: flex;
  flex-direction: column;
  gap: .85rem;
}
.today-day-close-drawer .today-drawer-foot {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .5rem;
  align-items: center;
}
.today-day-close-drawer .today-drawer-foot > .btn {
  width: auto;
  flex: 0 0 auto;
}
.dc-close-hint {
  flex: 1 0 100%;
  margin-top: 0;
  order: 3;
}

.dc-tail-list {
  display: flex;
  flex-direction: column;
  gap: .45rem;
  padding: .35rem 0 .15rem;
}
.dc-tail {
  display: block;
  padding: .65rem .7rem;
  border: 1px solid #e2e8f0;
  border-radius: .55rem;
  background: #f8fafc;
  color: inherit;
  text-decoration: none;
  transition: border-color .12s ease, background .12s ease;
}
.dc-tail:hover {
  border-color: #94a3b8;
  background: #fff;
  color: inherit;
}
.dc-tail-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .5rem;
  margin-bottom: .3rem;
}
.dc-tail-badges {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
}
.dc-chip {
  display: inline-flex;
  align-items: center;
  padding: .12rem .45rem;
  border-radius: .3rem;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .02em;
  line-height: 1.25;
  white-space: nowrap;
}
.dc-chip-teal {
  color: #0f766e;
  background: #ccfbf1;
  border: 1px solid #5eead4;
}
.dc-chip-blue {
  color: #1d4ed8;
  background: #dbeafe;
  border: 1px solid #93c5fd;
}
.dc-chip-purple {
  color: #6d28d9;
  background: #ede9fe;
  border: 1px solid #c4b5fd;
}
.dc-chip-orange {
  color: #c2410c;
  background: #ffedd5;
  border: 1px solid #fdba74;
}
.dc-chip-warning {
  color: #a16207;
  background: #fef3c7;
  border: 1px solid #fcd34d;
}
.dc-chip-danger {
  color: #b91c1c;
  background: #fee2e2;
  border: 1px solid #fca5a5;
}
.dc-chip-secondary,
.dc-chip-muted {
  color: #475569;
  background: #e2e8f0;
  border: 1px solid #cbd5e1;
}
.dc-tail-amount {
  font-size: .8rem;
  font-weight: 700;
  color: #c2410c;
  white-space: nowrap;
}
.dc-tail-amount-muted {
  color: #64748b;
  font-weight: 600;
}
.dc-tail-who {
  font-size: .92rem;
  line-height: 1.3;
}
.dc-tail-title {
  margin-top: .15rem;
  font-size: .8rem;
  color: #64748b;
  line-height: 1.3;
}

.dc-report {
  display: flex;
  flex-direction: column;
  gap: .65rem;
}
.dc-card {
  padding: .7rem .75rem .75rem;
  border: 1px solid #e2e8f0;
  border-radius: .65rem;
  background: #fff;
}
.dc-card-title {
  margin: 0 0 .55rem;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #64748b;
}
.dc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}
.dc-stat {
  display: inline-flex;
  flex-direction: column;
  gap: .1rem;
  min-width: 4.6rem;
  padding: .4rem .55rem;
  border-radius: .45rem;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}
.dc-stat-k {
  font-size: .65rem;
  font-weight: 600;
  color: #64748b;
  letter-spacing: .02em;
}
.dc-stat-v {
  font-size: .92rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
}
.dc-stat-ok {
  background: #ecfdf5;
  border-color: #a7f3d0;
}
.dc-stat-ok .dc-stat-v { color: #047857; }
.dc-stat-warn {
  background: #fff7ed;
  border-color: #fed7aa;
}
.dc-stat-warn .dc-stat-v { color: #c2410c; }
.dc-stat-money {
  background: #f0fdfa;
  border-color: #99f6e4;
}
.dc-stat-money .dc-stat-v { color: #0f766e; }
.dc-stat-muted {
  background: #f8fafc;
  border-color: #e2e8f0;
}
.dc-stat-muted .dc-stat-v { color: #64748b; }
.dc-total {
  padding: .55rem .65rem .65rem;
  border-radius: .65rem;
  background: linear-gradient(135deg, #0f766e 0%, #0e7490 100%);
  color: #fff;
}
.dc-cash-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .78rem;
  line-height: 1.25;
}
.dc-cash-table th,
.dc-cash-table td {
  padding: .28rem .15rem;
  vertical-align: baseline;
}
.dc-cash-table thead th {
  font-weight: 600;
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .03em;
  opacity: .78;
  text-align: right;
  border-bottom: 1px solid rgba(255, 255, 255, .22);
  padding-bottom: .35rem;
}
.dc-cash-table thead th:first-child {
  text-align: left;
}
.dc-cash-table tbody th {
  font-weight: 500;
  text-align: left;
  opacity: .9;
  padding-right: .35rem;
  white-space: nowrap;
}
.dc-cash-table tbody td {
  text-align: right;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.dc-cash-na {
  font-weight: 500 !important;
  opacity: .55;
}
.dc-cash-table-foot th,
.dc-cash-table-foot td {
  padding-top: .45rem;
  border-top: 1px solid rgba(255, 255, 255, .28);
  font-size: .85rem;
}
.dc-cash-table-foot td {
  font-size: .88rem;
}
.dc-cash-link {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, .45);
  text-underline-offset: .15em;
  font-weight: 700;
}
.dc-cash-link:hover,
.dc-cash-link.is-active {
  text-decoration-color: #fff;
  color: #fff;
}
.dc-docs-list {
  display: flex;
  flex-direction: column;
  gap: .15rem;
}
.dc-docs-row {
  display: grid;
  grid-template-columns: 7.2rem 1fr auto;
  gap: .45rem;
  align-items: start;
  padding: .45rem .35rem;
  border-radius: .45rem;
  color: inherit;
  text-decoration: none;
  border: 1px solid transparent;
}
a.dc-docs-row:hover {
  background: #f8fafc;
  border-color: #e2e8f0;
}
.dc-docs-row-static { cursor: default; }
.dc-docs-time {
  color: #64748b;
  font-variant-numeric: tabular-nums;
  font-size: .78rem;
  line-height: 1.3;
  padding-top: .1rem;
  white-space: normal;
}
.dc-docs-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .1rem;
}
.dc-docs-who {
  font-weight: 600;
  font-size: .9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dc-docs-kind {
  font-size: .78rem;
  color: #64748b;
}
.dc-docs-amt {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-size: .9rem;
}
.dc-card-sub {
  font-weight: 500;
  color: #64748b;
  font-size: .85rem;
  margin-left: .35rem;
}
.dc-transfer-list {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.dc-transfer-row {
  display: grid;
  grid-template-columns: 3.2rem 1fr auto;
  gap: .5rem;
  align-items: baseline;
  font-size: .88rem;
  padding: .2rem 0;
  border-bottom: 1px solid #f1f5f9;
}
.dc-transfer-row:last-child { border-bottom: 0; }
.dc-transfer-time { color: #64748b; font-variant-numeric: tabular-nums; }
.dc-transfer-who { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dc-transfer-amt { font-weight: 600; font-variant-numeric: tabular-nums; }
.dc-handover {
  margin-top: .85rem;
  padding: .7rem .75rem;
  border: 1px solid #e2e8f0;
  border-radius: .55rem;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: .55rem;
}
.dc-handover-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: 0;
  font-size: .9rem;
  cursor: pointer;
}
.dc-handover-label { flex: 1; min-width: 0; }
.dc-handover-amt {
  width: 6.5rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.dc-handover-rub { color: #64748b; }
