/* ==========================================================================
   CRM-консоль Tadoo: общая система. Подключение (порядок важен):
   base.css, ux-v3.css, crm.css, crm/shell.css, home.css, lists.css, detail.css,
   schedule.css, dialogs.css, stock.css, more.css.
   Источник: tadoo-demo-updated.html (3 361 строка), имена классов сохранены.
   Цвета, шрифт, скругления, стекло, длительности и z-index — токены base.css/ux-v3.css.
   Мост токенов демо -> наши (в разметке и CSS демо-имён больше нет):
     --bg           -> --bg            --surface  -> --surface
     --raised       -> --surface-2     --line     -> --line
     --ink          -> --text          --muted    -> --text-2
     --action(заливка)/--brand -> --btn (текст на нём --btn-on)
     --action-ink   -> --action        --green/--yellow/--red -> --ok/--warn/--danger
     оранжевый #f4511e -> --mark       Inter -> --f-body (Golos Text)
   Тёмная тема основная, светлая — через data-theme="light" на <html> (base.css).
   Диалоги: класс .crm-dialog на <dialog>, вместо правил по #dialog / #edit-form.
   ========================================================================== */

/* корень консоли: свой шрифт (в base.css body 17px, заголовки Unbounded) */
#app,
.crm-dialog,
.calendar-sheet,
#toast {
  font: 400 15px/1.5 var(--f-body);
  color: var(--text);
}
#app {
  background: var(--bg);
}
#app h1,
#app h2,
#app h3,
.crm-dialog h1,
.crm-dialog h2,
.crm-dialog h3,
.calendar-sheet h2 {
  font-family: var(--f-body);
  text-transform: none;
  text-wrap: pretty;
}
#toast {
  position: fixed;
  left: 50%;
  bottom: calc(90px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: var(--z-toast);
  max-width: min(92vw, 420px);
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-line);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  color: var(--text);
  font-size: 15px;
}

/* Общая система: типографика, кнопки, поля, панели, бейджи, карточки-строки, вкладки. Перенос из tadoo-demo-updated.html на токены ux-v3. */
* {
  box-sizing: border-box;
}
button {
  font: inherit;
}
button,
a {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: default;
  opacity: 0.5;
}
a {
  color: var(--action);
  text-decoration: none;
}
p {
  margin: 0;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--action);
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}
.search {
  max-width: 520px;
  flex: 1;
  min-width: 180px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
input[type='checkbox'] {
  width: 20px;
  min-height: 20px;
  accent-color: var(--btn);
}
.notice {
  padding: 16px;
  border-left: 3px solid var(--warn);
  background: var(--surface-2);
  border-radius:var(--r-field);
}
.notice.error {
  border-color: var(--danger);
}
.notice p {
  font-size: 14px;
  color: var(--text-2);
  margin-top: 6px;
}
.listrow {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
.listrow:last-child {
  border-bottom: 0;
}
.details {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 1fr);
  gap: 20px;
}
.section-label {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 24px;
  margin-bottom: 10px;
}
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.searchresults {
  padding: 0 28px;
  display: grid;
  gap: 8px;
}
.searchresults:empty {
  display: none;
}
.searchresults button {
  background: var(--surface-2);
  color: var(--text);
  padding: 12px;
  text-align: left;
  border: 0;
  border-radius:8px;
}
@media (max-width: 1000px) {
.details,
  .grid.three {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 700px) {
.grid,
  .split {
    grid-template-columns: 1fr;
  }
}
.tag-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 6px 14px;
  border-radius:var(--r-col);
  background: var(--surface-2);
  color: var(--text);
}
.tag-chip button {
  background: transparent;
  color: inherit;
  border: 0;
  min-width: 32px;
  min-height: 32px;
  font-size: 22px;
}
button svg,
.date-trigger svg,
.free-time-row svg {
  width: 22px;
  height: 22px;
  flex: none;
}
.searchresults:empty {
  display: none;
}
.icon-button {
  border: 0;
  background: none;
  color: var(--text);
  width: 44px;
  height: 44px;
  padding: 10px;
  display: inline-grid;
  place-items: center;
  flex: none;
  border-radius:var(--r-field);
}
.icon-button svg {
  width: 24px;
  height: 24px;
}
.back-button {
  margin-left: -10px;
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.section-head h2 {
  margin: 0;
  font-size: 17px;
}
.section-head .link {
  font-size: 13px;
  white-space: nowrap;
}
.record .art {
  grid-row: 1 / 3;
  width: 64px;
  height: 76px;
  border-radius:var(--r-field);
  object-fit: cover;
}
.record > div {
  min-width: 0;
}
.record h3 {
  font-size: 15px;
  line-height: 1.35;
  margin: 0 0 4px;
}
.record > .badge {
  grid-column: 2;
  justify-self: start;
  font-size: 10px;
  line-height: 1.4;
  margin-top: -4px;
}
.panel .record {
  padding: 14px 0;
  border-radius:0;
  border-bottom: 1px solid var(--line);
}
.panel .record:last-child {
  border: 0;
}
.secondary-disclosure {
  margin-top: 20px;
  color: var(--text-2);
  font-size: 13px;
}
.secondary-disclosure > summary {
  padding: 12px 0;
  cursor: pointer;
  min-height: 44px;
}
.secondary-disclosure[open] > summary {
  margin-bottom: 10px;
}
.details > .panel > .panel {
  background: transparent;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-radius:0;
}
@media (max-width: 700px) {
.listrow {
    gap: 14px;
  }
.details {
    gap: 16px;
  }
.details .row {
    gap: 8px;
  }
.details .row button {
    font-size: 13px;
    padding: 10px 12px;
  }
.record .art {
    width: 58px;
    height: 68px;
  }
.empty .primary,
  .empty .secondary {
    width: 100%;
  }
}
@media (prefers-reduced-motion: reduce) {
* {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
.art.placeholder svg {
  width: 24px;
  height: 24px;
}
.record > .badge {
  position: static;
  right: auto;
  top: auto;
  bottom: auto;
  transform: none;
}
.searchresults {
  background: var(--surface);
  border-radius:var(--r-field);
  padding: 0 12px;
}
.searchresults:empty {
  padding: 0;
}
@media (max-width: 700px) {
#page.with-bottom-action {
    padding-bottom: calc(168px + env(safe-area-inset-bottom, 0px));
  }
}
.tag-chips {
  margin-top: 14px;
}
.tag-chip {
  background: var(--surface-2);
  color: var(--action);
}
.simple-details {
  border-top: 1px solid var(--line);
  margin-top: 16px;
  padding-top: 16px;
}
.simple-details > summary {
  cursor: pointer;
  font-size: 14px;
  line-height: 1.5;
}
.simple-details > .stack {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}
input[type='checkbox'],
input[type='radio'] {
  accent-color: var(--btn);
}
::selection {
  background: color-mix(in srgb, var(--btn) 40%, transparent);
  color: var(--btn-on);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
h1,
h2,
h3 {
  color: var(--text);
  font-weight: 600;
  line-height: 1.3;
}
h1 {
  font-size: 28px;
  letter-spacing: -0.8px;
}
h2 {
  font-size: 18px;
  letter-spacing: -0.35px;
}
h3 {
  font-size: 15px;
  letter-spacing: -0.15px;
}
small,
.muted {
  color: var(--text-2);
}
small {
  font-size: 12px;
}
.row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.between {
  justify-content: space-between;
}
.stack {
  display: grid;
  gap: 16px;
}
.spacer {
  margin-top: 24px;
}
.primary,
.secondary,
.quiet,
.danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius:var(--r-field);
  min-height: 46px;
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  text-decoration: none;
  transition:
    background var(--dur-base),
    filter var(--dur-base);
}
.primary {
  background: var(--btn);
  color: var(--btn-on);
}
.secondary {
  background: var(--surface-2);
  color: var(--text);
}
.quiet {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}
.danger {
  background: color-mix(in srgb, var(--danger) 16%, var(--surface));
  color: var(--danger);
}
.primary:hover {
  filter: brightness(1.1);
}
.primary:disabled {
  opacity: 0.45;
}
.compact {
  min-height: 38px;
  padding: 8px 12px;
  font-size: 13px;
}
.link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  background: none;
  border: 0;
  color: var(--action);
  padding: 8px 0;
  font-size: 14px;
  text-align: left;
}
.field {
  display: grid;
  gap: 9px;
  font-size: 13px;
  color: var(--text-2);
}
input,
select,
textarea {
  font: inherit;
  font-size: 16px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius:var(--r-field);
  padding: 12px;
  min-height: 46px;
  width: 100%;
}
textarea {
  resize: vertical;
  line-height: 1.6;
}
input::placeholder,
textarea::placeholder {
  color: var(--text-2);
}
.panel {
  background: var(--surface);
  border: 0;
  border-radius:var(--r-col);
  padding: 22px;
  min-width: 0;
}
.panel h2 {
  margin-bottom: 16px;
}
.panel h3 {
  margin-bottom: 8px;
}
.badge {
  display: inline-block;
  max-width: 100%;
  border-radius:7px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 11px;
  font-weight: 500;
  padding: 4px 8px;
  line-height: 1.4;
}
.badge.good {
  background: color-mix(in srgb, var(--ok) 18%, var(--surface));
  color: var(--ok);
}
.badge.warn {
  background: color-mix(in srgb, var(--warn) 18%, var(--surface));
  color: var(--warn);
}
.badge.blue {
  background: var(--surface-2);
  color: var(--text);
}
.badge.bad {
  background: color-mix(in srgb, var(--danger) 16%, var(--surface));
  color: var(--danger);
}
.cards {
  display: grid;
  gap: 10px;
}
.record {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 18px;
  background: var(--surface);
  border: 1px solid transparent;
  border-radius:var(--r-col);
  text-align: left;
  color: var(--text);
  flex-wrap: wrap;
}
.record:hover {
  border-color: var(--line);
}
.record > div:nth-child(2) {
  flex: 1;
  min-width: 140px;
}
.record p {
  font-size: 13px;
  color: var(--text-2);
  margin-top: 4px;
}
.record small {
  display: block;
  font-size: 12px;
  margin-top: 7px;
}
.art {
  width: 72px;
  height: 82px;
  border-radius:var(--r-field);
  object-fit: cover;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  color: var(--text);
  flex: none;
}
.art.placeholder {
  font-size: 24px;
}
.tabs {
  display: flex;
  gap: 0;
  flex-wrap: nowrap;
  overflow: auto;
  scrollbar-width: none;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
}
.tabs button {
  background: none;
  border: 0;
  border-radius:0;
  min-height: 46px;
  padding: 10px 14px;
  white-space: nowrap;
  font-size: 13px;
  color: var(--text-2);
}
.tabs button[aria-pressed='true'] {
  color: var(--text);
  box-shadow: inset 0 -2px var(--btn);
  background: transparent;
}
.empty {
  background: transparent;
  padding: 28px 6px;
  text-align: left;
  color: var(--text-2);
}
.empty h2 {
  font-size: 16px;
  color: var(--text);
  margin-bottom: 8px;
}
.empty p {
  font-size: 13px;
  margin-bottom: 14px;
}
.compact-list-filter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0 12px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.compact-list-filter label {
  max-width: 75%;
  min-width: 0;
}
.compact-list-filter select {
  background: transparent;
  border: 0;
  color: var(--text);
  width: 100%;
  font-size: 14px;
  padding: 6px 24px 6px 0;
  min-height: 36px;
}
.compact-list-filter > span {
  font-size: 12px;
  color: var(--text-2);
  white-space: nowrap;
}
.record-detail,
.idea-sections {
  display: grid;
  gap: 16px;
}
@media (max-width: 700px) {
.panel {
    padding: 18px;
  }
.record {
    padding: 16px;
    gap: 12px;
  }
.record > div:nth-child(2) {
    min-width: 110px;
  }
.art {
    width: 62px;
    height: 76px;
  }
.record .badge {
    margin-left: auto;
  }
}
@media (prefers-reduced-motion: reduce) {
* {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
::selection{background:color-mix(in srgb, var(--btn) 40%, transparent);color:var(--btn-on)}
@media(max-width:700px) {
#page.with-bottom-action{padding-bottom:calc(180px + env(safe-area-inset-bottom,0px))}
}
@keyframes filter-arrive{from{opacity:0;transform:translateY(-4px) scale(.98)}to{opacity:1;transform:none}}
@media(max-height:700px) {
}


/* ==========================================================================
   Размеры кнопок консоли (план 2.6): цели >= 44, зазор >= 8, одна заливка на экран.
   Поверх переноса из демо (46 / 38 / 40 / 34 -> 48 / 44 / 44).
   ========================================================================== */
.primary,
.secondary,
.quiet,
.danger {
  border-radius: 999px;
  min-height: 48px;
  padding: 12px 22px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  transition:
    background var(--dur-base),
    border-color var(--dur-base),
    filter var(--dur-base),
    transform var(--dur-fast);
}
.primary:active,
.secondary:active,
.quiet:active,
.danger:active {
  transform: scale(0.98);
}
.secondary {
  background: transparent;
  border-color: var(--action);
  color: var(--action);
}
.quiet {
  background: transparent;
  border-color: transparent;
  color: var(--text);
}
.danger {
  background: transparent;
  border-color: color-mix(in srgb, var(--danger) 55%, transparent);
  color: var(--danger);
}
.compact {
  min-height: 44px;
  padding: 10px 18px;
  font-size: 15px;
}
.link {
  min-width: 44px;
  min-height: 44px;
  font-size: 16px;
  padding: 10px 0;
}
.link.is-danger,
.link.danger {
  color: var(--danger);
  background: none;
  border: 0;
}
input,
select,
textarea {
  min-height: 48px;
  border-radius: var(--r-field);
}
/* иконочная кнопка 44x44 (иконка 20): «Назад», «⋯», «Закрыть», WhatsApp, звонок */
.icon-btn {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  transition:
    background var(--dur-base),
    transform var(--dur-fast);
}
.icon-btn:hover {
  background: color-mix(in srgb, var(--text) 8%, transparent);
}
.icon-btn:active {
  transform: scale(0.94);
}
.icon-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-btn.is-outline {
  border-color: var(--line);
}
.icon-btn.is-danger {
  color: var(--danger);
}
.icon-btn.is-lg {
  width: 56px;
  height: 56px;
  min-height: 56px;
}
.icon-btn.is-lg svg {
  width: 24px;
  height: 24px;
}
/* демо-кнопки с иконкой тоже получают целевой размер */
.icon-button,
.back-button {
  width: 44px;
  height: 44px;
  min-height: 44px;
}
/* бейджи: таблетки; бейдж статуса в шапке карточки (28, не кнопка) */
.badge {
  border-radius: 999px;
  font-size: 12px;
  padding: 4px 10px;
}
.badge-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  pointer-events: none;
}
.badge.bad {
  color: var(--danger);
}
.tabs button {
  min-height: 48px;
  font-size: 14px;
}
