/* ── Base ──────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(circle at top center, rgba(196, 53, 43, 0.08), transparent 28%),
    linear-gradient(180deg, #080808 0%, #0b0b0b 40%, #111 100%);
  color: #fff;
  font-family: Arial, sans-serif;
  font-size: 13px;
  overflow-x: hidden;
}

.db-wrap {
  min-height: 100vh;
}

/* ── Toolbar (shell/nav/density/search rules live in topbar.css) ────── */

.db-layout-templates {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  position: relative;
}

.db-layout-template-picker {
  position: relative;
}

.db-layout-template-trigger {
  width: 150px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.82);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  outline: none;
  padding: 0 9px 0 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  text-align: left;
}

.db-layout-template-trigger:focus-visible,
.db-layout-template-picker.open .db-layout-template-trigger {
  border-color: rgba(255, 255, 255, 0.25);
}

.db-layout-template-trigger span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.db-layout-template-chevron {
  color: rgba(255,255,255,0.58);
  font-size: 14px;
  line-height: 1;
  transform: translateY(-1px);
}

.db-layout-template-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 190px;
  padding: 5px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(18, 18, 18, 0.98);
  box-shadow: 0 16px 36px rgba(0,0,0,0.42);
  backdrop-filter: blur(16px);
  z-index: 260;
  display: none;
}

.db-layout-template-picker.open .db-layout-template-menu {
  display: block;
}

.db-layout-template-row {
  display: flex;
  align-items: center;
  border-radius: 7px;
  overflow: hidden;
}

.db-layout-template-row:hover {
  background: rgba(255,255,255,0.07);
}

.db-layout-template-row.active {
  background: rgba(194, 53, 43, 0.28);
}

.db-layout-template-option {
  width: 100%;
  min-height: 30px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: rgba(255,255,255,0.72);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  padding: 0 9px;
  cursor: pointer;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.db-layout-template-option:hover {
  background: rgba(255,255,255,0.07);
  color: #fff;
}

.db-layout-template-option.active {
  background: rgba(194, 53, 43, 0.28);
  color: #fff;
}

.db-layout-template-row .db-layout-template-option:hover,
.db-layout-template-row.active .db-layout-template-option {
  background: transparent;
}

.db-layout-template-delete {
  width: 30px;
  height: 30px;
  border: 0;
  background: transparent;
  color: rgba(255,255,255,0.36);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  flex: 0 0 30px;
}

.db-layout-template-delete:hover {
  color: rgba(255,135,128,0.95);
  background: rgba(194,53,43,0.18);
}

.db-layout-template-add {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(194, 53, 43, 0.38);
  border-radius: 9px;
  background: rgba(194, 53, 43, 0.16);
  color: rgba(255, 205, 200, 0.96);
  font-family: inherit;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.db-layout-template-add:hover {
  background: rgba(194, 53, 43, 0.3);
  border-color: rgba(194, 53, 43, 0.62);
  color: #fff;
}

#dbHiddenBlocksTrigger { width: auto; padding-right: 10px; }

.db-hidden-blocks-count {
  display: none;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: rgba(194, 53, 43, 0.55);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

.db-hidden-blocks-count:not(:empty) { display: inline-block; }

.db-hidden-blocks-empty {
  padding: 8px 9px;
  color: rgba(255,255,255,0.4);
  font-size: 12px;
}

.db-block__hide {
  position: absolute;
  top: 10px;
  right: 11px;
  flex-shrink: 0;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.35);
  border-radius: 5px;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 10px;
  line-height: 1;
}

.db-block__hide:hover { color: #ff8780; border-color: rgba(194,53,43,0.5); background: rgba(194,53,43,0.16); }

.db-layout-name-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s;
}

.db-layout-name-modal.open {
  opacity: 1;
  pointer-events: all;
}

.db-layout-name-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.62);
  backdrop-filter: blur(5px);
}

.db-layout-name-modal__panel {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(390px, calc(100vw - 34px));
  transform: translate(-50%, -48%) scale(0.98);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  background: rgba(23,23,23,0.98);
  box-shadow: 0 24px 70px rgba(0,0,0,0.5);
  padding: 18px;
  transition: transform 0.18s;
}

.db-layout-name-modal.open .db-layout-name-modal__panel {
  transform: translate(-50%, -50%) scale(1);
}

.db-layout-name-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.db-layout-name-modal__head h3 {
  margin: 0;
  font-family: 'Oswald', sans-serif;
  font-size: 16px;
  letter-spacing: 0.02em;
}

.db-layout-name-modal__head button {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.72);
  font-size: 19px;
  cursor: pointer;
}

.db-layout-name-modal__label {
  display: block;
  margin-bottom: 7px;
  color: rgba(255,255,255,0.45);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.db-layout-name-modal__input {
  width: 100%;
  height: 42px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 10px;
  background: rgba(255,255,255,0.055);
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  outline: none;
  padding: 0 12px;
}

.db-layout-name-modal__input:focus {
  border-color: rgba(194,53,43,0.65);
  box-shadow: 0 0 0 3px rgba(194,53,43,0.14);
}

.db-layout-name-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.db-layout-name-modal__btn {
  height: 34px;
  border-radius: 9px;
  padding: 0 14px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.db-layout-name-modal__btn--ghost {
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.055);
  color: rgba(255,255,255,0.72);
}

.db-layout-name-modal__btn--primary {
  border: 1px solid rgba(194,53,43,0.58);
  background: rgba(194,53,43,0.35);
  color: #fff;
}

/* Dashboard toolbar wrapping */
#dbToolbar {
  align-items: flex-start;
}

#dbToolbar .db-toolbar__left,
#dbToolbar .db-toolbar__center,
#dbToolbar .db-toolbar__right {
  min-width: 0;
}

#dbToolbar .db-toolbar__center {
  flex: 1 1 470px;
  max-width: none;
  flex-wrap: wrap;
  row-gap: 6px;
}

#dbToolbar .db-search-wrap {
  flex: 1 1 190px;
  min-width: 170px;
}

#dbToolbar .db-layout-templates,
#dbToolbar .db-layout-template-picker {
  min-width: 0;
}

#dbToolbar .db-layout-template-trigger {
  max-width: 170px;
}

#dbToolbar #dbHiddenBlocksTrigger {
  width: 158px;
}

#dbToolbar .db-toolbar__right {
  flex: 1 1 520px;
  justify-content: flex-end;
  row-gap: 6px;
}

#dbToolbar .db-status-tabs {
  flex: 0 0 auto;
}

#dbToolbar .db-dir-dropdown {
  position: relative;
  flex: 0 0 190px;
  height: 30px;
}

#dbToolbar .db-dir-dropdown__trigger {
  width: 100%;
  height: 30px;
  border: 1px solid rgba(194, 53, 43, 0.42);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  color: rgba(255, 255, 255, 0.9);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  outline: none;
  padding: 0 10px 0 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  text-align: left;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

#dbToolbar .db-dir-dropdown__trigger:hover,
#dbToolbar .db-dir-dropdown.open .db-dir-dropdown__trigger {
  color: #fff;
  border-color: rgba(194, 53, 43, 0.68);
  background: rgba(194, 53, 43, 0.14);
}

#dbToolbar .db-dir-dropdown__icon,
#dbToolbar .db-dir-dropdown__chevron {
  flex: 0 0 auto;
}

#dbToolbar .db-dir-dropdown__trigger span:nth-child(2) {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#dbToolbar .db-dir-dropdown__chevron {
  color: rgba(255, 255, 255, 0.68);
  font-size: 15px;
  line-height: 1;
  transform: translateY(-1px);
}

#dbToolbar .db-dir-dropdown__menu {
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  width: 210px;
  padding: 5px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(18, 18, 18, 0.98);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(16px);
  z-index: 280;
  display: none;
}

#dbToolbar .db-dir-dropdown.open .db-dir-dropdown__menu {
  display: block;
}

#dbToolbar .db-dir-dropdown__option {
  width: 100%;
  min-height: 32px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: rgba(255, 255, 255, 0.74);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  padding: 0 10px;
  cursor: pointer;
  display: block;
}

#dbToolbar .db-dir-dropdown__option:hover {
  background: rgba(255, 255, 255, 0.075);
  color: #fff;
}

#dbToolbar .db-dir-dropdown__option.active {
  background: rgba(194, 53, 43, 0.32);
  color: #fff;
}

/* "Поиск по имени" live suggestions — jump straight to a client's card */
.db-search-suggest {
  position: absolute;
  top: calc(100% + 7px);
  left: 0;
  right: 0;
  max-height: 340px;
  overflow-y: auto;
  padding: 5px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(18, 18, 18, 0.98);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(16px);
  z-index: 280;
  display: none;
}

.db-search-suggest.open {
  display: block;
}

.db-search-suggest__item {
  display: flex;
  flex-direction: column;
  gap: 1px;
  width: 100%;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: rgba(255, 255, 255, 0.86);
  font-family: inherit;
  text-align: left;
  padding: 6px 10px;
  cursor: pointer;
}

.db-search-suggest__item:hover,
.db-search-suggest__item.active {
  background: rgba(194, 53, 43, 0.28);
}

.db-search-suggest__name {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.db-search-suggest__name mark {
  background: rgba(194, 53, 43, 0.45);
  color: #fff;
  border-radius: 3px;
  padding: 0 1px;
}

.db-search-suggest__meta {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.db-search-suggest__empty {
  padding: 10px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
  text-align: center;
}

@media (max-width: 1120px) {
  #dbToolbar .db-toolbar__left { order: 1; }
  #dbToolbar .db-toolbar__right { order: 2; flex: 1 1 auto; }
  #dbToolbar .db-toolbar__center { order: 3; flex: 1 0 100%; }
}

@media (max-width: 720px) {
  #dbToolbar .db-toolbar__center { flex-basis: 100%; }
  #dbToolbar .db-search-wrap { flex-basis: 100%; }
  #dbToolbar #dbLayoutTemplateTrigger,
  #dbToolbar #dbHiddenBlocksTrigger { width: 100%; max-width: none; }
  #dbToolbar .db-layout-templates,
  #dbToolbar #dbHiddenBlocksPicker { flex: 1 1 150px; }
  #dbToolbar .db-toolbar__right { justify-content: flex-start; }
}
/* Status tabs */
.db-status-tabs {
  display: flex;
  gap: 2px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 3px;
}

.db-status-tabs--period {
  background: rgba(218, 172, 64, 0.08);
  border: 1px solid rgba(218, 172, 64, 0.12);
}

.db-status-tabs--period .db-tab {
  padding-inline: 9px;
}

.db-status-tabs--period .db-tab.active {
  background: rgba(218, 172, 64, 0.28);
  color: rgba(255, 232, 174, 0.98);
}

.db-tab {
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  white-space: nowrap;
}
.db-tab.active { background: rgba(194, 53, 43, 0.85); color: #fff; }
.db-tab:hover:not(.active) { color: #fff; background: rgba(255, 255, 255, 0.08); }

.db-tab-badge {
  display: inline-block;
  margin-left: 5px;
  padding: 1px 6px;
  border-radius: 10px;
  background: rgba(194,53,43,0.4);
  color: rgba(255,140,120,0.95);
  font-size: 10px;
  font-weight: 700;
  vertical-align: middle;
  line-height: 1.5;
  min-width: 16px;
  text-align: center;
}
.db-tab.active .db-tab-badge { background: rgba(255,255,255,0.22); color: #fff; }
.db-tab-badge:empty { display: none; }

/* Direction pills */
.db-dir-pills { display: flex; gap: 4px; flex-wrap: wrap; }

.db-dir-pill {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.55);
  font-size: 11px;
  padding: 4px 9px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  white-space: nowrap;
}
.db-dir-pill:hover { color: #fff; border-color: rgba(255,255,255,0.2); background: rgba(255,255,255,0.1); }
.db-dir-pill.active { background: rgba(255,255,255,0.12); color: #fff; border-color: rgba(194,53,43,0.5); }

/* ── GridStack overrides ───────────────────────────────────────────── */

.db-grid { padding: 12px; }

.grid-stack-item { touch-action: none; }
.grid-stack-item-content { border-radius: 16px; overflow: hidden; }

/* Hide GridStack's corner resize-arrow glyphs — keep the cursor & hit area, lose the visual clutter */
.grid-stack-item > .ui-resizable-ne,
.grid-stack-item > .ui-resizable-nw,
.grid-stack-item > .ui-resizable-se,
.grid-stack-item > .ui-resizable-sw {
  background-image: none;
}

/* Keep a comfortable invisible hit area on the client card's left edge. */
.grid-stack-item[gs-id="client-preview"] > .ui-resizable-w {
  left: -6px;
  z-index: 110;
  width: 16px;
  opacity: 1;
  pointer-events: auto;
}

/* Placeholder shown when dragging a block */
.grid-stack-placeholder > .placeholder-content {
  background: rgba(194, 53, 43, 0.06);
  border: 2px dashed rgba(194, 53, 43, 0.4);
  border-radius: 16px;
}

/* ── Block ─────────────────────────────────────────────────────────── */

.db-block {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.028), rgba(255,255,255,0.01)),
    rgba(10, 10, 10, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.db-block.drag-over {
  border-color: rgba(194, 53, 43, 0.7);
  box-shadow: 0 0 0 1px rgba(194, 53, 43, 0.25), inset 0 0 20px rgba(194, 53, 43, 0.06);
}

/* Attention block */
.db-block--attention {
  border-color: rgba(194, 53, 43, 0.3);
  box-shadow: 0 0 0 1px rgba(194, 53, 43, 0.08), inset 0 0 24px rgba(194, 53, 43, 0.04);
}

.db-block--today {
  border-color: rgba(74, 190, 118, 0.34);
  box-shadow:
    0 0 0 1px rgba(74, 190, 118, 0.08),
    inset 0 0 24px rgba(74, 190, 118, 0.055);
  background:
    linear-gradient(180deg, rgba(74, 190, 118, 0.055), rgba(10, 10, 10, 0.2)),
    rgba(12, 12, 12, 0.94);
}

.db-block__head {
  display: flex;
  align-items: center;
  gap: 6px;
  /* Right padding reserves room for the pin/expand/hide cluster, which is
     pinned to the block's top-right corner (position: absolute, see below)
     instead of flowing with the rest of the header — otherwise whichever
     filter controls happened to be wide enough (status pills, a direction
     dropdown) pushed those three buttons to wherever they landed after
     wrapping, so their position differed block to block. */
  padding: 9px 80px 8px 11px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
  flex-wrap: wrap;
  min-height: 42px;
  cursor: move;
  user-select: none;
  touch-action: none;
}
/* Non-interactive children pass pointer events through to the drag handle */
.db-block__head > span,
.db-block__head > .db-block__icon,
.db-block__head > .db-block__title,
.db-block__head > .db-block__badge,
.db-block__head > .db-block__badge--attention { pointer-events: none; }
/* Buttons and pills stay clickable */
.db-block__head > button,
.db-block__head > .db-dir-pill { pointer-events: auto; cursor: pointer; }
/* Title is editable (double-click to rename) — needs to receive its own clicks */
.db-block__head > .db-block__title { pointer-events: auto; cursor: text; }

.db-block__icon { font-size: 15px; line-height: 1; flex-shrink: 0; }

.db-block__title {
  font-family: 'Oswald', sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.db-block__title-input {
  font-family: 'Oswald', sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.03em;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 4px;
  color: inherit;
  padding: 1px 5px;
  width: 140px;
  outline: none;
}

#todayBlockTitle {
  display: inline-block;
  min-width: 126px;
}

.db-block__badge {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 10px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}
.db-block__badge--active  { background: rgba(54,167,84,0.22); color: rgba(90,210,120,0.95); }
.db-block__badge--wait    { background: rgba(214,158,46,0.2); color: rgba(214,158,46,0.9); }
.db-block__badge--attention { background: rgba(194,53,43,0.25); color: rgba(255,100,90,0.95); }

/* .db-block__status-switch is a plain, transparent full-width row — its only
   job is forcing the filter row onto its own line below the icon/title/badges,
   the same way on every block regardless of current size, instead of merging
   into row 1 whenever there happened to be enough width and wrapping to some
   arbitrary spot otherwise. The visible pill group lives in the nested
   -track element below, sized to its own content, so the dark pill
   background doesn't stretch across the full (often much wider) block. */
.db-block__status-switch {
  display: flex;
  flex-shrink: 0;
  flex-basis: 100%;
  pointer-events: auto;
}

.db-block__status-switch-track {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  width: fit-content;
  height: 22px;
  padding: 2px;
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 7px;
  background: rgba(0,0,0,0.24);
  flex-shrink: 0;
  cursor: default;
}
.db-block__status-btn,
.db-block__segment-btn {
  height: 16px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 6px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: rgba(255,255,255,0.48);
  font: inherit;
  font-size: 9px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}
.db-block__status-btn span,
.db-block__segment-btn span {
  font-size: 9px;
  color: rgba(255,255,255,0.38);
  font-variant-numeric: tabular-nums;
}
.db-block__status-btn:hover,
.db-block__segment-btn:hover {
  color: #fff;
  background: rgba(255,255,255,0.06);
}
.db-block__status-btn.is-active,
.db-block__segment-btn.is-active {
  color: #fff;
  background: rgba(54,167,84,0.18);
}
.db-new-badge {
  flex: 0 0 auto;
  margin-left: 5px;
  font-size: 11px;
  line-height: 1;
  cursor: help;
}
.db-block__status-btn[data-status-filter="waiting"].is-active {
  background: rgba(214,158,46,0.2);
  color: rgba(255,205,120,0.96);
}

.db-block__dirs {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
  flex: 1;
  /* Same reasoning as .db-block__status-switch above: own row by default
     (for blocks with a direction filter but no status pills, e.g.
     "Первые/Разовые"). When a status-switch IS present right before it,
     it rides along on that same row instead of claiming a third one. */
  flex-basis: 100%;
}
.db-block__status-switch + .db-block__dirs {
  flex-basis: 0;
}

.db-block__dirs .db-dir-pill {
  font-size: 10px;
  padding: 3px 7px;
}

.db-block__dirs--select {
  display: inline-flex;
  align-items: center;
  position: relative;
  width: auto;
  min-width: 0;
  max-width: 148px;
  flex: 0 1 auto;
  margin-left: 2px;
  color: rgba(255, 255, 255, 0.46);
  pointer-events: auto;
}

.db-block__dir-select {
  width: 100%;
  height: 24px;
  padding: 0 24px 0 9px;
  border: 1px solid rgba(194, 53, 43, 0.42);
  border-radius: 7px;
  outline: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.86);
  font: inherit;
  font-size: 10px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.db-block__dir-select:hover {
  border-color: rgba(194, 53, 43, 0.7);
  background: rgba(255, 255, 255, 0.11);
}

.db-block__dir-select:focus-visible {
  border-color: rgba(218, 83, 72, 0.9);
  box-shadow: 0 0 0 2px rgba(194, 53, 43, 0.18);
}

.db-block__dir-select option {
  background: #171717;
  color: #fff;
}

.db-block__dirs--select .cs-wrap {
  width: auto;
  min-width: 0;
}

.db-block__dirs--select .cs-trigger {
  width: auto;
  min-width: 62px;
  max-width: 148px;
  height: 22px;
  min-height: 22px !important;
  padding: 0 21px 0 25px !important;
  gap: 0;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045) !important;
  color: rgba(255, 255, 255, 0.72);
  font: inherit;
  font-size: 9px;
  font-weight: 700;
}

.db-block__dirs--select::before {
  content: '';
  position: absolute;
  z-index: 1;
  left: 8px;
  top: 50%;
  width: 10px;
  height: 10px;
  background: currentColor;
  pointer-events: none;
  transform: translateY(-50%);
  clip-path: polygon(0 0, 100% 0, 62% 43%, 62% 100%, 38% 82%, 38% 43%);
}

.db-block__dirs--select .cs-trigger:hover {
  border-color: rgba(255, 255, 255, 0.2) !important;
  background: rgba(255, 255, 255, 0.08) !important;
  color: #fff;
}

.db-block__dirs--select .cs-wrap--open .cs-trigger,
.db-block__dirs--select .cs-trigger:focus-visible {
  border-color: rgba(194, 53, 43, 0.62) !important;
  background: rgba(194, 53, 43, 0.11) !important;
  box-shadow: 0 0 0 2px rgba(194, 53, 43, 0.1) !important;
  color: #fff;
}

.db-block__dirs--select.is-filtered {
  color: rgba(255, 132, 123, 0.9);
}

.db-block__dirs--select.is-filtered .cs-trigger {
  border-color: rgba(194, 53, 43, 0.38) !important;
  background: rgba(194, 53, 43, 0.09) !important;
  color: rgba(255, 202, 198, 0.94);
}

.db-block__dirs--select .cs-trigger .cs-icon {
  display: none;
}

.db-block__dirs--select .cs-trigger .cs-label,
.db-block__dirs--select .cs-trigger .cs-placeholder {
  min-width: 0;
  max-width: 96px;
  color: inherit;
  font-size: 9px;
}

.db-block__dirs--select .cs-trigger .cs-chevron {
  right: 7px;
  width: 8px;
}

.db-block--sm .db-block__dirs--select {
  max-width: 112px;
}

.db-block--sm .db-block__dirs--select .cs-trigger {
  max-width: 112px;
}

.db-block--sm .db-block__dirs--select .cs-trigger .cs-label,
.db-block--sm .db-block__dirs--select .cs-trigger .cs-placeholder {
  max-width: 60px;
}

.db-block--xs .db-block__dirs--select {
  width: 28px;
  max-width: 28px;
  flex: 0 0 28px;
  margin-left: auto;
}

.db-block--xs .db-block__dirs--select .cs-trigger {
  width: 28px;
  min-width: 28px;
  max-width: 28px;
  padding: 0 !important;
}

.db-block--xs .db-block__dirs--select::before {
  left: 9px;
}

.db-block--xs .db-block__dirs--select .cs-trigger .cs-label,
.db-block--xs .db-block__dirs--select .cs-trigger .cs-placeholder,
.db-block--xs .db-block__dirs--select .cs-trigger .cs-chevron {
  display: none;
}

.cs-dropdown-portal.db-block-filter-menu {
  padding: 4px;
  border-radius: 10px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.62), 0 0 0 1px rgba(255, 255, 255, 0.035) inset;
}

.cs-dropdown-portal.db-block-filter-menu .cs-option {
  min-height: 30px;
  padding: 5px 7px;
  gap: 7px;
  border-bottom: 0;
  border-radius: 6px;
  font-size: 11px;
}

.cs-dropdown-portal.db-block-filter-menu .cs-option .cs-icon {
  width: 19px;
  height: 19px;
  border-radius: 6px;
  font-size: 11px;
}

.db-block__nav-btn {
  flex-shrink: 0;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.35);
  border-radius: 6px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  transition: all 0.15s;
}
.db-block__nav-btn:hover { color: #fff; border-color: rgba(255,255,255,0.28); background: rgba(255,255,255,0.07); }
.db-block__nav-btn:disabled { opacity: 0.3; cursor: default; pointer-events: none; }

.db-block__zoom-btn {
  flex-shrink: 0;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.35);
  border-radius: 6px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  transition: all 0.15s;
}
.db-block__zoom-btn:hover { color: #fff; border-color: rgba(255,255,255,0.28); background: rgba(255,255,255,0.07); }
.db-block__zoom-btn:disabled { opacity: 0.3; cursor: default; pointer-events: none; }

.db-block__zoom-level {
  flex-shrink: 0;
  min-width: 34px;
  text-align: center;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  pointer-events: none;
}

.db-block__expand {
  position: absolute;
  top: 10px;
  right: 33px;
  flex-shrink: 0;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.35);
  border-radius: 5px;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 10px;
  transition: all 0.15s;
}
.db-block__expand:hover { color: #fff; border-color: rgba(255,255,255,0.28); background: rgba(255,255,255,0.07); }

.db-block__body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.08) transparent;
}

.db-block__more {
  background: none;
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.38);
  width: 100%;
  padding: 7px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  flex-shrink: 0;
}
.db-block__more:hover { color: #fff; background: rgba(255,255,255,0.04); }
.db-block__more.hidden { display: none; }

.db-block--collapsed .db-block__body,
.db-block--collapsed .db-block__more {
  display: none !important;
}

.db-block--collapsed .db-block__head {
  border-bottom: none;
}

.db-block--collapsed .db-block__title::after {
  content: ' · свернут';
  color: rgba(255,255,255,0.28);
  font-family: Inter, system-ui, sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

/* Archive */
.db-block--archive { opacity: 0.65; }
.db-block--archive:hover { opacity: 0.9; }

/* ── Adaptive density ──────────────────────────────────────────────── */

/* Elements hidden when block is too narrow */
.db-block--xs .db-d-sm,
.db-block--xs .db-d-md,
.db-block--xs .db-d-lg,
.db-block--sm .db-d-md,
.db-block--sm .db-d-lg,
.db-block--md .db-d-lg { display: none !important; }

/* ── Card ──────────────────────────────────────────────────────────── */

.db-card {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.035);
  cursor: pointer;
  transition: background 0.12s;
  user-select: none;
  min-width: 0;
}
.db-card:last-child { border-bottom: none; }
.db-card:hover { background: rgba(255, 255, 255, 0.04); }
.db-card.dragging { opacity: 0.35; cursor: grabbing; }

.db-card--today {
  position: relative;
  display: grid;
  grid-template-columns: minmax(calc(68px * var(--db-today-zoom, 1)), calc(90px * var(--db-today-zoom, 1))) minmax(0, 1fr);
  align-items: stretch;
  cursor: pointer;
  gap: calc(10px * var(--db-today-zoom, 1));
  padding: calc(10px * var(--db-today-zoom, 1)) calc(12px * var(--db-today-zoom, 1));
  border-left: 2px solid rgba(74, 190, 118, 0.42);
  border-bottom-color: rgba(255,255,255,0.07);
  background: linear-gradient(180deg, rgba(255,255,255,0.018), rgba(255,255,255,0.006));
}

.db-card--today:hover {
  background:
    linear-gradient(180deg, rgba(74, 190, 118, 0.045), rgba(255,255,255,0.014)),
    rgba(255,255,255,0.02);
}

.db-card--today-completed {
  border-left-color: rgba(214, 158, 46, 0.65);
  background: linear-gradient(180deg, rgba(214, 158, 46, 0.09), rgba(255,255,255,0.006));
}

.db-card--today-completed:hover {
  background:
    linear-gradient(180deg, rgba(214, 158, 46, 0.13), rgba(255,255,255,0.014)),
    rgba(255,255,255,0.02);
}

.db-card--today-completed::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: rgba(255, 255, 255, 0.16);
  pointer-events: none;
}

/* Group lesson card on "Сегодня" — one collapsed event per group session,
   expandable to show each enrolled student as their own today-card.
   Selector is doubled up (.db-card--today.db-card--today-group) so these
   overrides reliably beat the later "Today redesign" section's plain
   `.db-card--today` rules regardless of source order. */
.db-card--today.db-card--today-group {
  display: block;
  cursor: default;
  padding: 0;
}

.db-today-group__head {
  display: grid;
  grid-template-columns: minmax(calc(68px * var(--db-today-zoom, 1)), calc(90px * var(--db-today-zoom, 1))) minmax(0, 1fr) auto;
  align-items: center;
  gap: calc(10px * var(--db-today-zoom, 1));
  padding: calc(10px * var(--db-today-zoom, 1)) calc(12px * var(--db-today-zoom, 1));
  cursor: pointer;
}

.db-today-group__count {
  flex-shrink: 0;
  color: rgba(167, 246, 190, 0.85);
  font-size: calc(11px * var(--db-today-zoom, 1));
  font-weight: 750;
  white-space: nowrap;
}

.db-today-group__arrow {
  align-self: center;
  color: rgba(255,255,255,0.35);
  font-size: 11px;
  transition: transform 0.2s ease;
}

.db-card--today-group.db-today-group--expanded .db-today-group__arrow {
  transform: rotate(180deg);
}

.db-today-group__members {
  display: none;
  border-top: 1px solid rgba(255,255,255,0.07);
  background: rgba(0,0,0,0.14);
}

.db-card--today-group.db-today-group--expanded .db-today-group__members {
  display: block;
}

.db-today-group__members .db-card--today.db-card--today {
  border-left-color: rgba(74, 190, 118, 0.22);
  padding-left: calc(28px * var(--db-today-zoom, 1));
}

/* Group head has no finance column (that only makes sense per-student, shown
   once expanded) — its own class (not the shared .db-today-content) so it
   never inherits that class's two-column grid at any block size. */
.db-today-group__body {
  min-width: 0;
  display: flex;
  align-items: center;
}

/* Same event-category palette as schedule.js's legend (--schedule-first/
   subscription/group/rental/single in schedule.css) — !important like that
   file uses, since .db-card--today's border-left/timebox colors are already
   set (and re-set at several block-size breakpoints) elsewhere in this file. */
.db-card--today.db-today-kind--subscription { --db-today-kind-color: #5fa86a; }
.db-card--today.db-today-kind--first        { --db-today-kind-color: #c86262; }
.db-card--today.db-today-kind--single       { --db-today-kind-color: #6f9aa3; }
.db-card--today.db-today-kind--rental       { --db-today-kind-color: #6b7280; }
.db-card--today.db-today-kind--group        { --db-today-kind-color: #7e57c2; }

.db-card--today[class*="db-today-kind--"] {
  border-left-color: var(--db-today-kind-color) !important;
}

.db-card--today[class*="db-today-kind--"] .db-today-timebox {
  background: color-mix(in srgb, var(--db-today-kind-color) 16%, transparent) !important;
  border-color: color-mix(in srgb, var(--db-today-kind-color) 32%, transparent) !important;
}

.db-card--today[class*="db-today-kind--"] .db-today-time {
  color: var(--db-today-kind-color) !important;
}

.db-today-timebox {
  display: grid;
  position: relative;
  align-content: center;
  justify-items: center;
  gap: calc(4px * var(--db-today-zoom, 1));
  min-height: calc(62px * var(--db-today-zoom, 1));
  padding: calc(8px * var(--db-today-zoom, 1)) calc(6px * var(--db-today-zoom, 1));
  border-radius: 8px;
  background: rgba(74, 190, 118, 0.12);
  border: 1px solid rgba(74, 190, 118, 0.24);
  overflow: hidden;
  isolation: isolate;
}

.db-today-timeface {
  display: grid;
  justify-items: center;
  gap: 4px;
  transition: opacity 0.18s ease, transform 0.18s ease, filter 0.18s ease;
  z-index: 1;
  cursor: zoom-in;
}

.db-today-time {
  color: rgba(167, 246, 190, 0.98);
  font-size: calc(17px * var(--db-today-zoom, 1));
  font-weight: 850;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.db-today-duration {
  color: rgba(215, 245, 225, 0.72);
  font-size: calc(10px * var(--db-today-zoom, 1));
  font-weight: 750;
  line-height: 1;
  white-space: nowrap;
}

.db-today-time-photo {
  position: absolute;
  inset: 4px;
  z-index: 2;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 7px;
  border: 1px solid rgba(255,255,255,0.14);
  background:
    linear-gradient(135deg, rgba(218,172,64,0.24), rgba(74,190,118,0.08)),
    rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.9);
  font-family: 'Oswald', sans-serif;
  font-size: 18px;
  font-weight: 750;
  line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.055), 0 10px 20px rgba(0,0,0,0.24);
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.db-today-time-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.db-today-time-photo--image {
  background: rgba(255,255,255,0.035);
}

.db-today-timeface:hover + .db-today-time-photo {
  opacity: 1;
  transform: scale(1);
}

.db-today-timebox:has(.db-today-timeface:hover) .db-today-timeface {
  opacity: 0.08;
  transform: scale(0.92);
  filter: blur(1px);
}

.db-today-content {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(calc(210px * var(--db-today-zoom, 1)), calc(300px * var(--db-today-zoom, 1)));
  align-items: stretch;
  gap: calc(12px * var(--db-today-zoom, 1));
}

.db-today-main {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: calc(6px * var(--db-today-zoom, 1));
}

.db-today-clientline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.db-today-identity {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.db-card--today .db-today-name {
  flex: 0 1 auto;
  min-width: 0;
  color: rgba(255,255,255,0.96);
  font-size: calc(15px * var(--db-today-zoom, 1));
  font-weight: 850;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.db-today-fixed-meta {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  min-width: calc(22px * var(--db-today-zoom, 1));
  justify-self: end;
}

.db-today-phone {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: calc(118px * var(--db-today-zoom, 1));
  height: calc(22px * var(--db-today-zoom, 1));
  padding: 0 calc(7px * var(--db-today-zoom, 1));
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 5px;
  background: rgba(255,255,255,0.045);
  color: rgba(255,255,255,0.88);
  font-size: calc(11px * var(--db-today-zoom, 1));
  font-weight: 850;
  line-height: 1.1;
  text-decoration: none;
  white-space: nowrap;
  max-width: calc(170px * var(--db-today-zoom, 1));
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
}

.db-today-phone:hover {
  color: rgba(150,235,175,0.98);
  text-decoration: underline;
}

.db-today-phone--empty {
  min-width: calc(22px * var(--db-today-zoom, 1));
  width: calc(22px * var(--db-today-zoom, 1));
  padding: 0;
  border-color: rgba(245, 93, 82, 0.72);
  background: rgba(214, 70, 61, 0.24);
  box-shadow: 0 0 0 1px rgba(214, 70, 61, 0.14) inset;
  opacity: 1;
  pointer-events: none;
}

.db-today-phone--empty::before {
  content: '!';
  color: rgba(255, 185, 178, 0.98);
  font-size: calc(12px * var(--db-today-zoom, 1));
  font-weight: 900;
  line-height: 1;
}

.db-today-lang {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: calc(20px * var(--db-today-zoom, 1));
  padding: 0 calc(5px * var(--db-today-zoom, 1));
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.035);
  color: rgba(255,255,255,0.82);
  font-size: calc(9px * var(--db-today-zoom, 1));
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
  flex-shrink: 0;
}

.db-today-lang i {
  display: block;
  width: calc(12px * var(--db-today-zoom, 1));
  height: calc(8px * var(--db-today-zoom, 1));
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.18) inset;
  overflow: hidden;
  flex-shrink: 0;
}

.db-today-lang b {
  font: inherit;
  line-height: 1;
}

.db-today-lang--ro i {
  background: linear-gradient(90deg, #002b7f 0 33.33%, #fcd116 33.33% 66.66%, #ce1126 66.66% 100%);
}

.db-today-lang--ru i {
  background: linear-gradient(180deg, #fff 0 33.33%, #1f57c8 33.33% 66.66%, #d52b1e 66.66% 100%);
}

.db-today-lang--ua i {
  background: linear-gradient(180deg, #005bbb 0 50%, #ffd500 50% 100%);
}

.db-today-lang--en i {
  background:
    linear-gradient(32deg, transparent 0 42%, #fff 42% 48%, #c8102e 48% 52%, #fff 52% 58%, transparent 58% 100%),
    linear-gradient(148deg, transparent 0 42%, #fff 42% 48%, #c8102e 48% 52%, #fff 52% 58%, transparent 58% 100%),
    linear-gradient(90deg, transparent 0 41%, #fff 41% 45%, #c8102e 45% 55%, #fff 55% 59%, transparent 59% 100%),
    linear-gradient(180deg, transparent 0 36%, #fff 36% 42%, #c8102e 42% 58%, #fff 58% 64%, transparent 64% 100%),
    #012169;
}

.db-today-lang--empty {
  color: rgba(255,255,255,0.34);
  font-size: calc(15px * var(--db-today-zoom, 1));
  width: calc(22px * var(--db-today-zoom, 1));
  padding: 0;
}

.db-today-status--done {
  background: rgba(214, 158, 46, 0.2);
  color: rgba(255, 210, 130, 0.95);
  font-weight: 750;
}

.db-card--today .db-today-clientline > .db-tag {
  justify-self: end;
  white-space: nowrap;
}

.db-today-pills {
  display: flex;
  align-items: center;
  gap: calc(5px * var(--db-today-zoom, 1));
  flex-wrap: wrap;
  padding-top: calc(6px * var(--db-today-zoom, 1));
  border-top: 1px solid rgba(255,255,255,0.05);
  min-width: 0;
}

.db-today-main > .db-today-pills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(calc(128px * var(--db-today-zoom, 1)), 1fr));
  align-items: stretch;
}

.db-today-main > .db-today-pills .db-today-pill {
  width: 100%;
}

.db-today-pill {
  min-width: 0;
  max-width: 100%;
  min-height: calc(23px * var(--db-today-zoom, 1));
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: calc(3px * var(--db-today-zoom, 1)) calc(7px * var(--db-today-zoom, 1));
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.075);
  background: rgba(255,255,255,0.045);
  color: rgba(255,255,255,0.78);
  line-height: 1;
}

.db-today-pill--icon-only {
  width: calc(28px * var(--db-today-zoom, 1));
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}

.db-today-pill--icon-only b {
  font-size: calc(12px * var(--db-today-zoom, 1));
  line-height: 1;
}

.db-today-pill span {
  color: rgba(255,255,255,0.38);
  font-size: calc(9px * var(--db-today-zoom, 1));
  font-weight: 750;
  letter-spacing: 0;
  text-transform: uppercase;
  white-space: nowrap;
}

.db-today-pill b {
  min-width: 0;
  color: rgba(255,255,255,0.88);
  font-size: calc(11px * var(--db-today-zoom, 1));
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.db-today-pill--type {
  border-color: rgba(92, 165, 220, 0.24);
  background: rgba(92, 165, 220, 0.105);
}

.db-today-pill--empty {
  border-color: rgba(255,255,255,0.045);
  background: rgba(255,255,255,0.02);
}

.db-today-pill--empty b {
  color: rgba(255,255,255,0.32);
  font-weight: 700;
}

.db-today-pill--price {
  border-color: rgba(214, 158, 46, 0.28);
  background: rgba(214, 158, 46, 0.11);
}

.db-today-pill--price b {
  color: rgba(255, 220, 145, 0.96);
}

.db-today-pill--pay-paid,
.db-today-pill--ok {
  border-color: rgba(74, 190, 118, 0.25);
  background: rgba(74, 190, 118, 0.11);
}

.db-today-pill--pay-paid b,
.db-today-pill--ok b {
  color: rgba(150, 235, 175, 0.95);
}

.db-today-pill--pay-unpaid {
  border-color: rgba(214, 70, 61, 0.3);
  background: rgba(214, 70, 61, 0.12);
}

.db-today-pill--pay-unpaid b {
  color: rgba(255, 145, 136, 0.96);
}

.db-today-pill--renewal {
  border-color: rgba(235, 75, 65, 0.46);
  background: rgba(214, 70, 61, 0.14);
  box-shadow: inset 0 -2px 0 rgba(255, 95, 85, 0.78);
}

.db-today-pill--renewal span,
.db-today-pill--renewal b {
  color: rgba(255, 150, 142, 0.98);
}

.db-today-pill--renewal b {
  text-decoration: underline;
  text-decoration-color: rgba(255, 95, 85, 0.95);
  text-underline-offset: 3px;
  text-shadow: 0 0 8px rgba(255, 95, 85, 0.75);
}

.db-today-pill--pay-advance {
  border-color: rgba(214, 158, 46, 0.28);
  background: rgba(214, 158, 46, 0.12);
}

.db-today-pill--pay-advance b {
  color: rgba(255, 220, 145, 0.96);
}

.db-today-pills--finance {
  align-items: flex-start;
  gap: 4px;
  padding-top: 0;
  border-top: none;
}

.db-card--today .db-pay {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.045);
  border-radius: 6px;
  font-size: 15px;
  line-height: 1;
}

.db-today-finance {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: calc(5px * var(--db-today-zoom, 1));
  padding: calc(8px * var(--db-today-zoom, 1)) calc(10px * var(--db-today-zoom, 1));
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.08);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.014)),
    rgba(0,0,0,0.12);
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

.db-today-finance:hover,
.db-today-finance:focus-visible {
  border-color: rgba(255, 222, 150, 0.28);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.02)),
    rgba(0,0,0,0.14);
  outline: none;
  transform: translateY(-1px);
}

.db-today-finance__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  color: rgba(255,255,255,0.42);
  font-size: calc(9px * var(--db-today-zoom, 1));
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
  text-transform: uppercase;
}

.db-today-finance__amount {
  color: rgba(255, 222, 150, 0.98);
  font-size: calc(18px * var(--db-today-zoom, 1));
  font-weight: 900;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.db-today-finance__advance-note {
  color: rgba(255, 220, 145, 0.72);
  font-size: calc(11px * var(--db-today-zoom, 1));
  font-weight: 700;
  line-height: 1.2;
  white-space: normal;
  word-break: break-word;
}

.db-today-finance__status {
  width: fit-content;
  max-width: 100%;
  padding: calc(4px * var(--db-today-zoom, 1)) calc(7px * var(--db-today-zoom, 1));
  border-radius: 6px;
  color: rgba(255,255,255,0.82);
  background: rgba(255,255,255,0.05);
  font-size: calc(11px * var(--db-today-zoom, 1));
  font-weight: 850;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.db-today-finance--paid {
  border-color: rgba(74, 190, 118, 0.2);
  background:
    linear-gradient(180deg, rgba(74, 190, 118, 0.105), rgba(74, 190, 118, 0.025)),
    rgba(0,0,0,0.1);
}

.db-today-finance--paid .db-today-finance__status {
  background: rgba(74, 190, 118, 0.14);
  color: rgba(150, 235, 175, 0.96);
}

.db-today-finance--unpaid {
  border-color: rgba(214, 70, 61, 0.22);
  background:
    linear-gradient(180deg, rgba(214, 70, 61, 0.1), rgba(214, 70, 61, 0.025)),
    rgba(0,0,0,0.1);
}

.db-today-finance--unpaid .db-today-finance__status {
  background: rgba(214, 70, 61, 0.15);
  color: rgba(255, 145, 136, 0.98);
}

.db-today-finance--advance {
  border-color: rgba(214, 158, 46, 0.24);
  background:
    linear-gradient(180deg, rgba(214, 158, 46, 0.105), rgba(214, 158, 46, 0.025)),
    rgba(0,0,0,0.1);
}

.db-today-finance--advance .db-today-finance__status {
  background: rgba(214, 158, 46, 0.14);
  color: rgba(255, 220, 145, 0.98);
}

.db-today-finance .db-today-pill {
  min-height: calc(21px * var(--db-today-zoom, 1));
  padding: calc(3px * var(--db-today-zoom, 1)) calc(6px * var(--db-today-zoom, 1));
}

.db-today-comment {
  max-width: 100%;
  padding: 6px 8px;
  border-radius: 7px;
  background: rgba(255,255,255,0.035);
  color: rgba(255,255,255,0.64);
  font-size: 11px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Attention card */
.db-card--attn {
  border-left: 2px solid rgba(194, 53, 43, 0.5);
  padding-left: 8px;
}

.db-card__drag {
  color: rgba(255, 255, 255, 0.15);
  font-size: 13px;
  flex-shrink: 0;
  cursor: grab;
}

.db-card__name {
  font-size: 12px;
  font-weight: 600;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.db-block--xs .db-card--today,
.db-block--sm .db-card--today {
  grid-template-columns: 1fr;
  gap: 7px;
  padding: 8px 9px;
}

.db-block--xs .db-today-content,
.db-block--sm .db-today-content {
  grid-template-columns: 1fr;
  gap: 7px;
}

.db-block--xs .db-today-timebox,
.db-block--sm .db-today-timebox {
  min-height: 0;
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  justify-content: start;
  justify-items: start;
  padding: 6px 8px;
}

.db-block--xs .db-card--today .db-today-name,
.db-block--sm .db-card--today .db-today-name {
  font-size: 14px;
}

.db-block--xs .db-today-clientline,
.db-block--sm .db-today-clientline {
  grid-template-columns: minmax(0, 1fr) auto;
}

.db-block--xs .db-today-identity,
.db-block--sm .db-today-identity {
  gap: 7px;
}

.db-block--xs .db-card--today .db-today-clientline > .db-tag,
.db-block--sm .db-card--today .db-today-clientline > .db-tag {
  grid-column: 1 / -1;
  justify-self: start;
}

.db-block--xs .db-today-fixed-meta,
.db-block--sm .db-today-fixed-meta {
  min-width: auto;
}

.db-block--xs .db-today-phone,
.db-block--sm .db-today-phone {
  min-width: 104px;
  max-width: 138px;
  font-size: 10px;
}

.db-block--xs .db-today-lang,
.db-block--sm .db-today-lang {
  height: 18px;
  padding: 0 4px;
  font-size: 8px;
}

.db-block--xs .db-today-lang i,
.db-block--sm .db-today-lang i {
  width: 11px;
  height: 7px;
}

.db-block--xs .db-today-lang--empty,
.db-block--sm .db-today-lang--empty {
  width: 20px;
  height: 18px;
}

.db-block--xs .db-today-phone--empty,
.db-block--sm .db-today-phone--empty {
  min-width: 22px;
}

.db-block--xs .db-today-finance,
.db-block--sm .db-today-finance {
  padding: 7px 8px;
}

.db-block--xs .db-today-main > .db-today-pills,
.db-block--sm .db-today-main > .db-today-pills {
  grid-template-columns: 1fr;
}

.db-card__muted {
  color: rgba(255, 255, 255, 0.4);
  font-size: 11px;
  white-space: nowrap;
  flex-shrink: 0;
}

.db-card__phone {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.38);
  white-space: nowrap;
  flex-shrink: 0;
}

.db-card__lang {
  font-size: 13px;
  flex-shrink: 0;
  line-height: 1;
}

.db-card__teacher {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.38);
  white-space: nowrap;
  flex-shrink: 0;
}

.db-individual-dir-main,
.db-individual-dir-extra,
.db-individual-dir-more {
  flex-shrink: 0;
}

.db-individual-dir-more {
  min-width: 24px;
  justify-content: center;
  background: rgba(218, 172, 64, 0.18);
  color: rgba(255, 222, 150, 0.94);
  border-color: rgba(218, 172, 64, 0.24);
}

.db-block--lg .db-individual-dir-more,
.db-overlay__body.db-block--lg .db-individual-dir-more {
  display: none !important;
}

/* Attention dot */
.db-attn-dot {
  background: rgba(194, 53, 43, 0.85);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: help;
}

/* Attention reason (in attention block) */
.db-attn-reason {
  color: rgba(255, 120, 100, 0.75);
  font-size: 11px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Tags */
.db-tag {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.65);
  white-space: nowrap;
  flex-shrink: 0;
}
.db-tag--first  { background: rgba(194,53,43,0.22); color: rgba(255,120,110,0.95); }
.db-tag--single { background: rgba(90,90,210,0.22); color: rgba(160,160,255,0.95); }
.db-tag--waiting { background: rgba(214,158,46,0.2); color: rgba(214,158,46,0.9); }

button.db-tag {
  border: none;
  font-family: inherit;
  cursor: pointer;
  transition: filter 0.15s ease;
}
button.db-tag:hover { filter: brightness(1.2); }
.db-today-status--pending {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.6);
}

/* Payment icons */
.db-pay { font-size: 14px; font-weight: 700; flex-shrink: 0; line-height: 1; cursor: pointer; border-radius: 4px; padding: 1px 3px; transition: background .15s; }
.db-pay:hover { background: rgba(255,255,255,0.08); }
.db-pay--paid    { color: rgba(70,200,100,0.9); }
.db-pay--unpaid  { color: rgba(194,53,43,0.9); }
.db-pay--advance { color: rgba(214,158,46,0.9); }

/* ── Structured list-card grids ────────────────────────────────────────
   Every field always renders in a fixed slot (dash when empty) and each
   card type gets its own grid-template-columns, so values line up in
   vertical columns across rows — same principle as the Сегодня block,
   just compact (one row per client, no labels above values). */

.db-card__cell {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.db-card__name-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  overflow: hidden;
}
.db-card__name-wrap .db-card__name { flex: 1; }

.db-card__pay-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.db-card--individual,
.db-card--firstsingle,
.db-card--rental,
.db-card--member,
.db-card--lead,
.db-card--attn,
.db-card--archive,
.db-card--all-client {
  display: grid;
  align-items: center;
  column-gap: 8px;
}

/* Name grows to a comfortable reading width and stops — it does not soak up
   the entire leftover width of a wide block, which used to leave a big dead
   gap between the name and the fields after it. Any width beyond every
   field's cap is left as margin at the end of the row, not in the middle. */

/* Индивидуальные */
.db-card--individual {
  grid-template-columns: 14px minmax(90px,200px) 78px 24px 116px 100px 130px 50px 66px 20px;
}
.db-block--md .db-card--individual {
  grid-template-columns: 14px minmax(90px,200px) 78px 24px 116px 66px 20px;
}
.db-block--sm .db-card--individual {
  grid-template-columns: 14px minmax(70px,180px) 78px 24px 20px;
}
.db-block--xs .db-card--individual {
  grid-template-columns: 14px minmax(60px,160px) 78px 20px;
}

/* Первые / Разовые */
.db-card--firstsingle {
  grid-template-columns: 14px minmax(90px,200px) 58px 74px 24px 116px 100px 66px 20px;
}
.db-block--md .db-card--firstsingle {
  grid-template-columns: 14px minmax(90px,200px) 58px 74px 24px 116px 66px 20px;
}
.db-block--sm .db-card--firstsingle {
  grid-template-columns: 14px minmax(70px,180px) 58px 74px 24px 20px;
}
.db-block--xs .db-card--firstsingle {
  grid-template-columns: 14px minmax(60px,160px) 20px;
}

/* Аренда */
.db-card--rental {
  grid-template-columns: 14px minmax(90px,200px) 24px 74px 94px 116px 20px;
}
.db-block--md .db-card--rental {
  grid-template-columns: 14px minmax(90px,200px) 24px 74px 94px 20px;
}
.db-block--sm .db-card--rental {
  grid-template-columns: 14px minmax(70px,180px) 24px 74px 20px;
}
.db-block--xs .db-card--rental {
  grid-template-columns: 14px minmax(60px,160px) 20px;
}

/* Участники групп */
.db-card--member {
  grid-template-columns: 14px minmax(80px,180px) 24px 116px 100px 20px 20px;
}
.db-block--sm .db-card--member {
  grid-template-columns: 14px minmax(70px,160px) 24px 20px 20px;
}
.db-block--xs .db-card--member {
  grid-template-columns: 14px minmax(60px,150px) 20px 20px;
}

/* Hover-revealed "remove from group" button — reserves its own empty column
   (like db-card__pay-cell) so it never overlaps the payment icon and never
   shifts the rest of the row when it fades in. */
.db-card__remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: rgba(255, 255, 255, 0.3);
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s, background 0.12s, color 0.12s;
}
.db-card--member:hover .db-card__remove,
.db-card__remove:focus-visible {
  opacity: 1;
}
.db-card__remove:hover {
  background: rgba(212, 70, 61, 0.2);
  color: #ff8179;
}
@media (hover: none) {
  /* No hover on touch — keep it dimly visible instead of unreachable. */
  .db-card__remove { opacity: 0.45; }
}

/* Лиды */
.db-card--lead {
  grid-template-columns: 14px minmax(80px,180px) 74px 74px 24px 116px 66px;
}
.db-block--sm .db-card--lead {
  grid-template-columns: 14px minmax(70px,160px) 74px 74px 24px;
}
.db-block--xs .db-card--lead {
  grid-template-columns: 14px minmax(60px,150px) 74px;
}

/* Требует внимания — reason is free text, so it keeps growing to show more
   of the message; only the name is capped. */
.db-card--attn {
  grid-template-columns: 14px minmax(70px,160px) 74px minmax(80px,1.3fr) 20px;
}
.db-block--xs .db-card--attn {
  grid-template-columns: 14px minmax(60px,150px) minmax(60px,1fr) 20px;
}

/* Архив */
.db-card--archive {
  grid-template-columns: 14px minmax(80px,180px) 74px 24px 116px;
}
.db-block--sm .db-card--archive {
  grid-template-columns: 14px minmax(70px,160px) 74px 24px;
}
.db-block--xs .db-card--archive {
  grid-template-columns: 14px minmax(60px,150px) 74px;
}

/* Все клиенты — comment is free text, kept flexible; name is capped. */
.db-card--all-client {
  grid-template-columns: minmax(90px,200px) 116px 84px 74px 100px 24px 110px 60px 74px minmax(90px,1fr) 20px;
}
.db-block--md .db-card--all-client {
  grid-template-columns: minmax(90px,200px) 116px 84px 74px 100px 24px 110px 20px;
}
.db-block--sm .db-card--all-client {
  grid-template-columns: minmax(70px,160px) 84px 74px 20px;
}
.db-block--xs .db-card--all-client {
  grid-template-columns: minmax(60px,150px) 84px 20px;
}

@keyframes dbPayPulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(194,53,43,0); }
  40%     { box-shadow: 0 0 0 5px rgba(194,53,43,0.6); }
}
.db-cm-pay-pulse {
  animation: dbPayPulse 0.6s ease 3;
  border-color: rgba(194,53,43,0.8) !important;
}
.db-cm-field--pay-highlight {
  border-radius: 8px;
  background: rgba(194,53,43,0.07);
  outline: 1px solid rgba(194,53,43,0.35);
  transition: background .2s, outline .2s;
}
.db-cm-field--disabled { opacity: 0.38; pointer-events: none; }
.db-cm-field--disabled .db-cm-edit-control { cursor: not-allowed; }

@keyframes dbAdvPulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(194,53,43,0); border-color: rgba(255,255,255,0.09); }
  35%     { box-shadow: 0 0 0 4px rgba(194,53,43,0.5); border-color: rgba(194,53,43,0.8); }
}
.db-cm-adv-pulse { animation: dbAdvPulse 0.55s ease 2; }

/* ── Group ─────────────────────────────────────────────────────────── */

.db-group { border-bottom: 1px solid rgba(255,255,255,0.05); }
.db-group:last-child { border-bottom: none; }

.db-group__head {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  cursor: pointer;
  transition: background 0.12s;
}
.db-group__head:hover { background: rgba(255,255,255,0.04); }

.db-group__name {
  font-size: 12px;
  font-weight: 600;
  flex: 1;
}

.db-group__name--renameable {
  cursor: text;
  border-bottom: 1px dashed transparent;
  transition: border-color 0.15s;
}
.db-group__name--renameable:hover { border-bottom-color: rgba(255,255,255,0.25); }

.db-rename-input {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(194,53,43,0.55);
  border-radius: 5px;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  padding: 2px 6px;
  outline: none;
  min-width: 80px;
  max-width: 160px;
  flex: 1;
}

.db-group__count { font-size: 11px; color: rgba(255,255,255,0.4); flex-shrink: 0; }
.db-group__arrow { color: rgba(255,255,255,0.3); font-size: 11px; transition: transform 0.2s; flex-shrink: 0; }

.db-group__schedule-info {
  padding: 0 10px 6px 10px;
  font-size: 10.5px;
  color: rgba(255,255,255,0.4);
}
.db-group.collapsed .db-group__schedule-info { display: none; }

.db-group.collapsed .db-group__arrow   { transform: rotate(-90deg); }

/* Collapsed group — same "dots" summary language as schedule.html's
   compact waiting zone, instead of just vanishing: each seated member
   shrinks to a small green dot (still draggable/hoverable), so a glance at
   a collapsed group still shows roughly how full it is. */
.db-group.collapsed .db-group__members {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  min-height: 15px;
  padding: 4px 12px 8px 30px;
  border-left: none;
  margin-left: 0;
}
.db-group.collapsed .db-group__members .db-card--member {
  width: 9px;
  min-width: 9px;
  height: 9px;
  min-height: 9px;
  flex: 0 0 9px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(60, 200, 100, 0.8);
  box-shadow: 0 0 0 2px rgba(60, 200, 100, 0.16);
  cursor: grab;
  transition: transform 0.12s, box-shadow 0.12s;
}
.db-group.collapsed .db-group__members .db-card--member:hover {
  transform: scale(1.15);
  box-shadow: 0 0 0 4px rgba(60, 200, 100, 0.22);
}
.db-group.collapsed .db-group__members .db-card--member > * { display: none; }
.db-group.collapsed .db-group__drop-hint { display: none !important; }

.db-group__members {
  padding: 2px 0 4px 12px;
  border-left: 1px solid rgba(255,255,255,0.06);
  margin-left: 18px;
}

.db-group__members.drag-over {
  border-left-color: rgba(60, 180, 100, 0.8);
  background: rgba(30, 120, 60, 0.15);
  border-radius: 6px;
  outline: 1.5px dashed rgba(60, 180, 100, 0.6);
  outline-offset: 2px;
}

.db-group__drop-hint {
  display: none;
  font-size: 11px;
  color: rgba(60, 200, 100, 0.8);
  padding: 6px 4px;
  text-align: center;
  font-weight: 500;
  cursor: pointer;
}
.db-group__drop-hint:hover { color: rgba(80, 230, 120, 1); }

.db-group__members.drag-over .db-group__drop-hint {
  display: block;
}

/* A group with zero members has nothing else to make its row look like a
   valid drop target (the hint is otherwise only shown mid-drag) — keep it
   visible so an empty group doesn't read as an inert, easy-to-miss sliver. */
.db-group__drop-hint--empty {
  display: block;
  opacity: 0.55;
  border: 1px dashed rgba(60, 200, 100, 0.35);
  border-radius: 6px;
  margin: 2px 4px 4px;
}

.db-group.dnd-drop-target {
  outline: 2px solid rgba(60, 200, 100, 0.6);
  outline-offset: 2px;
  border-radius: 6px;
}
.db-group.dnd-drop-target .db-group__head {
  background: rgba(40, 160, 80, 0.2);
  border-radius: 4px;
}
.db-group.dnd-drop-target .db-group__members {
  display: block !important;
  border-left-color: rgba(60, 200, 100, 0.8);
  background: rgba(40, 140, 70, 0.18);
  min-height: 28px;
}
.db-group.dnd-drop-target .db-group__drop-hint {
  display: block;
  opacity: 1;
  border-style: solid;
  color: rgba(80, 230, 120, 0.95);
  font-size: 11px;
  font-weight: 600;
}

/* Hovering a group whose direction doesn't match the dragged member's own
   direction (e.g. a drums-tariff client over a guitar group) — drop is
   rejected, so signal it as blocked instead of the normal "will drop here". */
.db-group.dnd-group-blocked {
  outline: 2px solid rgba(214, 70, 61, 0.65);
  outline-offset: 2px;
  border-radius: 6px;
  cursor: no-drop;
}
.db-group.dnd-group-blocked .db-group__head {
  background: rgba(214, 70, 61, 0.16);
  border-radius: 4px;
}

.db-group--unassigned .db-group__head { opacity: 0.7; }

.db-card--member { padding: 4px 8px; }

/* ── Lead status ───────────────────────────────────────────────────── */

.db-lead-status { font-size: 10px; padding: 2px 7px; border-radius: 5px; white-space: nowrap; flex-shrink: 0; }
.db-lead--new        { background: rgba(70,130,220,0.2); color: rgba(120,170,255,0.9); }
.db-lead--inprogress { background: rgba(214,158,46,0.2); color: rgba(214,158,46,0.9); }
.db-lead--rejected   { background: rgba(194,53,43,0.2);  color: rgba(255,100,90,0.9); }

/* ── Empty state ───────────────────────────────────────────────────── */

.db-empty { text-align:center; color:rgba(255,255,255,0.22); font-size:12px; padding:20px; }

/* ── Client Preview Block ──────────────────────────────────────────── */

.db-block--client-preview {
  border-color: rgba(218, 172, 64, 0.34);
  box-shadow:
    0 0 0 1px rgba(218, 172, 64, 0.055),
    inset 0 0 24px rgba(218, 172, 64, 0.055);
  background:
    radial-gradient(circle at 14% 8%, rgba(218,172,64,0.16), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,0.025), rgba(7,7,7,0.14)),
    rgba(13,13,13,0.96);
}

.db-block--all-clients {
  border-color: rgba(255,255,255,0.22);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.045),
    inset 0 0 24px rgba(255,255,255,0.04);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.045), rgba(10,10,10,0.18)),
    rgba(14,14,14,0.95);
}

.db-card--all-client {
  cursor: pointer;
  gap: 7px;
}

.db-preview-card {
  position: relative;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 100%;
  height: 100%;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.16) transparent;
}

.db-preview-card--loading {
  justify-content: flex-start;
}

.db-preview-card--loading::after {
  content: '';
  width: 100%;
  height: 3px;
  border-radius: 999px;
  overflow: hidden;
  background:
    linear-gradient(90deg, transparent, rgba(218,172,64,0.55), transparent),
    rgba(255,255,255,0.055);
  background-size: 45% 100%, 100% 100%;
  background-repeat: no-repeat;
  animation: dbPreviewLoading 1s ease-in-out infinite;
}

@keyframes dbPreviewLoading {
  from { background-position: -45% 0, 0 0; }
  to { background-position: 145% 0, 0 0; }
}
.db-preview-card--pinned { box-shadow: inset 0 0 0 1px rgba(218,172,64,0.18); }
.db-preview-client-pin-note {
  align-self: flex-end;
  margin-bottom: -4px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(74, 190, 118, 0.16);
  color: rgba(150, 235, 175, 0.92);
  font-size: 10px;
  font-weight: 800;
}

.db-preview-pin-btn {
  position: absolute;
  top: 10px;
  right: 55px;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 5px;
  border: 1px solid rgba(218,172,64,0.2);
  background: rgba(14,14,14,0.82);
  color: rgba(255,222,150,0.72);
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.24);
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .15s ease;
}
.db-preview-pin-btn:hover,
.db-preview-pin-btn:focus-visible {
  border-color: rgba(218,172,64,0.45);
  color: rgba(255,232,174,0.96);
  outline: none;
  transform: translateY(-1px) scale(1.04);
}
.db-preview-pin-btn.active {
  background: rgba(218,172,64,0.2);
  border-color: rgba(218,172,64,0.42);
  color: rgba(255,232,174,0.98);
}

.db-grid-item--preview-pinned > .ui-resizable-handle {
  display: none !important;
}

.db-grid-item--size-pinned > .ui-resizable-handle {
  display: none !important;
}

.db-preview-hero {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.07), rgba(255,255,255,0.015)),
    rgba(0,0,0,0.18);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.045);
}

.db-preview-avatar {
  width: 48px;
  height: 48px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(218,172,64,0.42), rgba(218,172,64,0.13)),
    rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.9);
  font-family: 'Oswald', sans-serif;
  font-size: 19px;
  font-weight: 650;
  box-shadow: 0 8px 22px rgba(0,0,0,0.22);
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}

.db-preview-avatar:hover,
.db-preview-avatar--dragover {
  border-color: rgba(218,172,64,0.62);
  box-shadow: 0 8px 24px rgba(0,0,0,0.25), 0 0 0 3px rgba(218,172,64,0.12);
}

.db-preview-avatar--dragover {
  transform: scale(1.03);
}

.db-preview-avatar-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.db-preview-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.db-preview-avatar--photo {
  background: rgba(255,255,255,0.04);
}

.db-preview-avatar-hint {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  padding: 2px 3px 3px;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,0.72));
  color: rgba(255,255,255,0.92);
  font-family: Arial, sans-serif;
  font-size: 9px;
  font-weight: 800;
  text-align: center;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .15s, transform .15s;
}

.db-preview-avatar:hover .db-preview-avatar-hint,
.db-preview-avatar--dragover .db-preview-avatar-hint {
  opacity: 1;
  transform: translateY(0);
}

.db-preview-card--avatar-uploading .db-preview-avatar::after {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 10px;
  border: 2px solid rgba(218,172,64,0.32);
  border-top-color: rgba(255,255,255,0.9);
  animation: dbAvatarSpin .75s linear infinite;
}

@keyframes dbAvatarSpin {
  to { transform: rotate(360deg); }
}

.db-preview-photo-large {
  position: relative;
  width: 100%;
  height: clamp(260px, 32%, 520px);
  min-height: 260px;
  flex: 0 0 clamp(260px, 32%, 520px);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(218,172,64,0.22);
  background: rgba(0,0,0,0.32);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
}

.db-preview-photo-large img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center center;
  display: block;
}

.db-preview-title { min-width: 0; flex: 1 1 auto; }
.db-preview-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: rgba(255,255,255,0.96);
  font-size: 15px;
  font-weight: 800;
}
.db-preview-sub {
  margin-top: 2px;
  color: rgba(255,255,255,0.38);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.db-preview-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.db-preview-pay {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 5px;
  white-space: nowrap;
  flex-shrink: 0;
  font-weight: 700;
}
.db-preview-pay--paid { background: rgba(54,167,84,0.2); color: rgba(90,220,120,0.95); }
.db-preview-pay--advance { background: rgba(214,158,46,0.2); color: rgba(255,205,120,0.95); }
.db-preview-pay--unpaid { background: rgba(194,53,43,0.22); color: rgba(255,120,110,0.95); }
.db-preview-pay--muted { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.55); }

.db-preview-phone-card {
  display: block;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(80, 165, 105, 0.22);
  background:
    linear-gradient(135deg, rgba(62,180,95,0.11), rgba(255,255,255,0.02)),
    rgba(0,0,0,0.2);
  text-decoration: none;
  color: inherit;
}

.db-preview-phone-card:hover {
  border-color: rgba(80, 210, 120, 0.4);
  background:
    linear-gradient(135deg, rgba(62,180,95,0.16), rgba(255,255,255,0.035)),
    rgba(0,0,0,0.24);
}

.db-preview-phone-card--empty {
  pointer-events: none;
  border-color: rgba(255,255,255,0.06);
  background: rgba(0,0,0,0.18);
}

.db-preview-phone-card span {
  display: block;
  margin-bottom: 3px;
  color: rgba(255,255,255,0.36);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.db-preview-phone-card b {
  display: block;
  color: rgba(255,255,255,0.94);
  font-size: 15px;
  font-weight: 850;
  letter-spacing: 0;
}

.db-preview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.db-preview-grid .db-cm-field { min-width: 0; }

.db-preview-grid > div {
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  background: rgba(0,0,0,0.18);
}

.db-preview-field--wide {
  grid-column: 1 / -1;
}

.db-preview-grid span {
  display: block;
  margin-bottom: 2px;
  color: rgba(255,255,255,0.32);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.db-preview-grid b {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: rgba(255,255,255,0.82);
  font-size: 12px;
  font-weight: 650;
}

.db-preview-note {
  max-height: 56px;
  overflow: hidden;
  padding: 8px;
  border-left: 2px solid rgba(218,172,64,0.42);
  color: rgba(255,255,255,0.58);
  font-size: 11px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.db-preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.db-preview-actions .db-cm-mini-action {
  min-height: 28px;
  flex: 1 1 calc(50% - 3px);
  justify-content: center;
}

.db-preview-actions--footer {
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.07);
}

.db-preview-actions--footer .db-cm-btn {
  min-width: 0;
  flex: 1 1 calc(50% - 3px);
  padding-inline: 8px;
}

.db-preview-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  padding: 5px;
  border: 1px solid rgba(218,172,64,0.16);
  border-radius: 10px;
  background: rgba(0,0,0,0.2);
}

.db-preview-tab {
  min-width: 0;
  height: 30px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: rgba(255,255,255,0.52);
  font-family: inherit;
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
  transition: background .15s, color .15s, box-shadow .15s;
}

.db-preview-tab:hover {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.78);
}

.db-preview-tab.active {
  background: rgba(218,172,64,0.18);
  color: rgba(255,235,180,0.96);
  box-shadow: inset 0 0 0 1px rgba(218,172,64,0.22);
}

.db-preview-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(255,255,255,0.065);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.015)),
    rgba(0,0,0,0.12);
}

.db-preview-panel-title {
  color: rgba(255,255,255,0.34);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.db-preview-payment-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.07);
  background: rgba(255,255,255,0.035);
}

.db-preview-payment-card span {
  color: rgba(255,255,255,0.38);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.db-preview-payment-card b {
  color: rgba(255,255,255,0.92);
  font-size: 18px;
  font-weight: 850;
}

.db-preview-payment-card b .db-cm-edit-control,
.db-preview-payment-card b .cs-wrap {
  min-width: 180px;
  font-size: 14px;
  font-weight: 750;
}

.db-preview-advance-row {
  margin-top: 10px;
}

.db-preview-advance-row .db-cm-field {
  width: 100%;
}

.db-preview-advance-row.hidden {
  display: none;
}

.db-preview-card--editing .db-preview-panel {
  border-color: rgba(218,172,64,0.18);
  background:
    linear-gradient(180deg, rgba(218,172,64,0.055), rgba(255,255,255,0.014)),
    rgba(0,0,0,0.14);
}

.db-preview-card--editing .db-cm-field--edit {
  border-color: rgba(218,172,64,0.14);
  background: rgba(255,255,255,0.035);
}

.db-preview-panel .db-cm-edit-control {
  min-width: 0;
}

.db-preview-panel .db-cm-field {
  min-height: 66px;
  display: flex;
  flex-direction: column;
}

.db-preview-panel .db-cm-field__val {
  min-height: 36px;
  display: flex;
  align-items: center;
}

.db-preview-panel .db-cm-field--edit .db-cm-field__val {
  align-items: stretch;
}

.db-preview-panel .db-cm-field--edit .cs-wrap,
.db-preview-panel .db-cm-field--edit .db-cm-edit-control,
.db-preview-panel .db-cm-compact-row--control .cs-wrap,
.db-preview-panel .db-cm-compact-row--control .db-cm-edit-control {
  width: 100%;
}

.db-preview-panel .db-cm-field--edit .cs-trigger,
.db-preview-panel .db-cm-compact-row--control .cs-trigger {
  width: 100%;
  min-height: 36px !important;
  height: 36px !important;
  border: 1px solid rgba(255,255,255,0.09) !important;
  border-radius: 8px !important;
  background: rgba(0,0,0,0.22) !important;
  color: rgba(255,255,255,0.92) !important;
  padding: 0 30px 0 10px !important;
  font: inherit !important;
  font-size: 13px !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.025) !important;
}

.db-preview-panel .db-cm-field--edit .cs-trigger:hover,
.db-preview-panel .db-cm-compact-row--control .cs-trigger:hover {
  border-color: rgba(255,255,255,0.16) !important;
  background: rgba(0,0,0,0.28) !important;
}

.db-preview-panel .db-cm-field--edit .cs-trigger .cs-icon,
.db-preview-panel .db-cm-compact-row--control .cs-trigger .cs-icon {
  display: inline-flex;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  font-size: 12px;
  margin: 0;
  text-transform: none;
}

.db-preview-panel .db-cm-field--edit .cs-trigger .cs-label,
.db-preview-panel .db-cm-field--edit .cs-trigger .cs-placeholder,
.db-preview-panel .db-cm-compact-row--control .cs-trigger .cs-label,
.db-preview-panel .db-cm-compact-row--control .cs-trigger .cs-placeholder {
  display: inline-block;
  margin: 0;
  color: rgba(255,255,255,0.9) !important;
  font-size: 13px !important;
  font-weight: 750;
  text-transform: none;
  line-height: 1.2;
}

.db-preview-panel .db-cm-field--edit .cs-multi-badges,
.db-preview-panel .db-cm-compact-row--control .cs-multi-badges {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  margin: 0;
  text-transform: none;
}

.db-preview-panel .db-cm-field--edit .cs-chevron,
.db-preview-panel .db-cm-compact-row--control .cs-chevron {
  right: 10px;
  opacity: 0.72;
}

.db-preview-panel textarea.db-cm-edit-control {
  min-height: 72px;
  resize: vertical;
}

.db-discount-control {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.db-discount-presets {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
  width: 100%;
  min-width: 0;
}

.db-discount-preset {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  max-width: 100%;
  height: 30px;
  padding: 0 4px;
  border-radius: 7px;
  border: 1px solid rgba(255,255,255,0.09);
  background: rgba(255,255,255,0.045);
  color: rgba(255,255,255,0.62);
  font-family: inherit;
  font-size: 10px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.db-discount-preset:hover {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.88);
}

.db-discount-preset.active {
  border-color: rgba(218,172,64,0.42);
  background: rgba(218,172,64,0.16);
  color: rgba(255,230,170,0.95);
}

.db-discount-custom-input.hidden {
  display: none;
}

.db-preview-inline-btn {
  width: 100%;
  flex: none;
}

.db-preview-product-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 8px;
}

.db-preview-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.db-preview-lessons,
.db-preview-history {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.db-preview-lesson {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  padding: 7px 9px;
  border-radius: 8px;
  background: rgba(255,255,255,0.035);
  border: 1px solid rgba(255,255,255,0.055);
  min-width: 0;
}

.db-preview-lesson__date,
.db-preview-lesson__time {
  color: rgba(255,255,255,0.48);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.db-preview-lesson__time { color: rgba(90,220,130,0.9); }
.db-preview-lesson__title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: rgba(255,255,255,0.76);
  font-size: 12px;
  font-weight: 650;
}

.db-preview-empty-line {
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255,255,255,0.025);
  color: rgba(255,255,255,0.3);
  font-size: 12px;
  text-align: center;
}

.db-preview-hist-item {
  padding: 8px 10px;
  border-radius: 8px;
  border-bottom: none;
  background: rgba(255,255,255,0.03);
}

.db-preview-hist-item small {
  display: block;
  color: rgba(255,255,255,0.34);
  margin-top: 2px;
}

.db-preview-history-toggle {
  width: 100%;
  min-height: 34px;
  border-radius: 9px;
  border: 1px solid rgba(218,172,64,0.22);
  background: rgba(218,172,64,0.09);
  color: rgba(255,230,170,0.85);
  font-family: inherit;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.db-preview-history-toggle:hover {
  background: rgba(218,172,64,0.15);
  color: #fff;
}

.db-preview-comment { white-space: pre-wrap; }

.db-block--preview-focus {
  border-color: rgba(218,172,64,0.58);
  box-shadow:
    0 0 0 1px rgba(218,172,64,0.15),
    inset 0 0 32px rgba(218,172,64,0.08);
}

.db-block--xs .db-preview-section--sm,
.db-block--xs .db-preview-section--md,
.db-block--xs .db-preview-section--lg,
.db-block--xs .db-preview-actions--footer,
.db-block--sm .db-preview-section--md,
.db-block--sm .db-preview-section--lg,
.db-block--md .db-preview-section--lg {
  display: none !important;
}

.db-block--xs .db-preview-avatar,
.db-block--sm .db-preview-avatar {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  font-size: 16px;
}

.db-block--xs .db-preview-hero,
.db-block--sm .db-preview-hero { padding: 8px; }

.db-block--xs .db-preview-actions--top .db-cm-mini-action,
.db-block--sm .db-preview-actions--top .db-cm-mini-action {
  justify-content: center;
  font-size: 0;
  padding-inline: 6px;
}

.db-block--xs .db-preview-actions--top .db-cm-mini-action span,
.db-block--sm .db-preview-actions--top .db-cm-mini-action span { margin: 0; }

/* A narrow client card can still have plenty of vertical room. In that case,
   use the otherwise empty lower area for the most useful general details. */
.db-block--preview-roomy.db-block--md .db-preview-details.db-preview-section--lg,
.db-block--preview-roomy.db-block--sm .db-preview-details.db-preview-section--lg {
  display: grid !important;
}

.db-block--preview-roomy.db-block--md .db-preview-details > :nth-child(n + 7),
.db-block--preview-roomy.db-block--sm .db-preview-details > :nth-child(n + 5) {
  display: none;
}

.db-block--preview-roomy:is(.db-block--sm, .db-block--md) .db-preview-details {
  gap: 5px;
}

.db-block--preview-roomy:is(.db-block--sm, .db-block--md) .db-preview-details > div {
  padding: 5px 7px;
}

.db-block--preview-roomy:is(.db-block--sm, .db-block--md) .db-preview-details span {
  margin-bottom: 1px;
  font-size: 9px;
}

.db-block--preview-roomy:is(.db-block--sm, .db-block--md) .db-preview-details b {
  font-size: 11px;
}

.db-block--lg .db-preview-actions--footer .db-cm-btn,
.db-block--preview-focus .db-preview-actions--footer .db-cm-btn {
  flex-basis: calc(33.333% - 4px);
}

/* ── Overlay (block expand) ────────────────────────────────────────── */

.db-overlay {
  position: fixed; inset: 0; z-index: 500;
  pointer-events: none; opacity: 0;
  transition: opacity 0.22s;
}
.db-overlay.open { pointer-events: all; opacity: 1; }

.db-overlay__backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(5px);
}

.db-overlay__panel {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%) scale(0.95);
  transition: transform 0.22s cubic-bezier(0.34,1.3,0.64,1);
  width: min(92vw, 980px);
  max-height: 86vh;
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, #131313, #0e0e0e);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  box-shadow: 0 32px 90px rgba(0,0,0,0.65);
  overflow: hidden;
}
.db-overlay.open .db-overlay__panel { transform: translate(-50%,-50%) scale(1); }

.db-overlay__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid rgba(255,255,255,0.08);
  gap: 12px; flex-shrink: 0; flex-wrap: wrap;
}
.db-overlay__head-left  { display: flex; align-items: center; gap: 8px; }
.db-overlay__head-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.db-overlay__title { font-family:'Oswald',sans-serif; font-size:17px; font-weight:500; letter-spacing:0.03em; }
.db-overlay__pills { display: flex; gap: 4px; flex-wrap: wrap; }

.db-overlay__close {
  background: none; border: 1px solid rgba(255,255,255,0.14);
  color: rgba(255,255,255,0.55); border-radius: 8px;
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 15px; transition: all 0.15s; flex-shrink: 0;
}
.db-overlay__close:hover { color:#fff; border-color:rgba(255,255,255,0.28); background:rgba(255,255,255,0.07); }

.db-overlay__body {
  flex: 1; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.08) transparent;
}
.db-overlay__body .db-card { padding: 8px 18px; }
.db-overlay__body .db-card__name { font-size: 13px; }
.db-overlay__body .db-tag { font-size: 11px; }

/* ── Client card modal ─────────────────────────────────────────────── */

.db-client-modal {
  position: fixed; inset: 0; z-index: 600;
  pointer-events: none; opacity: 0;
  transition: opacity 0.22s;
}
.db-client-modal.open { pointer-events: all; opacity: 1; }

.db-client-modal__backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(7px);
}

.db-client-modal__panel {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%,-50%) scale(0.96);
  transition: transform 0.22s cubic-bezier(0.34,1.3,0.64,1);
  width: min(94vw, 960px);
  max-height: 92vh;
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, #141414, #0f0f0f);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  box-shadow: 0 32px 90px rgba(0,0,0,0.72);
  overflow: hidden;
}
.db-client-modal.open .db-client-modal__panel { transform: translate(-50%,-50%) scale(1); }

.db-client-modal__header {
  display: flex; align-items: center; gap: 14px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}

.db-cm-avatar {
  width: 52px; height: 52px; border-radius: 14px;
  background: rgba(194,53,43,0.22);
  color: rgba(255,100,90,0.95);
  font-family: 'Oswald', sans-serif;
  font-size: 20px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

.db-cm-info { flex: 1; min-width: 0; }

.db-cm-name {
  margin: 0 0 6px;
  font-family: 'Oswald', sans-serif;
  font-size: 20px; font-weight: 500; letter-spacing: 0.02em;
}

.db-cm-sub {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.db-cm-tags {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.db-cm-next {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.045);
  color: rgba(255,255,255,0.84);
  font-size: 12px;
}

.db-cm-next span {
  color: rgba(255,255,255,0.38);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.db-cm-next b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 650;
}

.db-cm-next--warn {
  border-color: rgba(214,158,46,0.28);
  background: rgba(214,158,46,0.1);
  color: rgba(255,210,130,0.95);
}

.db-cm-next--danger {
  border-color: rgba(194,53,43,0.34);
  background: rgba(194,53,43,0.14);
  color: rgba(255,130,120,0.98);
}

.db-cm-next--muted {
  opacity: 0.72;
}

.db-cm-tabs {
  display: flex; gap: 0;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
  padding: 0 4px;
}

.db-cm-tab {
  background: none; border: none;
  border-bottom: 2px solid transparent;
  color: rgba(255,255,255,0.42);
  font-size: 13px; padding: 11px 18px;
  cursor: pointer; transition: all 0.15s;
  font-family: inherit; margin-bottom: -1px;
}
.db-cm-tab.active { color: #fff; border-bottom-color: rgba(194,53,43,0.85); }
.db-cm-tab:hover:not(.active) { color: rgba(255,255,255,0.75); }

.db-cm-body {
  flex: 1; overflow-y: auto; padding: 20px;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.08) transparent;
}

.db-cm-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}

.db-cm-grid--compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
}

.db-cm-field {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px; padding: 12px 14px;
}
.db-cm-field__label {
  font-size: 10px; color: rgba(255,255,255,0.35);
  margin-bottom: 5px; text-transform: uppercase; letter-spacing: 0.05em;
  display: flex; align-items: center; gap: 5px;
}
.db-cm-field__icon { font-size: 12px; line-height: 1; flex-shrink: 0; }
.db-cm-field__val { font-size: 14px; font-weight: 500; }

.db-cm-field--compact {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.db-cm-compact-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.db-cm-compact-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  min-height: 22px;
}

.db-cm-compact-row + .db-cm-compact-row {
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.055);
}

.db-cm-compact-row--stack {
  display: block;
}

.db-cm-compact-row--stack .db-cm-compact-label {
  display: block;
  margin-bottom: 5px;
}

.db-cm-compact-label {
  flex: 0 0 auto;
  color: rgba(255,255,255,0.36);
  font-size: 11px;
  font-weight: 700;
}

.db-cm-compact-value {
  min-width: 0;
  color: rgba(255,255,255,0.88);
  font-size: 14px;
  font-weight: 650;
  text-align: right;
  overflow-wrap: anywhere;
}

.db-cm-compact-row--stack .db-cm-compact-value {
  display: block;
  text-align: left;
}

.db-cm-compact-row--control {
  align-items: center;
}

.db-cm-compact-row--control .db-cm-compact-value {
  flex: 1 1 auto;
  text-align: left;
}

.db-cm-compact-row--control .db-cm-edit-control,
.db-cm-compact-row--control .cs-wrap {
  width: 100%;
}

.db-cm-compact-row--control .db-cm-disc-btns {
  width: 100%;
}

.db-cm-compact-row--control .db-cm-toggle {
  width: 100%;
  justify-content: flex-start;
}

.db-cm-ok {
  color: rgba(110,220,135,0.95);
}

.db-cm-field--invalid {
  border-color: rgba(255,80,70,0.58);
  background: rgba(194,53,43,0.095);
  box-shadow: 0 0 0 3px rgba(194,53,43,0.08);
}

.db-cm-field--edit {
  padding: 10px 12px;
  background: rgba(255,255,255,0.045);
}

.db-cm-field--edit .db-cm-field__val { font-weight: 500; }

.db-cm-name .db-cm-edit-control {
  font-family: 'Oswald', sans-serif;
  font-size: 20px;
  padding: 5px 8px;
}

.db-cm-edit-control {
  width: 100%;
  min-height: 36px;
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 8px;
  background: rgba(0,0,0,0.22);
  color: rgba(255,255,255,0.92);
  padding: 8px 10px;
  font: inherit;
  font-size: 13px;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.025);
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  appearance: none;
}

select.db-cm-edit-control {
  padding-right: 30px;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(255,255,255,0.55) 50%),
    linear-gradient(135deg, rgba(255,255,255,0.55) 50%, transparent 50%);
  background-position:
    calc(100% - 16px) 50%,
    calc(100% - 11px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.db-cm-edit-control option {
  background: #141414;
  color: #fff;
}

.db-cm-static-val {
  padding: 8px 10px;
  min-height: 36px;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 8px;
  background: rgba(255,255,255,0.03);
  color: rgba(255,255,255,0.45);
  font-size: 13px;
  display: flex;
  align-items: center;
}

.db-cm-disc-btns { display: flex; gap: 8px; }
.db-cm-disc-btns--wrap {
  flex-wrap: wrap;
  gap: 6px;
}
.db-cm-disc-btn {
  flex: 1;
  padding: 8px 0;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.6);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.db-cm-disc-btn:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.2); color: rgba(255,255,255,0.9); }
.db-cm-disc-btn.active {
  background: rgba(214,158,46,0.18);
  border-color: rgba(214,158,46,0.55);
  color: rgba(214,158,46,0.95);
}
.db-cm-direction-selects {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.db-cm-direction-selects .cs-wrap,
.db-cm-direction-selects .db-cm-edit-control {
  width: 100%;
}

.db-client-modal .db-cm-select-wrap,
.db-client-modal .db-cm-field--edit .cs-wrap,
.db-client-modal .db-cm-compact-row--control .cs-wrap {
  width: 100%;
}

.db-client-modal .db-cm-field--edit .cs-trigger,
.db-client-modal .db-cm-compact-row--control .cs-trigger {
  width: 100%;
  min-height: 36px !important;
  height: 36px !important;
  border: 1px solid rgba(255,255,255,0.09) !important;
  border-radius: 8px !important;
  background: rgba(0,0,0,0.22) !important;
  color: rgba(255,255,255,0.92) !important;
  padding: 0 10px !important;
  font: inherit !important;
  font-size: 13px !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.025) !important;
}

.db-client-modal .db-cm-field--edit .cs-trigger:hover,
.db-client-modal .db-cm-compact-row--control .cs-trigger:hover {
  border-color: rgba(255,255,255,0.16) !important;
  background: rgba(0,0,0,0.28) !important;
}

.db-client-modal .db-cm-field--edit .cs-wrap--open .cs-trigger,
.db-client-modal .db-cm-field--edit .cs-trigger:focus-visible,
.db-client-modal .db-cm-compact-row--control .cs-wrap--open .cs-trigger,
.db-client-modal .db-cm-compact-row--control .cs-trigger:focus-visible {
  border-color: rgba(194,53,43,0.62) !important;
  box-shadow: 0 0 0 3px rgba(194,53,43,0.12), inset 0 1px 0 rgba(255,255,255,0.035) !important;
}

.db-client-modal .db-cm-field--edit .cs-trigger .cs-value,
.db-client-modal .db-cm-field--edit .cs-trigger .cs-label,
.db-client-modal .db-cm-field--edit .cs-trigger .cs-placeholder,
.db-client-modal .db-cm-compact-row--control .cs-trigger .cs-value,
.db-client-modal .db-cm-compact-row--control .cs-trigger .cs-label,
.db-client-modal .db-cm-compact-row--control .cs-trigger .cs-placeholder {
  font-size: 13px !important;
  color: rgba(255,255,255,0.9) !important;
}

.db-client-modal .db-cm-field--edit .cs-trigger .cs-icon,
.db-client-modal .db-cm-compact-row--control .cs-trigger .cs-icon {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  font-size: 12px;
}

.db-client-modal .db-cm-field--edit .cs-trigger .cs-chevron,
.db-client-modal .db-cm-compact-row--control .cs-trigger .cs-chevron {
  right: 10px;
  opacity: 0.72;
}

.db-client-modal .db-cm-field--edit .cs-trigger--empty .cs-placeholder,
.db-client-modal .db-cm-compact-row--control .cs-trigger--empty .cs-placeholder {
  color: rgba(255,255,255,0.38) !important;
}

.db-client-modal .db-cm-field--invalid .cs-trigger {
  border-color: rgba(255,80,70,0.62) !important;
  box-shadow: 0 0 0 3px rgba(194,53,43,0.12) !important;
}

.cs-dropdown-portal {
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  background: rgba(18,18,18,0.98);
  box-shadow: 0 18px 50px rgba(0,0,0,0.56);
  backdrop-filter: blur(14px);
  overflow-y: auto;
  padding: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.14) transparent;
}

.cs-dropdown-portal .cs-option {
  min-height: 34px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: rgba(255,255,255,0.68);
  font-size: 13px;
  padding: 8px 10px;
}

.cs-dropdown-portal .cs-option .cs-icon {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  font-size: 12px;
}

.cs-dropdown-portal .cs-option:hover {
  background: rgba(255,255,255,0.075);
  color: #fff;
}

.cs-dropdown-portal .cs-option--active {
  background: rgba(194,53,43,0.2);
  color: rgba(255,140,130,0.98);
}

.db-cm-edit-control:hover {
  border-color: rgba(255,255,255,0.16);
  background-color: rgba(0,0,0,0.28);
}

.db-cm-edit-control:focus {
  border-color: rgba(194,53,43,0.62);
  box-shadow: 0 0 0 3px rgba(194,53,43,0.12), inset 0 1px 0 rgba(255,255,255,0.035);
}

.db-cm-edit-control--invalid {
  border-color: rgba(255,80,70,0.62);
  box-shadow: 0 0 0 3px rgba(194,53,43,0.12);
}

.db-cm-edit-control--textarea {
  min-height: 92px;
  resize: vertical;
  line-height: 1.5;
}

.db-cm-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.db-cm-chip {
  position: relative;
  display: inline-flex;
  cursor: pointer;
}

.db-cm-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.db-cm-chip span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(0,0,0,0.2);
  color: rgba(255,255,255,0.62);
  font-size: 12px;
  transition: all 0.15s;
}

.db-cm-chip input:checked + span {
  border-color: rgba(194,53,43,0.52);
  background: rgba(194,53,43,0.2);
  color: rgba(255,135,125,0.98);
}

.db-cm-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 36px;
  cursor: pointer;
  color: rgba(255,255,255,0.72);
  font-size: 13px;
}

.db-cm-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.db-cm-toggle span {
  width: 38px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.11);
  background: rgba(0,0,0,0.28);
  position: relative;
  transition: all 0.15s;
}

.db-cm-toggle span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(255,255,255,0.55);
  transition: all 0.15s;
}

.db-cm-toggle input:checked + span {
  border-color: rgba(90,210,120,0.5);
  background: rgba(54,167,84,0.2);
}

.db-cm-toggle input:checked + span::after {
  transform: translateX(16px);
  background: rgba(120,235,150,0.95);
}

.db-cm-toggle b {
  font-weight: 600;
  color: rgba(255,255,255,0.74);
}

.db-cm-rental-duration {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.db-cm-rental-duration .db-cm-edit-control {
  min-width: 0;
  text-align: center;
}

.db-cm-rental-duration span {
  color: rgba(255,255,255,0.45);
  font-size: 12px;
  font-weight: 600;
}

.db-cm-phone {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.db-cm-phone__number {
  color: inherit;
  text-decoration: none;
  width: max-content;
  max-width: 100%;
}

.db-cm-phone__number:hover {
  color: rgba(255,130,120,0.98);
}

.db-cm-phone__actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  width: fit-content;
  max-width: 100%;
  padding: 3px;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 9px;
  background: rgba(0,0,0,0.2);
}

.db-cm-mini-action {
  min-height: 27px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.62);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s;
}

.db-cm-mini-action span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  border-radius: 5px;
  background: rgba(255,255,255,0.065);
  color: rgba(255,150,140,0.88);
  font-size: 9px;
  font-weight: 800;
}

.db-cm-mini-action:hover {
  background: rgba(255,255,255,0.075);
  color: #fff;
}

.db-cm-validation {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(194,53,43,0.36);
  background: rgba(194,53,43,0.12);
  color: rgba(255,255,255,0.8);
}

.db-cm-validation strong {
  color: rgba(255,130,120,1);
  font-size: 12px;
}

.db-cm-validation span {
  color: rgba(255,220,215,0.78);
  font-size: 12px;
  line-height: 1.45;
}

.db-cm-placeholder {
  text-align: center; color: rgba(255,255,255,0.28);
  font-size: 13px; padding: 48px 24px; line-height: 1.7;
}
.db-cm-action-link {
  display: inline-block;
  font-size: 13px;
  color: rgba(180,120,255,0.85);
  text-decoration: none;
  padding: 6px 0;
  transition: color 0.15s;
}
.db-cm-action-link:hover { color: rgba(200,150,255,1); text-decoration: underline; }

.db-cm-product-note {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.db-cm-product-note__label {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.6);
  margin-bottom: 6px;
}

.db-cm-product-note__input {
  min-height: 72px;
  resize: vertical;
}

.db-cm-desk-zone {
  margin-top: 10px;
}

.db-cm-delete-zone {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(194,53,43,0.18);
}

.db-cm-delete-product-btn {
  width: 100%;
  min-height: 42px;
  border-radius: 10px;
  border: 1px solid rgba(194,53,43,0.38);
  background: rgba(194,53,43,0.12);
  color: rgba(255,120,110,0.96);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.db-cm-delete-product-btn:hover {
  border-color: rgba(194,53,43,0.65);
  background: rgba(194,53,43,0.24);
  color: #fff;
}

.db-cm-delete-product-btn:disabled {
  cursor: wait;
  opacity: 0.55;
}

/* ── Add client modal ──────────────────────────────────────────────── */

.db-add-modal {
  position: fixed; inset: 0; z-index: 600;
  pointer-events: none; opacity: 0; transition: opacity 0.22s;
}
.db-add-modal.open { pointer-events: all; opacity: 1; }

.db-add-modal__backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.72); backdrop-filter: blur(7px);
}

.db-add-modal__panel {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%,-50%) scale(0.96);
  transition: transform 0.22s cubic-bezier(0.34,1.3,0.64,1);
  width: min(88vw, 460px);
  max-height: 80vh;
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, #141414, #0f0f0f);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  box-shadow: 0 32px 90px rgba(0,0,0,0.7);
  overflow: hidden;
}
.db-add-modal.open .db-add-modal__panel { transform: translate(-50%,-50%) scale(1); }

.db-add-modal__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}

.db-add-modal__body { flex: 1; overflow-y: auto; padding: 20px; }

.db-add-stub {
  text-align: center; color: rgba(255,255,255,0.32);
  font-size: 13px; padding: 36px 16px; line-height: 1.8; margin: 0;
}

/* ── Toast ─────────────────────────────────────────────────────────── */

.db-toast {
  position: fixed; bottom: 24px; right: 32px;
  background: rgba(20,20,20,0.96);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px; padding: 10px 16px;
  color: #fff; font-size: 13px;
  z-index: 1000; opacity: 0; transform: translateY(10px);
  transition: all 0.25s; backdrop-filter: blur(10px);
  pointer-events: none; max-width: 280px;
}
.db-toast--show { opacity: 1; transform: translateY(0); }

/* ── Lead drop split overlay ───────────────────────────────────────── */

.db-lead-drop-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  z-index: 20;
  border-radius: 16px;
  overflow: hidden;
  pointer-events: none;
  animation: db-overlay-in 0.15s ease;
}

@keyframes db-overlay-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.db-lead-drop-zone {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  gap: 6px;
  transition: background 0.15s;
}

.db-lead-drop-zone--add {
  background: rgba(34, 197, 94, 0.22);
  border-right: 1px solid rgba(255,255,255,0.08);
  color: #4ade80;
}
.db-lead-drop-zone--full {
  border-right: none;
  background: rgba(34, 197, 94, 0.28);
}

.db-lead-drop-zone--wait {
  background: rgba(251, 191, 36, 0.2);
  color: #fbbf24;
}

.db-lead-drop-zone__icon {
  font-size: 20px;
  line-height: 1;
}

/* Highlight the hovered half based on mouse position — toggled via JS class */
.db-block.drop-left  .db-lead-drop-zone--add  { background: rgba(34, 197, 94, 0.42); }
.db-block.drop-right .db-lead-drop-zone--wait { background: rgba(251, 191, 36, 0.38); }

/* ── DnD drop zone highlighting ────────────────────────────────────── */

.db-block.dnd-valid {
  box-shadow: inset 0 0 0 1px rgba(86,201,148,0.4), 0 0 14px rgba(86,201,148,0.07);
  transition: box-shadow .15s;
}
.db-block.dnd-blocked {
  opacity: 0.32;
  box-shadow: inset 0 0 0 1px rgba(194,53,43,0.35);
  pointer-events: none;
  transition: opacity .15s, box-shadow .15s;
}
.db-block.dnd-self {
  opacity: 0.55;
  transition: opacity .15s;
}

/* Hide "open in schedule" button when action modal is opened from dashboard DnD context,
   except for rental — rental requires scheduling a room time */
/* Hide schedule button for subscriptions/groups — dates are added manually later.
   Keep visible for rental and firstsingle — they need immediate scheduling. */
body.db-dnd-modal:not(.db-dnd-rental):not(.db-dnd-firstsingle) #actionSchedulePlanBtn {
  display: none !important;
}

/* Stretch room selector full-width in rental DnD modal */
body.db-dnd-rental .cs-wrap:has(#actionRentalRoom) {
  grid-column: 1 / -1;
}

/* Archive overlay fades while dragging so blocks underneath are reachable */
#dbOverlay.dnd-archive-drag {
  opacity: 0.05;
  pointer-events: none;
  transition: opacity .2s;
}

/* ── Compact modals (dashboard override) ───────────────────────────── */

/* Container & sizing */
#modal .modal-content,
#actionModal .modal-content {
  max-width: 720px;
  padding: 20px 28px 18px;
  border-radius: 16px;
  max-height: 92vh;
  gap: 0;
  overflow-x: hidden;
}

/* Title */
#modal .modal-content h2,
#actionModal .modal-content h2 {
  font-size: 15px !important;
  padding-bottom: 12px !important;
  margin-bottom: 0 !important;
}

#modal .modal-content h2::after,
#actionModal .modal-content h2::after {
  width: 28px;
  height: 2px;
}

/* Step indicator — slim horizontal bar */
#modal .form-step-indicator,
#actionModal .form-step-indicator {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 0 0 16px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  padding-bottom: 12px;
}

#modal .step-dot,
#actionModal .step-dot {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 8px 2px 0;
  opacity: 0.38;
  transition: opacity 0.2s;
}

#modal .step-dot.active,
#actionModal .step-dot.active { opacity: 1; }

#modal .step-dot__num,
#actionModal .step-dot__num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(194,53,43,0.85);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

#modal .step-dot__label,
#actionModal .step-dot__label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.85);
}

#modal .step-connector,
#actionModal .step-connector {
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.1);
  margin: 0 6px;
}

/* Form grid — tighter */
#modal .form-grid,
#actionModal .form-grid {
  gap: 8px;
  grid-template-columns: 1fr 1fr;
}

/* Inputs & selects — compact height */
#modal input:not([type=checkbox]):not([type=hidden]),
#modal select,
#modal textarea,
#actionModal input:not([type=checkbox]):not([type=hidden]),
#actionModal select {
  height: 36px;
  min-height: 36px;
  padding: 0 10px;
  font-size: 13px;
  border-radius: 8px;
}

#modal textarea {
  height: auto;
  min-height: 64px;
  padding: 8px 10px;
  resize: vertical;
}

/* paired-field compact */
#modal .paired-field,
#actionModal .paired-field {
  height: 36px;
  border-radius: 8px;
}

#modal .paired-label,
#actionModal .paired-label {
  padding: 0 8px;
  font-size: 11px;
}

/* Full-width fields */
#modal .contract-field,
#modal .comment-field,
#modal #financialStatus,
#modal #subscriptionStartGroup,
#modal #multiDateBlock { grid-column: 1 / -1; }

#modal .contract-label { font-size: 12px; gap: 6px; }
#modal .comment-label  { font-size: 11px; margin-bottom: 4px; }

/* Paired fields that need full width */
#modal .paired-field:has(#birthDate),
#modal .paired-field--full { grid-column: 1 / -1; }

/* Textarea shorter */
#modal textarea {
  height: 56px !important;
  min-height: 56px !important;
}

/* Custom select triggers — override the 54px important from style.css */
#modal .cs-trigger,
#actionModal .cs-trigger {
  min-height: 36px !important;
  height: 36px !important;
  padding: 0 10px !important;
  font-size: 13px !important;
  border-radius: 8px !important;
}

#modal .cs-trigger .cs-value,
#actionModal .cs-trigger .cs-value {
  font-size: 13px !important;
}

/* Native select height (non-custom-select) */
#modal select:not(.cs-hidden),
#actionModal select:not(.cs-hidden) {
  height: 36px !important;
  min-height: 36px !important;
  font-size: 13px !important;
  padding: 0 10px !important;
  border-radius: 8px !important;
}

/* Action buttons bar */
#modal .modal-actions,
#actionModal .modal-actions {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.07);
}

/* Buttons compact */
#modal .modal-actions button,
#actionModal .modal-actions button {
  height: 34px;
  padding: 0 16px;
  font-size: 12px;
  border-radius: 8px;
}

/* ── Hide old client panel on dashboard, кроме случая открытого лида (openLeadPanel всё ещё использует эту панель) */

#clientPanel:not(.show) { display: none !important; }

/* ── New client card: footer buttons ──────────────────────────────────── */

.db-cm-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 18px 14px;
  border-top: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
  background: rgba(0,0,0,0.18);
}

.db-cm-btn {
  flex: 1;
  min-width: 100px;
  padding: 8px 12px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.72);
  transition: all 0.15s;
  white-space: nowrap;
  text-align: center;
}
.db-cm-btn:hover { background: rgba(255,255,255,0.12); color: #fff; border-color: rgba(255,255,255,0.2); }
.db-cm-btn--primary {
  background: rgba(74,190,118,0.14);
  border-color: rgba(74,190,118,0.34);
  color: rgba(126,230,158,0.96);
}
.db-cm-btn--primary:hover { background: rgba(74,190,118,0.24); border-color: rgba(74,190,118,0.56); color: rgba(218,255,226,0.98); }
.db-cm-btn--danger { border-color: rgba(194,53,43,0.25); color: rgba(255,80,70,0.75); }
.db-cm-btn--danger:hover { background: rgba(194,53,43,0.16); border-color: rgba(194,53,43,0.4); color: rgba(255,100,90,1); }
.db-cm-btn--delete {
  background: rgba(120,18,16,0.22);
  border-color: rgba(255,70,60,0.35);
  color: rgba(255,105,95,0.95);
}
.db-cm-btn--delete:hover {
  background: rgba(170,32,26,0.32);
  border-color: rgba(255,90,80,0.58);
}

/* ── Today card right-click menu ──────────────────────────────────────── */
.db-today-context-menu {
  position: fixed;
  z-index: 1200;
  min-width: 220px;
  padding: 7px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  background: #101010;
  box-shadow: 0 18px 42px rgba(0,0,0,0.52);
}
.db-today-context-menu.hidden { display: none; }
.db-today-context-menu__item {
  width: 100%;
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: rgba(255,255,255,0.78);
  padding: 6px 10px;
  cursor: pointer;
  text-align: left;
  font: inherit;
  font-size: 12.5px;
}
.db-today-context-menu__item:hover {
  background: rgba(255,255,255,0.06);
  color: #fff;
}

/* ── New client card: product tab ─────────────────────────────────────── */

.db-cm-product-selector {
  display: flex;
  gap: 5px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.db-cm-product-pill {
  padding: 4px 11px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.5);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  white-space: nowrap;
}
.db-cm-product-pill.active {
  background: rgba(194,53,43,0.2);
  border-color: rgba(194,53,43,0.45);
  color: rgba(255,120,110,0.95);
}

.db-cm-product-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
}

.db-cm-product-title {
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 10px;
  color: rgba(255,255,255,0.9);
}

.db-cm-product-stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.db-cm-stat {
  flex: 1;
  min-width: 72px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 9px;
  padding: 10px 12px;
  text-align: center;
}
.db-cm-stat__val {
  font-size: 22px;
  font-weight: 700;
  font-family: 'Oswald', sans-serif;
  line-height: 1;
  margin-bottom: 4px;
  color: rgba(255,255,255,0.9);
}
.db-cm-stat__label {
  font-size: 10px;
  color: rgba(255,255,255,0.3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.db-cm-stat--ok .db-cm-stat__val     { color: rgba(70,200,100,0.95); }
.db-cm-stat--warn .db-cm-stat__val   { color: rgba(214,158,46,0.95); }
.db-cm-stat--danger .db-cm-stat__val { color: rgba(255,80,70,0.95); }

/* ── New client card: history tab ─────────────────────────────────────── */

.db-cm-hist-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.db-cm-hist-item:last-child { border-bottom: none; }
.db-cm-hist-label { flex: 1; min-width: 0; }
.db-cm-hist-date { font-size: 11px; color: rgba(255,255,255,0.35); white-space: nowrap; flex-shrink: 0; }

.db-cm-history-products {
  margin: 0 0 14px;
  overflow: hidden;
  border: 1px solid rgba(194, 53, 43, 0.18);
  border-radius: 11px;
  background: rgba(194, 53, 43, 0.035);
}

.db-cm-history-products__title,
.db-cm-history-events-title {
  color: rgba(255,255,255,0.42);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.db-cm-history-products__title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 11px;
  border-bottom: 1px solid rgba(194, 53, 43, 0.12);
}

.db-cm-history-products__title span {
  display: inline-flex;
  min-width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(194, 53, 43, 0.16);
  color: rgba(255,143,134,0.9);
  font-size: 10px;
}

.db-cm-history-product {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
  padding: 10px 11px;
  border-bottom: 1px solid rgba(255,255,255,0.045);
}

.db-cm-history-product:last-child { border-bottom: 0; }
.db-cm-history-product__icon { flex: 0 0 auto; opacity: 0.62; font-size: 15px; }

.db-cm-history-product__main {
  display: grid;
  min-width: 0;
  flex: 1;
  gap: 3px;
}

.db-cm-history-product__main strong,
.db-cm-history-product__main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.db-cm-history-product__main strong { color: rgba(255,255,255,0.8); font-size: 12px; }
.db-cm-history-product__main small { color: rgba(255,255,255,0.34); font-size: 10px; }

.db-cm-history-product__status {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(255,255,255,0.055);
  color: rgba(255,255,255,0.42);
  font-size: 9px;
  font-weight: 700;
}

.db-cm-history-product__actions {
  flex: 0 0 auto;
  display: flex;
  gap: 6px;
}

.db-cm-icon-btn {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 7px;
  background: rgba(255,255,255,0.04);
  font-size: 11px;
  cursor: pointer;
}

.db-cm-icon-btn:hover { background: rgba(255,255,255,0.09); }

.db-cm-history-product--editing {
  align-items: flex-start;
  flex-direction: column;
  padding-bottom: 12px;
}

.db-cm-history-product--editing .db-cm-history-product__main { width: 100%; }

.db-cm-history-product--editing .db-cm-grid {
  margin-top: 8px;
  /* minmax(0, 1fr), not 1fr — a plain 1fr track won't shrink below its
     content's min-content size, so a native <input type="date"> (which has
     a wide intrinsic minimum) pushes past the card edge instead of fitting
     the column. The parent clips overflow, so that read as the date field
     getting cut off rather than the layout visibly breaking. */
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}

/* Comment field is the 3rd item in a 2-col grid — span both columns instead
   of sitting half-width with dead space next to it. */
.db-cm-history-product--editing .db-cm-grid > .db-cm-field--edit:last-child {
  grid-column: 1 / -1;
}

.db-cm-history-product--editing .db-cm-field--edit {
  min-width: 0;
  padding: 6px 0;
  border: 0;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  border-radius: 0;
  background: transparent;
}

.db-cm-history-product--editing .db-cm-field--edit .db-cm-edit-control {
  min-width: 0;
}

.db-cm-history-product--editing textarea.db-cm-edit-control {
  min-height: 44px;
  resize: vertical;
}

.db-cm-history-product--editing .db-cm-history-product__actions {
  width: 100%;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-top: 10px;
}

.db-cm-history-product--editing .db-cm-history-product__actions .db-cm-btn {
  flex: 0 1 auto;
  min-width: 0;
  padding: 7px 11px;
  font-size: 11px;
}

.db-cm-history-events-title { margin: 15px 12px 5px; }

/* ── New client card: section title ───────────────────────────────────── */

.db-cm-section-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.28);
  margin: 16px 0 8px;
  font-weight: 600;
}
.db-cm-section-title:first-child { margin-top: 0; }

@media (max-width: 1020px) {
  .db-cm-grid--compact {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .db-client-modal__panel {
    width: min(94vw, 640px);
    max-height: 92vh;
    border-radius: 16px;
  }

  .db-client-modal__header {
    padding: 16px;
    align-items: flex-start;
  }

  .db-cm-grid {
    grid-template-columns: 1fr;
  }

  .db-cm-grid--compact {
    grid-template-columns: 1fr;
  }

  .db-cm-tabs {
    overflow-x: auto;
  }

  .db-cm-tab {
    flex: 1;
    min-width: 92px;
    padding-inline: 12px;
  }

  .db-cm-footer {
    padding: 10px 12px 12px;
  }

  .db-cm-btn {
    min-width: 128px;
  }
}

/* ── Group actions menu button & badges ──────────────────────────────── */

.db-group__menu-btn {
  flex-shrink: 0;
  background: transparent;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 6px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  opacity: .6;
  transition: opacity .15s, border-color .15s, background .15s;
}
.db-group__menu-btn:hover {
  opacity: 1;
  border-color: var(--clr-accent);
  background: rgba(255,255,255,.06);
}

.db-group__restore-btn {
  flex-shrink: 0;
  background: none;
  border: 1px solid rgba(72,187,120,.35);
  color: #6fd89a;
  border-radius: 6px;
  padding: 2px 9px;
  font-size: .82rem;
  line-height: 1;
  cursor: pointer;
  opacity: .85;
  margin-left: auto;
  transition: opacity .15s, border-color .15s, background .15s;
}
.db-group__restore-btn:hover {
  opacity: 1;
  border-color: #48bb78;
  background: rgba(72,187,120,.16);
}

/* "Waiting / delete" choice modal for the per-member ✕ button — same
   overlay language as BBAConfirm (script.js) but with two affirmative
   actions instead of one. */
.db-gm-choice-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: bba-toast-in 0.18s ease;
}
.db-gm-choice-modal {
  background: rgba(18, 18, 18, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 28px 28px 22px;
  max-width: 360px;
  width: 90%;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}
.db-gm-choice-modal__title {
  margin: 0 0 10px;
  color: #f0f0f0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
}
.db-gm-choice-modal__hint {
  margin: 0 0 20px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 12.5px;
  line-height: 1.6;
}
.db-gm-choice-modal__actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.db-gm-choice-modal__btn {
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #f0f0f0;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s, border-color 0.12s;
}
.db-gm-choice-modal__btn--waiting:hover {
  background: rgba(74, 158, 255, 0.14);
  border-color: rgba(74, 158, 255, 0.4);
}
.db-gm-choice-modal__btn--delete {
  color: #ff8179;
}
.db-gm-choice-modal__btn--delete:hover {
  background: rgba(194, 53, 43, 0.18);
  border-color: rgba(224, 82, 82, 0.5);
}
.db-gm-choice-modal__cancel {
  display: block;
  margin: 16px auto 0;
  padding: 6px 14px;
  border: none;
  background: transparent;
  color: #aaa;
  font-size: 13px;
  cursor: pointer;
}
.db-gm-choice-modal__cancel:hover {
  color: #ddd;
}
.db-gm-choice-modal__btn--addgroup:hover {
  background: rgba(60, 200, 100, 0.14);
  border-color: rgba(60, 200, 100, 0.45);
}
.db-gm-choice-modal__btn--addwaitlist:hover {
  background: rgba(214, 158, 46, 0.16);
  border-color: rgba(214, 158, 46, 0.5);
}

/* Add-member modal in "waitlist" mode — same layout, amber accent instead of
   the default so it visually reads as a lighter-weight action than seating
   someone in the group. */
.gam-overlay--waitlist .gam-box { border-color: rgba(214, 158, 46, 0.35); }
.gam-overlay--waitlist #gam-title { color: rgba(255, 214, 130, 0.95); }

/* ── Per-group waitlist (crm_group_waitlist) ── */
.db-group__waitlist-badge {
  flex-shrink: 0;
  font-size: 10.5px;
  font-weight: 700;
  color: rgba(214, 158, 46, 0.95);
  background: rgba(214, 158, 46, 0.14);
  border: 1px solid rgba(214, 158, 46, 0.3);
  border-radius: 20px;
  padding: 1px 7px;
}
/* Per-group waitlist — collapsed to small amber dots by DEFAULT (double-click
   the dot cluster to expand into full rows with name/promote/remove, see
   attachGroupWaitlistButtons); the whole group being collapsed always forces
   dots too, regardless of this block's own open/closed state. "Truly open"
   therefore requires both .is-open on this block AND the parent .db-group
   NOT being .collapsed — expressed below as `.db-group:not(.collapsed)
   .db-group__waitlist.is-open`. */
.db-group__waitlist {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin: 2px 14px 8px 30px;
  padding: 4px 8px;
  border: 1px dashed rgba(214, 158, 46, 0.3);
  border-radius: 8px;
  background: rgba(214, 158, 46, 0.05);
  cursor: pointer;
}
.db-group:not(.collapsed) .db-group__waitlist.is-open {
  padding: 6px 10px 4px;
  cursor: default;
}

.db-group__waitlist-label {
  display: none;
  width: 100%;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: rgba(214, 158, 46, 0.85);
  margin-bottom: 4px;
  cursor: pointer;
}
.db-group:not(.collapsed) .db-group__waitlist.is-open .db-group__waitlist-label {
  display: block;
}
.db-group__waitlist-count {
  display: inline-block;
  min-width: 15px;
  text-align: center;
  color: rgba(214, 158, 46, 0.7);
}

.db-gwl-row {
  width: 9px;
  min-width: 9px;
  height: 9px;
  min-height: 9px;
  flex: 0 0 9px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(214, 158, 46, 0.8);
  box-shadow: 0 0 0 2px rgba(214, 158, 46, 0.16);
  transition: transform 0.12s, box-shadow 0.12s;
}
.db-gwl-row:hover {
  transform: scale(1.15);
  box-shadow: 0 0 0 4px rgba(214, 158, 46, 0.22);
}
.db-group:not(.collapsed) .db-group__waitlist.is-open .db-gwl-row {
  width: auto;
  min-width: 0;
  height: auto;
  min-height: 0;
  flex: 1 1 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 2px;
  border: 0;
  border-top: 1px solid rgba(214, 158, 46, 0.12);
  border-radius: 0;
  background: none;
  box-shadow: none;
  opacity: 0.85;
  transition: opacity .12s;
}
.db-group:not(.collapsed) .db-group__waitlist.is-open .db-gwl-row:first-of-type { border-top: none; }
.db-group:not(.collapsed) .db-group__waitlist.is-open .db-gwl-row:hover {
  opacity: 1;
  transform: none;
  box-shadow: none;
}

.db-gwl-row__avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(214, 158, 46, 0.16);
  color: rgba(214, 158, 46, 0.9);
  font-size: .68rem;
  font-weight: 700;
  flex-shrink: 0;
}
.db-gwl-row__name {
  flex: 1;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.db-gwl-row__dir {
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.4);
  flex-shrink: 0;
}
.db-gwl-row__promote {
  flex-shrink: 0;
  background: rgba(60, 200, 100, 0.12);
  border: 1px solid rgba(60, 200, 100, 0.35);
  color: rgba(80, 230, 120, 0.95);
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 600;
  padding: 3px 7px;
  cursor: pointer;
  transition: background .12s;
}
.db-gwl-row__promote:hover { background: rgba(60, 200, 100, 0.22); }
.db-gwl-row__remove {
  flex-shrink: 0;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.35);
  font-size: 12px;
  cursor: pointer;
  padding: 3px 4px;
  transition: color .12s;
}
.db-gwl-row__remove:hover { color: rgba(224, 82, 82, 0.9); }

/* Hidden unless truly open (see block comment above) — a compound selector
   per child rather than a `> *` wildcard, so each one reliably outranks its
   own base rule (.db-gwl-row__avatar { display:flex }, etc.) regardless of
   CSS source order. */
.db-group__waitlist:not(.is-open) .db-gwl-row__avatar,
.db-group__waitlist:not(.is-open) .db-gwl-row__name,
.db-group__waitlist:not(.is-open) .db-gwl-row__dir,
.db-group__waitlist:not(.is-open) .db-gwl-row__promote,
.db-group__waitlist:not(.is-open) .db-gwl-row__remove,
.db-group.collapsed .db-gwl-row__avatar,
.db-group.collapsed .db-gwl-row__name,
.db-group.collapsed .db-gwl-row__dir,
.db-group.collapsed .db-gwl-row__promote,
.db-group.collapsed .db-gwl-row__remove,
.db-group__waitlist:not(.is-open) .db-gwl-row > *,
.db-group.collapsed .db-gwl-row > * {
  display: none;
}

.db-bulk-renew-overlay {
  position: fixed;
  inset: 0;
  /* Below .cs-dropdown-portal's z-index:9999 (custom-select.js) on purpose —
     this modal has real <select>s in it now, and their dropdown popups are
     portaled to <body>; a higher z-index here would bury them behind the
     modal itself. */
  z-index: 2000;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: bba-toast-in 0.18s ease;
}
.db-bulk-renew-modal {
  background: rgba(18, 18, 18, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 24px 26px 20px;
  max-width: 380px;
  width: 90%;
  max-height: 82vh;
  overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}
.db-bulk-renew-modal h3 {
  margin: 0 0 16px;
  color: #f0f0f0;
  font-size: 15px;
  font-weight: 600;
}
.db-bulk-renew-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 12px;
}
.db-bulk-renew-field input {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #f0f0f0;
  font-size: 13.5px;
}
.db-bulk-renew-field .cs-wrap { width: 100%; }
.db-bulk-renew-field .cs-trigger {
  min-height: 0 !important;
  padding: 8px 30px 8px 10px !important;
  border-radius: 8px !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  background: rgba(255, 255, 255, 0.04) !important;
  color: #f0f0f0 !important;
  font-size: 13.5px !important;
}
.db-bulk-renew-field .cs-trigger .cs-chevron { right: 10px; }
.db-bulk-renew-members {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 10px 0 16px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  max-height: 220px;
  overflow-y: auto;
}
.db-bulk-renew-member {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.db-bulk-renew-member:last-child {
  border-bottom: none;
}
.db-bulk-renew-member__head {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #eee;
  font-size: 13.5px;
  cursor: pointer;
}
.db-bulk-renew-member__name {
  font-weight: 600;
}
.db-bulk-renew-member__badge {
  font-size: 11px;
  color: #ffb04d;
  opacity: 0.85;
}
.db-bulk-renew-member__badge--active {
  color: #6fcf97;
}
.db-bulk-renew-member__row {
  display: flex;
  gap: 6px;
}
.db-bulk-renew-member__row .cs-wrap,
.db-bulk-renew-member__advance {
  flex: 1;
  min-width: 0;
}
.db-bulk-renew-member__date-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
}
.db-bulk-renew-member__date,
.db-bulk-renew-member__advance {
  width: 100%;
  box-sizing: border-box;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #f0f0f0;
  font-size: 12.5px;
}
.db-bulk-renew-member__row .cs-trigger {
  min-height: 0 !important;
  padding: 6px 26px 6px 8px !important;
  border-radius: 8px !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  background: rgba(255, 255, 255, 0.04) !important;
  color: #f0f0f0 !important;
  font-size: 12.5px !important;
  gap: 6px !important;
}
.db-bulk-renew-member__row .cs-trigger .cs-icon {
  width: 18px;
  height: 18px;
  font-size: 11px;
}
.db-bulk-renew-member__row .cs-trigger .cs-chevron { right: 8px; }
.db-bulk-renew-member:has(.db-bulk-renew-member__check:not(:checked)) .db-bulk-renew-member__row,
.db-bulk-renew-member:has(.db-bulk-renew-member__check:not(:checked)) .db-bulk-renew-member__date-field,
.db-bulk-renew-member:has(.db-bulk-renew-member__check:not(:checked)) .db-bulk-renew-member__advance {
  opacity: 0.4;
  pointer-events: none;
}
.db-bulk-renew-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.db-bulk-renew-actions button {
  padding: 9px 16px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #f0f0f0;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}
#dbBulkRenewConfirm {
  background: rgba(74, 158, 255, 0.18);
  border-color: rgba(74, 158, 255, 0.45);
}
#dbBulkRenewConfirm:disabled {
  opacity: 0.6;
  cursor: default;
}

.db-group-add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin: 8px 0 4px 4px;
  background: none;
  border: 1.5px dashed rgba(255,255,255,0.18);
  border-radius: 8px;
  color: rgba(255,255,255,0.3);
  font-size: 1.15rem;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.db-group-add-btn:hover {
  border-color: var(--clr-accent);
  color: var(--clr-accent);
}

/* ── Create group modal ── */
.cgm-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  align-items: center;
  justify-content: center;
  z-index: 1300;
  backdrop-filter: blur(2px);
}
.cgm-overlay.open { display: flex; }
.cgm-box {
  background: linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.012)), rgba(13,13,13,0.97);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 18px;
  padding: 28px 24px 22px;
  width: 320px;
  max-width: 94vw;
  box-shadow: 0 24px 64px rgba(0,0,0,.7);
}
.cgm-title {
  margin: 0 0 24px;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: .01em;
}
.cgm-fields { display: flex; flex-direction: column; gap: 16px; }
.cgm-field { display: flex; flex-direction: column; gap: 6px; }
.cgm-label {
  font-size: .68rem;
  font-weight: 600;
  color: rgba(255,255,255,.38);
  text-transform: uppercase;
  letter-spacing: .07em;
}
.cgm-input {
  width: 100%;
  box-sizing: border-box;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 9px;
  padding: 9px 12px;
  font-size: .88rem;
  color: #fff;
  outline: none;
  transition: border-color .15s;
  font-family: inherit;
}
.cgm-input:focus { border-color: rgba(194,53,43,.55); }
.cgm-input--narrow { width: 90px; }
.cgm-select { appearance: none; cursor: pointer; padding-right: 28px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='rgba(255,255,255,.35)'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; }
.cgm-select option { background: #1c1c2e; color: #fff; }
.cgm-dir-locked {
  display: inline-flex;
  align-items: center;
  height: 38px;
  padding: 0 13px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 9px;
  font-size: .88rem;
  color: rgba(255,255,255,.55);
  width: fit-content;
}
.cgm-actions { display: flex; gap: 10px; margin-top: 26px; }
.cgm-btn {
  flex: 1;
  padding: 10px 0;
  border-radius: 9px;
  font-size: .87rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: opacity .15s, background .15s;
  font-family: inherit;
}
.cgm-btn--cancel {
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,.65);
}
.cgm-btn--cancel:hover { background: rgba(255,255,255,0.11); }
.cgm-btn--submit {
  background: #c2352b;
  color: #fff;
}
.cgm-btn--submit:hover { opacity: .88; }
.cgm-btn:disabled { opacity: .4; cursor: default; }

/* ── Group "+ добавить участника" picker (via drop-hint click) ── */
.db-group__drop-hint--clickable { display: block; }
.gam-box { width: 360px; }
.gam-search-wrap { margin-bottom: 14px; }
.gam-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 280px;
  overflow-y: auto;
}
.gam-group-label {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: rgba(255,255,255,.4);
  padding: 10px 4px 4px;
}
.gam-group-label:first-child { padding-top: 2px; }
.gam-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: none;
  border: none;
  border-radius: 8px;
  padding: 7px 6px;
  font-family: inherit;
  font-size: .87rem;
  color: #fff;
  text-align: left;
  cursor: pointer;
  transition: background .15s;
}
.gam-row:hover { background: rgba(255,255,255,.06); }
.gam-row__avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  font-size: .78rem;
  font-weight: 700;
  color: rgba(255,255,255,.7);
  flex-shrink: 0;
}
.gam-row__name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gam-row__dir {
  flex-shrink: 0;
  font-size: .72rem;
  color: rgba(255,255,255,.4);
}
.gam-empty {
  padding: 18px 4px;
  font-size: .85rem;
  color: rgba(255,255,255,.4);
  text-align: center;
}

/* Custom dropdown */
.cgm-dd { position: relative; }
.cgm-dd__trigger {
  width: 100%; box-sizing: border-box;
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 9px;
  padding: 9px 12px;
  font-size: .88rem; color: #fff;
  cursor: pointer; text-align: left;
  font-family: inherit;
  transition: border-color .15s;
  gap: 8px;
}
.cgm-dd__trigger::after {
  content: '';
  width: 10px; height: 6px; flex-shrink: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='rgba(255,255,255,.4)'/%3E%3C/svg%3E") no-repeat center;
}
.cgm-dd--open .cgm-dd__trigger,
.cgm-dd__trigger:hover { border-color: rgba(194,53,43,.5); outline: none; }
.cgm-dd__panel {
  display: none;
  position: absolute; top: calc(100% + 3px); left: 0; right: 0; z-index: 300;
  background: #141420;
  border: 1px solid rgba(255,255,255,0.13);
  border-radius: 9px; overflow: hidden;
  max-height: 220px; overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,.55);
}
.cgm-dd--open .cgm-dd__panel { display: block; }
.cgm-dd__option {
  padding: 9px 13px;
  font-size: .88rem; color: rgba(255,255,255,.75);
  cursor: pointer;
  transition: background .1s;
}
.cgm-dd__option:hover { background: rgba(255,255,255,.07); color: #fff; }
.cgm-dd__option--active { background: rgba(194,53,43,.2); color: #fff; }
.cgm-dd__option--placeholder { color: rgba(255,255,255,.32); }
.cgm-dd__trigger--placeholder { color: rgba(255,255,255,.4); }
.cgm-dd__option--check {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer;
}
.cgm-dd__option--check input { accent-color: #c2352b; margin: 0; }

.cgm-checkbox-label {
  display: flex; align-items: center; gap: 8px;
  font-size: .9rem; color: rgba(255,255,255,.85);
  cursor: pointer;
}
.cgm-checkbox-label input { accent-color: #c2352b; }
.cgm-hint {
  display: block; margin-top: 4px;
  font-size: .78rem; line-height: 1.4;
  color: rgba(255,255,255,.4);
}

.db-group__today-badge {
  background: rgba(99, 179, 100, .18);
  border: 1px solid rgba(99, 179, 100, .4);
  color: #6abf6b;
  border-radius: 6px;
  padding: 1px 8px;
  font-size: .78rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s;
}
.db-group__today-badge:hover {
  background: rgba(99, 179, 100, .3);
}

/* Group schedule modal slot row */
.gsm-slot {
  display: flex;
  gap: .5rem;
  align-items: center;
}

/* Group schedule modal overlay */
#groupScheduleModal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1200;
}

/* Quick-schedule modal ("Сегодня" drag-drop) — compact size */
#dbQuickScheduleModal .modal-content {
  max-width: 460px;
  padding: 22px;
  gap: 14px;
}
#dbQuickScheduleModal .modal-content h2 {
  font-size: 19px;
  padding-bottom: 12px;
}

#dbQuickScheduleModal .db-qs-product-select {
  grid-column: 1 / -1;
}

#dbQuickScheduleModal .cs-wrap:has(> #dbQsProduct) {
  grid-column: 1 / -1;
  width: 100%;
}

#dbQuickScheduleModal .cs-wrap:has(> #dbQsProduct) .cs-trigger,
#dbQuickScheduleModal .cs-wrap:has(> #dbQsProduct) .cs-label {
  width: 100%;
  max-width: 100%;
}

/* ── Finance audit banner ──────────────────────────────────────────── */
.db-finance-audit-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  padding: 10px 14px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--ui-warning, #d6a23e) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--ui-warning, #d6a23e) 40%, transparent);
  color: var(--text, inherit);
  font-size: 13px;
}

.db-finance-audit-banner.hidden {
  display: none;
}

.db-finance-audit-banner__text {
  flex: 1;
}

.db-finance-audit-banner__link {
  color: var(--ui-warning, #d6a23e);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.db-finance-audit-banner__link:hover {
  text-decoration: underline;
}

.db-finance-audit-banner__close {
  background: none;
  border: none;
  color: inherit;
  opacity: 0.6;
  cursor: pointer;
  font-size: 14px;
  padding: 2px 4px;
}

.db-finance-audit-banner__close:hover {
  opacity: 1;
}

/* ── Dashboard: Today + client preview redesign ────────────────────── */

.db-block--today,
.db-block--client-preview {
  border-color: var(--ui-border);
  background: var(--ui-surface);
  box-shadow: var(--shadow, 0 16px 40px rgba(0, 0, 0, .26));
}

.db-block--today .db-block__head,
.db-block--client-preview .db-block__head {
  min-height: 46px;
  border-bottom-color: var(--ui-border-soft);
  background: color-mix(in srgb, var(--ui-surface-2) 76%, transparent);
}

.db-block--today .db-block__title,
.db-block--client-preview .db-block__title {
  color: var(--ui-text);
}

/* Today keeps a stable card hierarchy at every GridStack width. */
.db-block--today .db-block__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  background: color-mix(in srgb, var(--ui-page) 34%, transparent);
}

.db-card--today {
  --db-today-type-color: var(--ui-success);
  flex: 0 0 auto;
  grid-template-columns: minmax(calc(68px * var(--db-today-zoom, 1)), calc(82px * var(--db-today-zoom, 1))) minmax(0, 1fr);
  gap: calc(12px * var(--db-today-zoom, 1));
  padding: calc(10px * var(--db-today-zoom, 1));
  border: 1px solid var(--ui-border-soft);
  border-left: 3px solid var(--db-today-type-color);
  border-radius: 10px;
  background: var(--ui-surface-2);
  color: var(--ui-text);
  box-shadow: none;
}

.db-card--today-firstsingle { --db-today-type-color: var(--ui-danger); }
.db-card--today-rental { --db-today-type-color: var(--ui-muted); }
.db-card--today-adultgroup,
.db-card--today-childgroup { --db-today-type-color: var(--ui-accent); }

.db-card--today:hover,
.db-card--today-completed:hover {
  border-color: color-mix(in srgb, var(--db-today-type-color) 45%, var(--ui-border));
  border-left-color: var(--db-today-type-color);
  background: var(--ui-action-bg-hover);
}

.db-card--today.db-card--selected {
  border-color: color-mix(in srgb, var(--ui-accent) 54%, var(--ui-border));
  border-left-color: var(--ui-accent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ui-accent) 18%, transparent);
}

.db-card--today-completed {
  border-left-color: var(--db-today-type-color);
  background: color-mix(in srgb, var(--ui-success) 5%, var(--ui-surface-2));
}

.db-card--today-completed::after {
  display: none;
}

.db-today-timebox {
  align-content: start;
  justify-items: start;
  min-height: 0;
  padding: calc(8px * var(--db-today-zoom, 1)) calc(6px * var(--db-today-zoom, 1));
  border: 0;
  border-radius: 7px;
  background: transparent;
}

.db-today-timeface {
  justify-items: start;
  cursor: default;
}

.db-today-time {
  color: var(--ui-text);
  font-size: calc(17px * var(--db-today-zoom, 1));
}

.db-today-duration {
  color: var(--ui-muted);
}

.db-today-time-photo,
.db-today-timeface:hover + .db-today-time-photo {
  display: none;
}

.db-today-timebox:has(.db-today-timeface:hover) .db-today-timeface {
  opacity: 1;
  transform: none;
  filter: none;
}

.db-today-content {
  grid-template-columns: minmax(0, 1fr) minmax(calc(190px * var(--db-today-zoom, 1)), calc(270px * var(--db-today-zoom, 1)));
  gap: calc(12px * var(--db-today-zoom, 1));
}

.db-card--today .db-today-name,
.db-today-phone,
.db-today-lang,
.db-today-pill b,
.db-today-comment {
  color: var(--ui-text);
}

.db-today-phone {
  min-width: 0;
  max-width: calc(170px * var(--db-today-zoom, 1));
  height: auto;
  padding: 0;
  border: 0;
  background: transparent;
}

.db-today-phone:hover {
  color: var(--ui-accent-text);
  background: transparent;
}

.db-today-lang,
.db-today-pill,
.db-today-comment {
  border-color: var(--ui-border-soft);
  background: var(--ui-surface-soft);
}

.db-today-main > .db-today-pills {
  grid-template-columns: repeat(3, minmax(105px, 1fr));
}

.db-today-pill span,
.db-today-finance__head,
.db-today-finance__advance-note {
  color: var(--ui-muted);
}

.db-today-finance,
.db-today-finance--paid,
.db-today-finance--advance,
.db-today-finance--unpaid {
  padding-left: calc(14px * var(--db-today-zoom, 1));
  border: 0;
  border-left: 1px solid var(--ui-border-soft);
  border-radius: 0;
  background: transparent;
}

.db-today-finance:hover,
.db-today-finance:focus-visible {
  border-left-color: var(--ui-border);
  background: var(--ui-surface-soft);
  transform: none;
}

.db-today-finance__amount {
  color: var(--ui-text);
}

.db-today-more {
  width: 28px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid var(--ui-action-border);
  border-radius: 7px;
  background: var(--ui-action-bg);
  color: var(--ui-action-muted);
  font: inherit;
  font-size: 10px;
  letter-spacing: 1px;
  cursor: pointer;
}

.db-today-more:hover,
.db-today-more:focus-visible {
  outline: none;
  background: var(--ui-action-bg-hover);
  color: var(--ui-action-text);
}

/* Medium Today: details stay readable, payment moves below the main data. */
.db-block--md .db-card--today {
  grid-template-columns: 68px minmax(0, 1fr);
}

.db-block--md .db-today-content {
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.db-block--md .db-today-main > .db-today-pills {
  grid-template-columns: repeat(2, minmax(100px, 1fr));
}

.db-block--md .db-today-finance {
  display: grid;
  grid-template-columns: auto minmax(70px, auto) auto minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  padding: 7px 0 0;
  border-left: 0;
  border-top: 1px solid var(--ui-border-soft);
}

.db-block--md .db-today-finance__head {
  display: contents;
}

.db-block--md .db-today-finance__head > span {
  display: none;
}

.db-block--md .db-today-more {
  grid-column: 4;
  grid-row: 1;
  justify-self: end;
}

.db-block--md .db-today-finance__amount {
  grid-column: 1;
  grid-row: 1;
}

.db-block--md .db-today-finance__status {
  grid-column: 2;
  grid-row: 1;
}

.db-block--md .db-today-pills--finance {
  grid-column: 3;
  grid-row: 1;
}

.db-block--md .db-today-finance__advance-note {
  grid-column: 1 / -1;
  grid-row: 2;
}

.db-block--md .db-today-pills--finance {
  flex-wrap: nowrap;
  overflow: hidden;
}

/* Narrow Today: one compact row; secondary fields live in the ellipsis menu. */
.db-block--xs .db-card--today,
.db-block--sm .db-card--today {
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 7px;
  padding: 7px 8px;
}

.db-block--xs .db-today-timebox,
.db-block--sm .db-today-timebox {
  display: grid;
  grid-auto-flow: row;
  grid-auto-columns: auto;
  align-content: start;
  justify-content: start;
  padding: 4px 2px;
}

.db-block--xs .db-today-content,
.db-block--sm .db-today-content {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
}

.db-block--xs .db-today-main,
.db-block--sm .db-today-main {
  align-content: center;
}

.db-block--xs .db-today-identity,
.db-block--sm .db-today-identity {
  display: block;
}

.db-block--xs .db-today-phone,
.db-block--xs .db-today-lang,
.db-block--sm .db-today-phone,
.db-block--sm .db-today-lang,
.db-block--xs .db-today-main > .db-today-pills,
.db-block--sm .db-today-main > .db-today-pills,
.db-block--xs .db-today-comment,
.db-block--sm .db-today-comment,
.db-block--xs .db-today-finance__head > span,
.db-block--sm .db-today-finance__head > span,
.db-block--xs .db-today-finance__advance-note,
.db-block--sm .db-today-finance__advance-note,
.db-block--xs .db-today-pills--finance,
.db-block--sm .db-today-pills--finance {
  display: none !important;
}

.db-block--xs .db-today-clientline,
.db-block--sm .db-today-clientline {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px;
}

.db-block--xs .db-card--today .db-today-clientline > .db-tag,
.db-block--sm .db-card--today .db-today-clientline > .db-tag {
  grid-column: auto;
  width: 24px;
  min-width: 24px;
  height: 24px;
  justify-content: center;
  justify-self: end;
  padding: 0;
  overflow: hidden;
  font-size: 0;
}

.db-block--xs .db-card--today .db-today-clientline > .db-tag::after,
.db-block--sm .db-card--today .db-today-clientline > .db-tag::after {
  content: '○';
  font-size: 13px;
}

.db-block--xs .db-card--today .db-today-clientline > .db-today-status--done::after,
.db-block--sm .db-card--today .db-today-clientline > .db-today-status--done::after {
  content: '✓';
}

.db-block--xs .db-today-finance,
.db-block--sm .db-today-finance {
  display: grid;
  grid-template-columns: minmax(54px, auto) 28px;
  align-items: center;
  gap: 5px;
  min-width: 86px;
  padding: 3px 0 3px 7px;
  border-left: 1px solid var(--ui-border-soft);
}

.db-block--xs .db-today-finance__head,
.db-block--sm .db-today-finance__head {
  grid-column: 2;
  grid-row: 1 / span 2;
}

.db-block--xs .db-today-finance__amount,
.db-block--sm .db-today-finance__amount {
  grid-column: 1;
  grid-row: 1;
  font-size: 13px;
}

.db-block--xs .db-today-finance__status,
.db-block--sm .db-today-finance__status {
  grid-column: 1;
  grid-row: 2;
  max-width: 70px;
  padding: 2px 4px;
  font-size: 8px;
}

.db-block--xs .db-today-more,
.db-block--sm .db-today-more {
  width: 26px;
  height: 26px;
}

.db-block--xs .db-today-time,
.db-block--sm .db-today-time {
  font-size: 14px;
}

.db-block--xs .db-today-duration,
.db-block--sm .db-today-duration {
  font-size: 9px;
}

/* Client preview: compact reference-like hierarchy, using theme roles only. */
#dbClientPreview {
  overflow: hidden;
  background: color-mix(in srgb, var(--ui-page) 28%, transparent);
}

.db-preview-empty {
  min-height: 100%;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 7px;
  padding: 24px;
  color: var(--ui-muted);
  text-align: center;
}

.db-preview-empty > span {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid var(--ui-border);
  border-radius: 14px;
  background: var(--ui-surface-soft);
  font-size: 20px;
}

.db-preview-empty strong {
  color: var(--ui-text);
  font-size: 13px;
}

.db-preview-empty small {
  max-width: 230px;
  color: var(--ui-muted);
  font-size: 10px;
  line-height: 1.4;
}

.db-preview-card {
  gap: 8px;
  padding: 10px;
  color: var(--ui-text);
  scrollbar-color: var(--ui-border) transparent;
}

.db-preview-client-pin-note {
  margin: 0;
  align-self: flex-start;
  background: var(--ui-success-soft);
  color: var(--ui-success);
}

.db-preview-hero {
  gap: 10px;
  padding: 10px;
  border-color: var(--ui-border);
  border-radius: 10px;
  background: var(--ui-surface-2);
  box-shadow: none;
}

.db-preview-avatar {
  width: 44px;
  height: 44px;
  border-color: var(--ui-border);
  border-radius: 11px;
  background: color-mix(in srgb, var(--ui-accent) 18%, var(--ui-surface-2));
  color: var(--ui-text);
  box-shadow: none;
}

.db-preview-name,
.db-preview-grid b,
.db-preview-phone-card b,
.db-preview-payment-card b,
.db-preview-lesson__title {
  color: var(--ui-text);
}

.db-preview-sub,
.db-preview-grid span,
.db-preview-phone-card span,
.db-preview-panel-title,
.db-preview-payment-card span,
.db-preview-lesson__date,
.db-preview-empty-line {
  color: var(--ui-muted);
}

.db-preview-tags {
  gap: 4px;
}

.db-preview-tabs {
  gap: 3px;
  padding: 3px;
  border-color: var(--ui-border);
  border-radius: 9px;
  background: var(--ui-surface-2);
}

.db-preview-tab {
  height: 28px;
  color: var(--ui-action-muted);
}

.db-preview-tab:hover {
  background: var(--ui-action-bg-hover);
  color: var(--ui-action-text);
}

.db-preview-tab.active {
  background: var(--ui-accent-soft);
  color: var(--ui-accent-text);
  box-shadow: inset 0 0 0 1px var(--ui-action-primary-border);
}

.db-preview-panel {
  gap: 8px;
  padding: 9px;
  border-color: var(--ui-border);
  border-radius: 9px;
  background: var(--ui-surface-2);
}

.db-preview-panel-title {
  letter-spacing: .06em;
}

.db-preview-phone-card,
.db-preview-grid > div,
.db-preview-payment-card,
.db-preview-lesson,
.db-preview-hist-item,
.db-preview-empty-line {
  border-color: var(--ui-border-soft);
  background: var(--ui-surface-soft);
}

.db-preview-phone-card {
  padding: 8px 10px;
  border-radius: 8px;
}

.db-preview-phone-card:hover {
  border-color: color-mix(in srgb, var(--ui-success) 38%, var(--ui-border));
  background: color-mix(in srgb, var(--ui-success) 8%, var(--ui-surface-2));
}

.db-preview-grid {
  gap: 5px;
}

.db-preview-grid > div {
  min-height: 46px;
  padding: 6px 8px;
  border-radius: 7px;
}

.db-block--client-preview .db-preview-panel .db-cm-field {
  min-height: 46px;
}

.db-block--client-preview .db-preview-panel .db-cm-field__val {
  min-height: 24px;
}

.db-block--client-preview .db-preview-card--editing .db-preview-panel .db-cm-field {
  min-height: 64px;
}

.db-preview-actions {
  gap: 5px;
}

.db-preview-actions .db-cm-mini-action {
  min-height: 27px;
  border-color: var(--ui-action-border);
  background: var(--ui-action-bg);
  color: var(--ui-action-text);
}

.db-preview-actions--footer {
  position: sticky;
  z-index: 3;
  bottom: -10px;
  display: flex !important;
  padding: 8px 0 10px;
  border-top-color: var(--ui-border);
  background: linear-gradient(180deg, color-mix(in srgb, var(--ui-surface) 70%, transparent), var(--ui-surface) 24%);
}

/* Older density rules hid useful client data based only on width. The card now
   keeps the same working content and lets its own scroll area reflect height. */
.db-block--client-preview .db-preview-details {
  display: grid !important;
}

.db-block--client-preview .db-preview-actions--top,
.db-block--client-preview .db-preview-lessons,
.db-block--client-preview .db-preview-history,
.db-block--client-preview .db-preview-comment {
  display: flex !important;
}

.db-block--client-preview .db-preview-panel-title {
  display: block !important;
}

.db-block--preview-short .db-preview-card {
  gap: 6px;
  padding: 8px;
}

.db-block--preview-short .db-preview-hero {
  padding: 7px 8px;
}

.db-block--preview-short .db-preview-avatar {
  width: 38px;
  height: 38px;
}

.db-block--preview-short .db-preview-panel {
  gap: 6px;
  padding: 7px;
}

.db-block--preview-tall .db-preview-card {
  gap: 10px;
  padding: 12px;
}

.db-block--xs .db-preview-tabs {
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
}

.db-block--xs .db-preview-tab {
  min-width: 72px;
}

.db-block--xs .db-preview-grid {
  grid-template-columns: minmax(0, 1fr);
}

.db-block--xs .db-preview-field--wide {
  grid-column: auto;
}

.db-block--xs .db-preview-actions--top .db-cm-mini-action,
.db-block--sm .db-preview-actions--top .db-cm-mini-action {
  font-size: 10px;
  padding-inline: 6px;
}

.db-block--xs .db-preview-actions--footer .db-cm-btn {
  flex-basis: 100%;
}

.db-preview-sticky-top {
  position: sticky;
  z-index: 5;
  top: -10px;
  display: grid;
  gap: 6px;
  margin: -2px -2px 0;
  padding: 2px 2px 6px;
  background: linear-gradient(180deg, var(--ui-surface) 82%, color-mix(in srgb, var(--ui-surface) 92%, transparent));
}

.db-preview-hero {
  min-height: 66px;
  padding: 9px 10px;
  border-radius: 9px;
}

.db-preview-name-line {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 5px;
}

.db-preview-name-line .db-preview-name {
  flex: 0 1 auto;
  font-size: 16px;
}

.db-preview-client-pin-mark {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 18px;
  border-radius: 6px;
  background: var(--ui-success-soft);
  color: var(--ui-success);
  font-size: 12px;
  font-weight: 900;
}

.db-preview-sub {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px 5px;
  margin-top: 4px;
  white-space: normal;
  line-height: 1.25;
}

.db-preview-sub span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.db-preview-sub i {
  color: var(--ui-border);
  font-style: normal;
}

.db-preview-pay {
  align-self: flex-start;
  margin-top: 2px;
}

.db-preview-tabs {
  min-height: 34px;
  padding: 3px;
  border-radius: 8px;
}

.db-preview-panel,
.db-preview-card--editing .db-preview-panel {
  padding: 4px 2px 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.db-preview-panel-title {
  padding: 4px 4px 1px;
  color: var(--ui-muted);
}

.db-preview-contact {
  display: grid;
  gap: 6px;
}

.db-preview-phone-card {
  padding: 7px 8px;
  border: 0;
  border-bottom: 1px solid var(--ui-border-soft);
  border-radius: 0;
  background: transparent;
}

.db-preview-phone-card:hover {
  border-bottom-color: color-mix(in srgb, var(--ui-success) 48%, var(--ui-border));
  background: var(--ui-success-soft);
}

.db-preview-phone-card span {
  margin-bottom: 2px;
  font-size: 9px;
}

.db-preview-phone-card b {
  font-size: 14px;
}

.db-preview-actions--top {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
}

.db-preview-actions--top .db-cm-mini-action {
  min-width: 0;
  min-height: 27px;
  padding: 4px 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-radius: 7px;
  font-size: 9px;
}

.db-preview-grid {
  gap: 0 10px;
}

.db-preview-grid > div,
.db-preview-panel .db-cm-field,
.db-preview-card--editing .db-preview-panel .db-cm-field--edit {
  min-height: 48px;
  padding: 7px 4px;
  border: 0;
  border-bottom: 1px solid var(--ui-border-soft);
  border-radius: 0;
  background: transparent;
}

.db-preview-grid span,
.db-preview-panel .db-cm-field__label {
  margin-bottom: 3px;
  color: var(--ui-muted);
  font-size: 9px;
  letter-spacing: .035em;
}

.db-preview-grid b,
.db-preview-panel .db-cm-field__val {
  color: var(--ui-text);
  font-size: 12px;
}

.db-preview-panel .db-cm-field__val {
  min-height: 22px;
}

.db-preview-card--editing .db-preview-panel .db-cm-field--edit {
  min-height: 62px;
  border-bottom-color: color-mix(in srgb, var(--ui-accent) 22%, var(--ui-border-soft));
}

.db-preview-comment {
  margin-top: 3px;
  border-left: 0;
}

.db-preview-lessons,
.db-preview-history {
  gap: 5px;
}

.db-preview-lesson,
.db-preview-hist-item,
.db-preview-payment-card,
.db-preview-empty-line {
  border-color: var(--ui-border-soft);
  border-radius: 7px;
  background: var(--ui-surface-soft);
}

.db-preview-actions--footer {
  bottom: -10px;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 5px;
  margin-top: auto;
  padding: 8px 0 10px;
}

.db-preview-actions--footer > .db-cm-btn {
  min-width: 0;
  min-height: 34px;
  flex: 1 1 0;
  padding-inline: 8px;
}

.db-preview-action-menu {
  position: relative;
  flex: 0 0 42px;
  min-width: 0;
}

.db-preview-action-menu > summary {
  width: 42px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--ui-action-border);
  border-radius: 8px;
  background: var(--ui-action-bg);
  color: var(--ui-action-muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 1px;
  list-style: none;
  cursor: pointer;
}

.db-preview-action-menu > summary::-webkit-details-marker {
  display: none;
}

.db-preview-action-menu > summary:hover,
.db-preview-action-menu[open] > summary {
  border-color: color-mix(in srgb, var(--ui-accent) 38%, var(--ui-border));
  background: var(--ui-action-bg-hover);
  color: var(--ui-action-text);
}

.db-preview-action-menu__popup {
  position: absolute;
  z-index: 20;
  right: 0;
  bottom: calc(100% + 7px);
  width: 210px;
  display: grid;
  gap: 3px;
  padding: 5px;
  border: 1px solid var(--ui-border);
  border-radius: 9px;
  background: var(--ui-surface-2);
  box-shadow: var(--shadow, 0 16px 40px rgba(0, 0, 0, .35));
}

.db-preview-action-menu:not([open]) .db-preview-action-menu__popup {
  display: none;
}

.db-preview-action-menu__item {
  width: 100%;
  min-height: 33px;
  padding: 6px 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ui-action-text);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.db-preview-action-menu__item:hover {
  background: var(--ui-action-bg-hover);
}

.db-preview-action-menu__item--primary {
  color: var(--ui-accent-text);
}

.db-preview-action-menu__item--danger {
  color: var(--ui-danger);
}

.db-preview-action-menu__item--danger:hover {
  background: var(--ui-danger-soft);
}

.db-block--xs .db-preview-sticky-top,
.db-block--sm .db-preview-sticky-top {
  top: -8px;
}

.db-block--xs .db-preview-hero,
.db-block--sm .db-preview-hero {
  min-height: 56px;
  padding: 7px 8px;
}

.db-block--xs .db-preview-name-line .db-preview-name,
.db-block--sm .db-preview-name-line .db-preview-name {
  font-size: 14px;
}

.db-block--xs .db-preview-sub,
.db-block--sm .db-preview-sub {
  max-height: 28px;
  overflow: hidden;
  font-size: 9px;
}

.db-block--xs .db-preview-actions--top .db-cm-mini-action,
.db-block--sm .db-preview-actions--top .db-cm-mini-action {
  font-size: 0;
}

.db-block--xs .db-preview-actions--top .db-cm-mini-action span,
.db-block--sm .db-preview-actions--top .db-cm-mini-action span {
  font-size: 9px;
}

.db-block--xs .db-preview-actions--footer > .db-cm-btn {
  flex-basis: 0;
  font-size: 10px;
}

.db-block--xs .db-preview-action-menu__popup {
  width: min(210px, calc(100vw - 44px));
}

/* Touch drag & drop (tablet-touch) ---------------------------------------
   Long-press-to-drag for people cards is driven by dashboard-touch-dnd.js,
   which reuses the existing dragstart/dragover/drop handlers by dispatching
   events at them — this stylesheet only adds the "lifted" feedback. Block
   dragging itself already gets an equivalent long-press for free from
   GridStack's own touch handling; .ui-draggable-dragging below is GridStack's
   class, not ours. */

[data-interaction-mode="tablet-touch"] .db-card[draggable] {
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}

.db-card--touch-ghost {
  position: fixed;
  margin: 0;
  border-radius: 10px;
  background: #16130f;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(238, 82, 72, 0.4);
  opacity: 0.97;
}
.db-card--touch-ghost button,
.db-card--touch-ghost .db-card__remove,
.db-card--touch-ghost .db-pay,
.db-card--touch-ghost .db-today-finance,
.db-card--touch-ghost .db-today-pills,
.db-card--touch-ghost .db-today-pills--finance { display: none !important; }

[data-interaction-mode="tablet-touch"] .grid-stack-item.ui-draggable-dragging .db-block {
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(238, 82, 72, 0.35);
  transform: scale(1.012);
  transition: box-shadow 0.12s, transform 0.12s;
}

/* Mobile dashboard ------------------------------------------------------- */

.db-mobile-dashboard,
.db-mobile-add-client {
  display: none;
}

@media (max-width: 760px) {
  body {
    min-width: 0;
    background:
      radial-gradient(circle at 50% -8%, rgba(194, 53, 43, 0.16), transparent 34%),
      #090909;
  }

  #dbToolbar {
    position: sticky;
    z-index: 210;
    top: 0;
    min-height: 62px;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-bottom-color: rgba(255, 255, 255, 0.08);
    background: rgba(8, 8, 8, 0.94);
  }

  #dbToolbar > .app-sidebar-mobile-toggle {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    margin: 0;
    border-radius: 12px;
  }

  #dbToolbar .db-toolbar__left {
    width: auto;
    min-width: 0;
    flex: 1 1 auto;
    order: 1;
  }

  #dbToolbar .db-title {
    display: block !important;
    overflow: hidden;
    font-size: 19px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #dbToolbar #btnAddClient,
  #dbToolbar #btnAddLead,
  #dbToolbar .db-layout-templates,
  #dbToolbar #dbHiddenBlocksPicker,
  #dbToolbar .db-toolbar__right {
    display: none !important;
  }

  .db-mobile-add-client {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 92px;
    height: 42px;
    margin-left: auto;
    padding: 0 14px;
    border: 1px solid rgba(238, 82, 72, 0.72);
    border-radius: 12px;
    background: linear-gradient(180deg, #d94940, #bd3029);
    box-shadow: 0 7px 22px rgba(194, 53, 43, 0.24), inset 0 1px rgba(255, 255, 255, 0.2);
    color: #fff;
    font: 800 13px/1 Arial, sans-serif;
    cursor: pointer;
  }

  #dbToolbar .db-toolbar__center,
  #dbToolbar.db-toolbar--mini .db-toolbar__center {
    display: flex !important;
    width: 100%;
    flex: 1 0 100%;
    order: 3;
  }

  #dbToolbar .db-search-wrap {
    display: flex;
    flex: 1 1 100%;
  }

  #dbToolbar .db-search-input {
    height: 40px;
    border-radius: 12px;
    font-size: 14px;
  }

  .db-finance-audit-banner {
    display: none !important;
  }

  /* Keep GridStack measurable so its existing renderers can feed the mobile
     Today/Attention cards without putting the desktop canvas on screen. */
  .db-grid {
    position: fixed !important;
    top: 0;
    left: -200vw;
    width: 100vw;
    visibility: hidden;
    pointer-events: none;
  }

  .db-mobile-dashboard {
    width: 100%;
    display: grid;
    gap: 12px;
    padding: 12px 10px calc(26px + env(safe-area-inset-bottom));
  }

  .db-mobile-controls {
    display: flex;
    gap: 8px;
  }

  .db-mobile-control,
  .db-mobile-direction-select {
    position: relative;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.045);
    color: rgba(255, 255, 255, 0.72);
  }

  .db-mobile-control {
    width: 100%;
    height: 42px;
    padding: 0 11px;
  }

  .db-mobile-control > span {
    color: rgba(255, 255, 255, 0.38);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
  }

  .db-mobile-control select,
  .db-mobile-direction-select select {
    min-width: 0;
    flex: 1;
    border: 0;
    outline: 0;
    background: transparent;
    color: #fff;
    font: 750 13px/1 Arial, sans-serif;
    appearance: none;
  }

  .db-mobile-control select {
    text-align: right;
  }

  .db-mobile-control option,
  .db-mobile-direction-select option,
  .db-mobile-block-select option {
    background: #151515;
    color: #fff;
  }

  .db-mobile-panel {
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 16px;
    background:
      linear-gradient(145deg, rgba(255, 255, 255, 0.035), transparent 60%),
      rgba(13, 13, 13, 0.96);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.2);
  }

  .db-mobile-panel--attention {
    border-color: rgba(214, 70, 61, 0.42);
    background:
      linear-gradient(135deg, rgba(194, 53, 43, 0.13), transparent 68%),
      rgba(16, 12, 12, 0.98);
  }

  .db-mobile-attention-toggle {
    width: 100%;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
  }

  .db-mobile-attention-toggle:focus-visible {
    outline: 2px solid rgba(255, 129, 121, 0.72);
    outline-offset: -3px;
  }

  .db-mobile-attention-toggle__chevron {
    flex: 0 0 auto;
    color: rgba(255, 255, 255, 0.62);
    font-size: 20px;
    line-height: 1;
    transition: transform 0.18s ease;
  }

  .db-mobile-panel--attention.is-collapsed .db-mobile-attention-toggle {
    border-bottom-color: transparent;
  }

  .db-mobile-panel--attention.is-collapsed .db-mobile-attention-toggle__chevron {
    transform: rotate(180deg);
  }

  .db-mobile-panel--attention.is-collapsed .db-mobile-panel__body {
    display: none;
  }

  .db-mobile-panel--today {
    border-color: rgba(74, 190, 118, 0.26);
  }

  .db-mobile-panel__head {
    min-height: 54px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.065);
  }

  .db-mobile-panel__icon {
    flex: 0 0 auto;
    font-size: 18px;
  }

  .db-mobile-panel__title {
    min-width: 0;
    flex: 1;
    overflow: hidden;
    color: rgba(255, 255, 255, 0.95);
    font-family: 'Oswald', sans-serif;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .db-mobile-panel__badge {
    min-width: 27px;
    height: 25px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    border-radius: 999px;
    background: rgba(194, 53, 43, 0.24);
    color: #ff8179;
    font-size: 12px;
    font-weight: 850;
    font-variant-numeric: tabular-nums;
  }

  .db-mobile-panel__badge--danger {
    background: rgba(194, 53, 43, 0.72);
    color: #fff;
  }

  .db-mobile-day-nav {
    display: flex;
    gap: 4px;
    margin-left: auto;
  }

  .db-mobile-day-nav button {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.74);
    font-size: 21px;
  }

  .db-mobile-day-nav button:disabled {
    opacity: 0.28;
  }

  .db-mobile-panel__body {
    min-height: 58px;
  }

  .db-mobile-panel__body .db-empty {
    padding: 20px 14px;
    font-size: 12px;
  }

  .db-mobile-panel__filters {
    display: flex;
    padding: 9px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.055);
    background: rgba(255, 255, 255, 0.018);
  }

  .db-mobile-direction-select {
    width: 100%;
    height: 39px;
    padding: 0 11px;
    border-color: rgba(194, 53, 43, 0.32);
  }

  .db-mobile-direction-select > span:first-child {
    color: #d965ce;
    font-size: 17px;
  }

  .db-mobile-direction-select__chevron {
    flex: 0 0 auto;
    color: rgba(255, 255, 255, 0.56);
    font-size: 18px;
  }

  .db-mobile-panel__filters {
    gap: 8px;
  }

  .db-mobile-segment-select.is-hidden {
    display: none;
  }

  .db-mobile-block-select {
    position: relative;
    min-width: 0;
    flex: 1;
    display: flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
  }

  .db-mobile-block-select__value {
    min-width: 0;
    flex: 1;
    overflow: hidden;
    font-family: 'Oswald', sans-serif;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .db-mobile-block-select select {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
  }

  .db-mobile-block-select__chevron {
    color: rgba(255, 255, 255, 0.62);
    font-size: 20px;
    line-height: 1;
  }

  .db-mobile-student {
    min-height: 62px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto 20px;
    grid-template-areas:
      "name tag pay"
      "meta meta pay";
    align-items: center;
    gap: 5px 9px;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.065);
  }

  .db-mobile-student:last-child {
    border-bottom: 0;
  }

  .db-mobile-student__name {
    grid-area: name;
    min-width: 0;
    overflow: hidden;
    color: rgba(255, 255, 255, 0.96);
    font-size: 14px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .db-mobile-student__tag {
    grid-area: tag;
    max-width: 120px;
    overflow: hidden;
    padding: 4px 8px;
    border-radius: 8px;
    background: rgba(194, 53, 43, 0.18);
    color: #ff8179;
    font-size: 10px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .db-mobile-student__meta {
    grid-area: meta;
    min-width: 0;
    overflow: hidden;
    color: rgba(255, 255, 255, 0.47);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .db-mobile-student .db-card__pay-cell {
    grid-area: pay;
    align-self: center;
  }

  .db-mobile-dashboard .db-card__drag {
    display: none;
  }

  .db-mobile-dashboard .db-card--attn {
    min-height: 50px;
    padding: 9px 11px;
  }

  .db-mobile-dashboard .db-card--attn .db-card__cell:not(.db-attn-reason),
  .db-mobile-dashboard .db-card--attn .db-card__pay-cell {
    display: none;
  }

  .db-mobile-dashboard .db-card--today {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 8px;
    padding: 9px;
  }

  .db-mobile-dashboard .db-today-timebox {
    min-height: 58px;
    padding: 7px 5px;
  }

  .db-mobile-dashboard .db-today-content {
    grid-template-columns: minmax(0, 1fr);
    gap: 7px;
  }

  .db-mobile-dashboard .db-today-phone,
  .db-mobile-dashboard .db-today-lang,
  .db-mobile-dashboard .db-today-main > .db-today-pills,
  .db-mobile-dashboard .db-today-pills--finance,
  .db-mobile-dashboard .db-today-finance__head > span,
  .db-mobile-dashboard .db-today-finance__advance-note {
    display: none;
  }

  .db-mobile-dashboard .db-today-clientline {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .db-mobile-dashboard .db-today-finance {
    position: relative;
    min-height: 34px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 7px;
    padding: 6px 8px;
  }

  .db-mobile-dashboard .db-today-finance__head {
    position: absolute;
    right: 7px;
    top: 7px;
  }

  .db-mobile-dashboard .db-today-finance__amount {
    font-size: 14px;
  }

  .db-mobile-dashboard .db-today-finance__status {
    justify-self: end;
    margin-right: 26px;
  }

  .db-overlay__panel {
    width: calc(100vw - 16px);
    height: calc(100dvh - 16px);
    border-radius: 16px;
  }
}
