/* «Дворик» — стили интерьера кабинета владельца/продавца (/lk после входа).
   Поверх dvorik-base.css (токены/кнопки/карточки/логотип) — dvorik-base.css
   не трогаем (см. план редизайна), терракотовый и табличные цвета кладём
   здесь локально, они специфичны для кабинета. common.css/landing.css всё
   ещё нужны /crm — их не трогаем и не удаляем ничего оттуда. */

body.lk-app-mode.dvorik-page {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
}

/* Оболочка как у CRM: одна колонка max-width + margin:auto.
   Важно: у .lk-app-header НЕ ставить display:flex — иначе единственный
   .lk-app-header-inner с max-width прижимается влево (space-between /
   flex item), и весь кабинет выглядит сдвинутым. */
body.lk-app-mode main#app {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 clamp(14px, 3.5vw, 32px) 80px;
  box-sizing: border-box;
  width: 100%;
}

@media (max-width: 640px) {
  body.lk-app-mode main#app { padding: 0 16px 60px; }
}

/* ---- Шапка кабинета (#app-chrome) — как body.crm-page .topbar ---- */
.lk-app-header {
  position: sticky;
  top: 0;
  background: rgba(246, 245, 240, 0.94);
  backdrop-filter: blur(10px);
  z-index: 30;
  border-bottom: 1px solid rgba(226, 226, 216, 0.9);
}

.lk-app-header-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 12px clamp(14px, 3.5vw, 32px);
  width: 100%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 12px;
}

.lk-app-header-inner .dvorik-logo { flex: none; }

@media (max-width: 640px) {
  .lk-app-header-inner { padding: 10px 16px; }
}

.lk-app-account {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.lk-app-header-address {
  font-size: 13px;
  color: var(--text-tertiary, #8A8D80);
  line-height: 1.35;
  max-width: min(420px, 42vw);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
  flex: 1 1 auto;
  min-width: 0;
}

@media (max-width: 720px) {
  .lk-app-header-address {
    display: none;
  }
}

.lk-app-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--chip-bg);
  border: 1px solid var(--chip-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  flex: none;
}

.lk-app-account-name {
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

/* Префикс body.lk-app-mode на всех кнопочных правилах ниже —
   необходимость, не стиль: у lk-login.css есть старое правило
   "body.lk-app-mode button" (specificity 0,0,1,2), которое перебивает
   любой наш одноклассовый .lk-* селектор (0,0,1,0). Дублируя тот же
   префикс, поднимаем специфичность выше него. */
body.lk-app-mode .lk-app-logout-btn {
  display: flex;
  align-items: center;
  font-size: 14px;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  background: none;
  padding: 0 16px;
  min-height: 44px;
  box-sizing: border-box;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  flex: none;
}

body.lk-app-mode .lk-app-logout-btn:hover {
  border-color: var(--text);
  color: var(--text);
}

/* ---- Заголовок страницы + быстрые действия ---- */
body.lk-app-mode .lk-app-page {
  padding-top: 18px;
}

.lk-app-titlebar {
  display: none;
}

.lk-app-page-title {
  font-size: 40px;
  letter-spacing: -0.03em;
  font-weight: 600;
  margin: 0 0 8px;
}

.lk-app-page-sub {
  font-size: 16px;
  color: var(--text-tertiary);
  margin: 0;
}

.lk-app-quick-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .lk-app-page-title { font-size: 30px; }
}

/* ---- Панель вкладок ---- */
body.lk-app-mode .lk-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  padding: 10px 15px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  white-space: nowrap;
  min-height: 42px;
  box-sizing: border-box;
  flex: none;
  transition: background .15s, color .15s, border-color .15s;
}

.lk-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 7px;
  width: max-content;
  padding-right: 28px;
  box-sizing: content-box;
}

.lk-tabs-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scroll-padding-inline-end: 28px;
}

.lk-tabs-scroll::-webkit-scrollbar {
  height: 4px;
}

.lk-tabs-scroll::-webkit-scrollbar-thumb {
  background: #C8CBBE;
  border-radius: 4px;
}

body.lk-app-mode .lk-tab.is-active {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.lk-tab-badge {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 5px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  /* Владелец/продавец и админ: один персиковый индикатор на вкладках. */
  background: #F3D0B5;
  color: #9A4B1C;
}

.lk-tab.is-active .lk-tab-badge {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

/* ---- KPI-плитки (1px-разделитель между ячейками) ---- */
.lk-kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
  margin-bottom: 28px;
}

.lk-analytics-compact {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
  padding: 14px 16px 10px;
  margin-bottom: 22px;
}

.lk-analytics-compact__switch {
  margin-bottom: 12px;
}

.lk-analytics-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 8px 0;
  border-top: 1px solid var(--border);
  font-size: 14px;
}

.lk-analytics-line:first-of-type {
  border-top: none;
}

.lk-analytics-line-label {
  color: var(--text-secondary);
}

.lk-analytics-line-value {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.lk-kpi-tile {
  background: var(--surface);
  padding: 24px 24px 26px;
  min-width: 0;
}

.lk-kpi-label {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-bottom: 10px;
}

.lk-kpi-value {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.lk-kpi-hint {
  font-size: 13px;
  margin-top: 6px;
}

@media (max-width: 900px) {
  .lk-kpi-strip { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .lk-kpi-strip { grid-template-columns: 1fr; }
}

/* ---- Секции/заголовки внутри вкладки ---- */
.lk-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 18px;
}

.lk-section-title {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
}

.lk-section-sub {
  font-size: 14px;
  color: var(--text-tertiary);
}

/* ---- Чипы-фильтры ---- */
body.lk-app-mode .lk-chip {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  min-height: 44px;
  box-sizing: border-box;
  transition: background .15s, color .15s, border-color .15s;
}

body.lk-app-mode .lk-chip.is-active {
  background: var(--chip-bg);
  color: var(--chip-text);
  border-color: var(--chip-border);
}

.lk-chip-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.lk-chip-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}

/* Образец — фильтры статусов в кабинете: персиковый / голубой / серый.
   Красный оставляем для критичного и для CRM администратора. */
.lk-chip-badge--danger {
  background: #C0392B;
  color: #fff;
}

.lk-chip-badge--warn {
  background: #F3D0B5;
  color: #9A4B1C;
}

.lk-chip-badge--sky {
  background: #B3E0F5;
  color: #0D6A8F;
}

.lk-chip-badge--muted {
  background: #E2E3DA;
  color: #5C5F54;
}

.lk-chip-badge--ok {
  background: #D5E8DA;
  color: #1F5C38;
}

body.lk-app-mode .lk-chip.is-active .lk-chip-badge--danger {
  background: #A93226;
  color: #fff;
}

body.lk-app-mode .lk-chip.is-active .lk-chip-badge--warn {
  background: #E8B892;
  color: #7A3A14;
}

body.lk-app-mode .lk-chip.is-active .lk-chip-badge--sky {
  background: #8FD0EC;
  color: #0A5573;
}

body.lk-app-mode .lk-chip.is-active .lk-chip-badge--muted {
  background: #D0D1C8;
  color: #3F4238;
}

body.lk-app-mode .lk-chip.is-active .lk-chip-badge--ok {
  background: #B9D9C2;
  color: #174A2C;
}

.lk-hourly-chart {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  box-sizing: border-box;
}

.lk-hourly-chart svg {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
}

.lk-staff-perms {
  margin-top: 12px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--chip-bg);
  overflow: hidden;
}

.lk-staff-perms-summary {
  list-style: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  user-select: none;
}

.lk-staff-perms-summary::-webkit-details-marker { display: none; }

.lk-staff-perms-summary::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--text-secondary);
  border-bottom: 2px solid var(--text-secondary);
  transform: rotate(45deg);
  flex: none;
  transition: transform .15s;
  margin-top: -4px;
}

.lk-staff-perms[open] > .lk-staff-perms-summary::after {
  transform: rotate(-135deg);
  margin-top: 4px;
}

.lk-staff-perms-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 14px 14px;
}

.lk-staff-perms-hint {
  margin: 0 0 2px;
  font-size: 13px;
}

.lk-staff-perms-title {
  font-weight: 600;
  font-size: 14px;
}

.lk-staff-perms-save {
  margin: 6px 0 0;
}

.lk-person-card {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg);
  overflow: hidden;
}

.lk-person-card .lk-person-row {
  border: none;
  border-radius: 0;
  background: transparent;
}

.lk-person-card .lk-staff-perms {
  margin: 0 12px 12px;
}

/* Мини-приложение Telegram / MAX: узкий viewport + safe-area */
body.lk-miniapp {
  overflow-x: hidden;
}

body.lk-miniapp.lk-app-mode main#app {
  padding-left: max(12px, env(safe-area-inset-left));
  padding-right: max(12px, env(safe-area-inset-right));
  padding-bottom: max(48px, env(safe-area-inset-bottom));
  max-width: 100%;
  min-width: 0;
  overflow-x: clip;
  box-sizing: border-box;
}

body.lk-miniapp .lk-app-header-inner {
  padding-left: max(12px, env(safe-area-inset-left));
  padding-right: max(12px, env(safe-area-inset-right));
}

/* Широкий экран (ПК / Telegram Desktop): та же колонка 1320, что у CRM,
   даже если страница открыта как miniapp. */
@media (min-width: 900px) {
  body.lk-miniapp.lk-app-mode main#app {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 clamp(14px, 3.5vw, 32px) 80px;
    overflow-x: visible;
  }
  body.lk-miniapp .lk-app-header-inner {
    max-width: 1320px;
    padding: 12px clamp(14px, 3.5vw, 32px);
  }
}

body.lk-miniapp .lk-app-page-title {
  font-size: 26px;
}

body.lk-miniapp .lk-app-titlebar {
  padding-top: 16px;
  gap: 12px;
}

body.lk-miniapp .lk-app-account-name {
  max-width: 42vw;
}

body.lk-miniapp .lk-kpi-strip {
  grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 640px) {
  body.lk-app-mode .lk-tab {
    padding: 9px 13px;
    font-size: 13px;
    min-height: 38px;
  }
  .lk-tabs {
    flex-wrap: wrap;
    width: 100%;
    max-width: 100%;
    padding-right: 0;
    box-sizing: border-box;
  }
  .lk-tabs-scroll {
    overflow-x: visible;
    padding-bottom: 18px;
  }
}

body.lk-miniapp .lk-tabs {
  flex-wrap: wrap;
  width: 100%;
  max-width: 100%;
  padding-right: 0;
  box-sizing: border-box;
}

body.lk-miniapp .lk-tabs-scroll {
  overflow-x: visible;
  padding-bottom: 18px;
}

/* ---- Карточки заказов ---- */
.lk-order-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 36px;
}

.lk-order-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 22px 24px;
}

.lk-order-card:hover { border-color: #C9CCC0; }

.lk-order-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 16px;
  margin-bottom: 16px;
}

.lk-order-main {
  min-width: 0;
  flex: 1 1 auto;
}

.lk-order-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.lk-order-id {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--text-secondary);
}

.lk-order-time {
  font-size: 13px;
  color: var(--text-tertiary);
}

.lk-order-items {
  font-size: 17px;
  font-weight: 500;
  line-height: 1.4;
}

.lk-order-sub {
  font-size: 14px;
  color: var(--text-tertiary);
  margin-top: 6px;
}

.lk-order-total-wrap {
  text-align: right;
  flex: 0 0 auto;
  max-width: 8.5rem;
}

.lk-order-total {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.lk-order-was {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 4px;
  white-space: nowrap;
  text-decoration: underline dotted;
  text-underline-offset: 2px;
  cursor: help;
}

.lk-order-discount {
  font-size: 13px;
  color: var(--accent);
  margin-top: 4px;
  white-space: nowrap;
}

.lk-order-fact {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 16px;
}

.lk-order-fact-head {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 16px;
  padding: 11px 16px;
  background: var(--chip-bg);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #4E6B57;
}

.lk-order-fact-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 16px;
  padding: 12px 16px;
  border-top: 1px solid #EAE9DF;
  font-size: 15px;
  background: var(--bg);
}

.lk-order-fact-plan { color: var(--text-tertiary); }
.lk-order-fact-actual { font-weight: 500; }
.lk-order-fact-name { font-weight: 500; }

.lk-order-items--stack {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.lk-order-item-line {
  display: block;
  width: 100%;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.35;
  word-break: break-word;
}

.lk-order-card--compact { padding: 0; overflow: hidden; }
/* body.lk-app-mode — иначе проигрывает body.lk-app-mode button (зелёный фон). */
body.lk-app-mode .lk-order-compact-toggle {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 16px 18px;
  cursor: pointer;
  font: inherit;
  font-weight: inherit;
  color: inherit;
  border-radius: 0;
  box-shadow: none;
}
body.lk-app-mode .lk-order-compact-toggle:hover {
  background: transparent;
  color: inherit;
}
body.lk-app-mode .lk-order-compact-toggle .lk-order-head { margin-bottom: 0; align-items: center; }
.lk-order-expand-hint {
  flex: 0 0 auto;
  color: var(--accent);
  font-size: 18px;
  line-height: 1;
}

/* Сборка заказа — колонка без гориз. скролла */
.lk-assembly-editor { margin: 4px 0 0; }
.lk-assembly-list { display: flex; flex-direction: column; gap: 10px; }
.lk-assembly-row {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--bg);
}
.lk-assembly-row.is-removed { opacity: 0.45; }
.lk-assembly-row-top {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
}
.lk-assembly-name {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.3;
  word-break: break-word;
}
.lk-assembly-trash {
  flex: 0 0 auto;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 4px;
  color: #8C4A33;
}
.lk-assembly-fact {
  display: flex;
  align-items: center;
  gap: 8px;
}
body.lk-app-mode .lk-input.lk-assembly-qty {
  width: 5.5rem;
  max-width: 40%;
  font-size: 14px;
}
.lk-assembly-plan {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-tertiary);
  line-height: 1.3;
}
.lk-assembly-err {
  margin-top: 4px;
  font-size: 12px;
  color: #8C4A33;
}

@media (max-width: 640px) {
  .lk-order-card { padding: 16px; }
  .lk-order-items { font-size: 15px; }
  .lk-price-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 10px;
  }
  .lk-price-controls {
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
  }
  .lk-qty-stepper { margin-left: auto; }
}

/* План/факт в миниаппе и узком ЛК — колонка, без «кривой» сетки 3×N */
body.lk-app-mode .lk-order-fact-head,
body.lk-miniapp .lk-order-fact-head { display: none; }
body.lk-app-mode .lk-order-fact-row,
body.lk-miniapp .lk-order-fact-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  padding: 12px 14px;
}
body.lk-app-mode .lk-order-fact-name,
body.lk-miniapp .lk-order-fact-name {
  font-size: 15px;
  line-height: 1.35;
  word-break: break-word;
  overflow-wrap: anywhere;
}
body.lk-app-mode .lk-order-fact-plan,
body.lk-app-mode .lk-order-fact-actual,
body.lk-miniapp .lk-order-fact-plan,
body.lk-miniapp .lk-order-fact-actual {
  font-size: 13px;
  line-height: 1.4;
  width: 100%;
}
body.lk-miniapp .lk-price-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}
body.lk-miniapp .lk-price-controls {
  width: 100%;
  justify-content: flex-end;
  flex-wrap: wrap;
}
body.lk-miniapp .lk-qty-stepper { margin-left: auto; }

.lk-order-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

body.lk-app-mode .lk-btn-danger-outline {
  border: 1px solid var(--border);
  background: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 15px;
  color: #8C4A33;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  min-height: 44px;
}

body.lk-app-mode .lk-btn-danger-outline:hover { border-color: #8C4A33; }

body.lk-app-mode .lk-btn-ghost {
  border: 1px solid var(--border);
  background: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 15px;
  color: var(--text-secondary);
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  min-height: 44px;
}

body.lk-app-mode .lk-btn-ghost:hover { border-color: var(--text); color: var(--text); }

/* ---- Статус-пилюли (общий домен статусов заказов/заявок/тикетов) ---- */
.lk-status-pill {
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  font-weight: 500;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  white-space: nowrap;
}

/* нейтральный/новый */
.lk-status-pill--new { background: #F1F0E8; color: var(--text-secondary); border-color: var(--border); }
/* принято/одобрено/включено — зелёная плашка */
.lk-status-pill--accepted { background: var(--chip-bg); color: var(--chip-text); border-color: var(--chip-border); }
/* собрано — заливка акцентом */
.lk-status-pill--packed { background: var(--accent); color: var(--bg); border-color: var(--accent); }
/* готово/финал — тёмная заливка */
.lk-status-pill--ready { background: var(--text); color: var(--bg); border-color: var(--text); }
/* завершено (текстом, без заливки) */
.lk-status-pill--done { color: var(--accent); background: none; border: none; padding: 0; }
/* отменено/отклонено/деструктив */
.lk-status-pill--cancelled { color: #8C4A33; background: none; border: none; padding: 0; }
/* терракотовая плашка (заявка отклонена и т.п.) */
.lk-status-pill--danger { background: #F5E9E4; color: #8C4A33; border-color: #E8D3CA; }
/* нейтральная серая плашка (обработано/выключено) */
.lk-status-pill--muted { background: #EAE9DF; color: var(--text-secondary); border-color: transparent; }

/* ---- Таблицы ---- */
.lk-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
  max-width: 100%;
  min-width: 0;
}

.lk-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--border);
}

.lk-panel-title {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.lk-panel-note {
  font-size: 14px;
  color: var(--text-tertiary);
}

/* Горизонтальный скролл таблицы всегда доступен (в т.ч. с ПК в WebView):
   ограничиваем высоту, чтобы полоса прокрутки не уезжала под длинный tbody. */
.lk-table-wrap {
  width: 100%;
  max-width: 100%;
  max-height: min(70vh, 640px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #A8B0A0 transparent;
  touch-action: pan-x pan-y;
}

.lk-table-wrap::-webkit-scrollbar {
  height: 10px;
  width: 10px;
}

.lk-table-wrap::-webkit-scrollbar-thumb {
  background: #A8B0A0;
  border-radius: 6px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.lk-table-wrap::-webkit-scrollbar-track {
  background: #EEF0E8;
}

body.lk-miniapp .lk-table-wrap {
  max-height: min(58vh, 520px);
}

.lk-table-scroll-hint {
  margin: 0;
  padding: 10px 24px 0;
  font-size: 13px;
  line-height: 1.4;
}

.lk-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

.lk-table thead th {
  text-align: left;
  padding: 13px 24px;
  background: var(--chip-bg);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #4E6B57;
  font-weight: 500;
  white-space: nowrap;
}

.lk-table thead th.lk-table-num { text-align: right; }

.lk-table tbody td {
  padding: 15px 24px;
  border-top: 1px solid #EAE9DF;
  font-size: 15px;
  vertical-align: middle;
}

.lk-table tbody td.lk-table-num { text-align: right; font-weight: 500; white-space: nowrap; }

.lk-table-id { font-family: var(--mono); font-size: 13px; }
.lk-table-time { font-size: 13px; color: var(--text-tertiary); margin-top: 3px; }

.lk-panel-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 18px 24px;
  border-top: 1px solid #EAE9DF;
  font-size: 14px;
  color: var(--text-tertiary);
}

.lk-pager {
  display: flex;
  gap: 8px;
}

body.lk-app-mode .lk-pager button {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  background: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  padding: 12px 16px;
  border-radius: var(--radius-pill);
  min-height: 44px;
  box-sizing: border-box;
}

body.lk-app-mode .lk-pager button:hover { border-color: var(--text); }
body.lk-app-mode .lk-pager button:disabled { color: #C2C5B8; cursor: default; }
body.lk-app-mode .lk-pager button:disabled:hover { border-color: var(--border); }

/* ---- Заказ на месте: прайс-лист + корзина ---- */
.lk-onsite-grid {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 900px) {
  .lk-onsite-grid { grid-template-columns: 1fr; }
}

.lk-onsite-intro {
  background: var(--chip-bg);
  border: 1px solid var(--chip-border);
  border-radius: var(--radius-card);
  padding: 24px 26px;
  margin-bottom: 20px;
}

.lk-onsite-intro-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.lk-onsite-intro-text {
  font-size: 15px;
  line-height: 1.55;
  color: #5E6B5F;
  margin: 0;
}

.lk-price-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
}

.lk-price-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 16px;
  padding: 15px 22px;
  border-bottom: 1px solid #EAE9DF;
}

.lk-price-row:last-child { border-bottom: none; }

.lk-price-name { font-size: 16px; font-weight: 500; }
.lk-price-sub { font-size: 13px; color: var(--text-tertiary); margin-top: 3px; }

.lk-price-controls {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: none;
}

.lk-price-value {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.lk-qty-stepper {
  display: grid;
  grid-template-columns: 28px 4.25rem 2.25rem 28px;
  align-items: center;
  justify-items: center;
  column-gap: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 4px 6px;
  background: var(--bg);
  width: max-content;
  box-sizing: border-box;
  min-height: 36px;
}

body.lk-app-mode .lk-qty-stepper input {
  width: 4.25rem;
  height: 28px;
  min-width: 0;
  border: none;
  background: none;
  outline: none;
  font-size: 13px;
  line-height: 28px;
  color: var(--text);
  font-family: inherit;
  text-align: center;
  padding: 0;
  -moz-appearance: textfield;
  justify-self: stretch;
  box-sizing: border-box;
}

body.lk-app-mode .lk-qty-stepper input::-webkit-outer-spin-button,
body.lk-app-mode .lk-qty-stepper input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.lk-qty-unit {
  width: 2.25rem;
  height: 28px;
  font-size: 12px;
  line-height: 1;
  color: var(--text-tertiary);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

body.lk-app-mode .lk-qty-add-btn {
  border: none;
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg);
  font-size: 18px;
  line-height: 1;
  flex: none;
  padding: 0;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

body.lk-app-mode .lk-qty-add-btn:hover { background: var(--text); }

.lk-cart-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 24px 26px 26px;
  align-self: start;
}

.lk-cart-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.lk-cart-title { font-size: 19px; font-weight: 600; letter-spacing: -0.02em; }
.lk-cart-count { font-size: 13px; color: var(--text-tertiary); }

.lk-cart-lines {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.lk-cart-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 13px 15px;
  background: var(--bg);
}

.lk-cart-line-name { font-size: 15px; font-weight: 500; }
.lk-cart-line-sub { font-size: 13px; color: var(--text-tertiary); margin-top: 2px; }

body.lk-app-mode .lk-cart-remove {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 15px;
  color: #8C4A33;
  padding: 4px 6px;
}

.lk-cart-total-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  margin-bottom: 20px;
}

.lk-cart-total-label { font-size: 15px; color: var(--text-secondary); }
.lk-cart-total-value { font-size: 26px; font-weight: 600; letter-spacing: -0.03em; }

.lk-cart-note {
  font-size: 13px;
  line-height: 1.5;
  color: #A8AB9C;
  margin: 14px 0 0;
}

.lk-history-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 22px 24px;
  margin-top: 20px;
}

.lk-history-title { font-size: 16px; font-weight: 600; margin-bottom: 14px; }

.lk-history-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
}

.lk-history-row + .lk-history-row { margin-top: 12px; }

/* ---- Витрина ---- */
.lk-showcase-grid {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 1000px) {
  .lk-showcase-grid { grid-template-columns: 1fr; }
}

.lk-form-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 26px 26px 28px;
  align-self: start;
}

.lk-form-panel-title { font-size: 19px; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 6px; }
.lk-form-panel-lead { font-size: 14px; color: var(--text-tertiary); margin: 0 0 22px; }

.lk-field { display: flex; flex-direction: column; gap: 6px; }
.lk-field label,
.lk-field-label { font-size: 13px; color: var(--text-secondary); }

body.lk-app-mode .lk-field input,
body.lk-app-mode .lk-field select,
body.lk-app-mode .lk-field textarea,
body.lk-app-mode .lk-input,
body.lk-app-mode textarea,
.lk-input--textarea {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 12px;
  padding: 13px 15px;
  font-size: 15px;
  color: var(--text);
  font-family: inherit;
  box-sizing: border-box;
  width: 100%;
}

.lk-field textarea,
.lk-input--textarea { min-height: 88px; resize: vertical; background: #fff; }

.lk-field-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

.lk-form-stack { display: flex; flex-direction: column; gap: 14px; }

.lk-search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 6px 6px 6px 20px;
  margin-bottom: 14px;
}

body.lk-app-mode .lk-search-bar input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 16px;
  color: var(--text);
  min-width: 0;
  font-family: inherit;
}

.lk-search-found {
  font-size: 14px;
  color: var(--text-tertiary);
  padding-right: 12px;
  white-space: nowrap;
}

.lk-product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

@media (max-width: 640px) {
  .lk-product-grid { grid-template-columns: 1fr; }
}

.lk-product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.lk-product-card-top {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 20px;
  position: relative;
}

.lk-product-card-info {
  min-width: 0;
  flex: 1 1 auto;
}

.lk-product-card-photo {
  flex: 0 0 auto;
  margin-left: auto;
  align-self: flex-start;
}

.lk-product-photo-btn {
  white-space: normal;
  text-align: center;
  line-height: 1.2;
  max-width: 9.5rem;
}

.lk-product-stock-row,
.lk-product-step-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.lk-product-field {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.2;
}

.lk-product-field input.lk-input {
  width: 4.25rem;
  min-width: 4.25rem;
  max-width: 5rem;
  font-size: 12px;
  padding: 6px 8px;
  text-align: center;
}

.lk-product-field--wide input.lk-input {
  width: 4.25rem;
  min-width: 4.25rem;
  max-width: 5rem;
  font-size: 12px;
}

.lk-product-photo-status {
  display: block;
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 6px;
  min-height: 0;
}

.lk-product-card-body {
  padding: 0 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lk-product-thumb {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  flex: none;
  background-color: #EAE9DF;
  background-image: repeating-linear-gradient(135deg, #E1E0D4 0 8px, #EAE9DF 8px 16px);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lk-product-thumb img {
  width: 90%;
  height: 90%;
  object-fit: cover;
  object-position: center;
  display: block;
  border-radius: 8px;
}

.lk-product-name { font-size: 16px; font-weight: 500; line-height: 1.3; margin-bottom: 4px; }
.lk-product-cat { font-size: 13px; color: var(--text-tertiary); margin-bottom: 2px; }
.lk-product-origin {
  font-size: 11px;
  line-height: 1.25;
  color: var(--text-tertiary);
  margin: 0 0 6px;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lk-product-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.lk-product-price { font-family: var(--mono); font-size: 14px; }

.lk-product-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 12px 20px;
  border-top: 1px solid #EAE9DF;
  background: var(--bg);
  margin-top: auto;
}

.lk-product-step { font-family: var(--mono); font-size: 12px; color: var(--text-tertiary); }

.lk-product-foot-actions { display: flex; gap: 8px; }

body.lk-app-mode .lk-btn-tiny {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  color: var(--text-secondary);
  padding: 11px 14px;
  min-height: 44px;
  box-sizing: border-box;
  border-radius: var(--radius-pill);
}

body.lk-app-mode .lk-btn-tiny:hover { border-color: var(--text); color: var(--text); }

@media (max-width: 640px) {
  body.lk-app-mode .lk-btn-tiny {
    font-size: 12px;
    padding: 7px 10px;
    min-height: 34px;
  }

  .lk-product-card-top {
    gap: 12px;
    padding: 14px 14px 12px;
  }

  .lk-product-card-body {
    padding: 0 14px 12px;
    gap: 8px;
  }

  .lk-product-card-photo {
    position: absolute;
    top: 10px;
    right: 10px;
    margin-left: 0;
    z-index: 1;
  }

  .lk-product-card-info {
    padding-right: 6.75rem;
  }

  .lk-product-photo-btn {
    max-width: 6.75rem;
    font-size: 11px;
    padding: 6px 8px;
    min-height: 32px;
  }

  body.lk-app-mode .lk-input.lk-stock-placeholder {
    width: 7.5rem;
    padding: 8px 10px;
    font-size: 13px;
  }

  .lk-product-field input.lk-input,
  .lk-product-field--wide input.lk-input {
    width: 4.5rem;
    min-width: 4.5rem;
    max-width: 5.5rem;
    padding: 8px 8px;
    font-size: 13px;
  }
}

body.lk-miniapp .lk-btn-tiny {
  font-size: 12px;
  padding: 7px 10px;
  min-height: 34px;
}

body.lk-miniapp .lk-product-card-photo {
  position: absolute;
  top: 10px;
  right: 10px;
  margin-left: 0;
  z-index: 1;
}

body.lk-miniapp .lk-product-card-info {
  padding-right: 6.75rem;
}

body.lk-miniapp .lk-product-photo-btn {
  max-width: 6.75rem;
  font-size: 11px;
  padding: 6px 8px;
  min-height: 32px;
}

.lk-empty-state {
  border: 1px dashed #D3D5C9;
  border-radius: 16px;
  padding: 40px;
  text-align: center;
  background: var(--surface);
}

.lk-empty-state-title { font-size: 17px; font-weight: 500; margin-bottom: 6px; }
.lk-empty-state-text { font-size: 15px; color: var(--text-tertiary); }

.lk-empty-state--sm {
  border: 1px dashed #D3D5C9;
  border-radius: 14px;
  padding: 26px;
  text-align: center;
  font-size: 15px;
  color: var(--text-tertiary);
}

/* ---- Поступления / Списания ---- */
.lk-stock-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 900px) {
  .lk-stock-grid { grid-template-columns: 1fr; }
}

.lk-stock-doc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 26px 26px 28px;
}

.lk-stock-doc-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }

.lk-stock-doc-dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.lk-stock-doc-dot--in { background: var(--accent); }
.lk-stock-doc-dot--out { background: #8C4A33; }

.lk-stock-doc-title { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; }

.lk-stock-doc-lead { font-size: 15px; line-height: 1.55; color: var(--text-secondary); margin: 0 0 22px; }

.lk-stock-rows { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }

.lk-stock-comment { display: block; margin-bottom: 18px; }
.lk-stock-comment__label { display: block; margin-bottom: 6px; font-size: 13px; color: var(--text-secondary); }
.lk-stock-comment textarea {
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
}

body.lk-app-mode .lk-input.lk-stock-placeholder {
  width: 9.5rem;
  max-width: 100%;
  font-size: 12px;
}

body.lk-app-mode .lk-input.lk-stock-placeholder::placeholder {
  font-size: 11px;
  letter-spacing: -0.01em;
}

.lk-stock-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  align-items: start;
  gap: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--bg);
}

.lk-stock-row > select {
  grid-column: 1;
  grid-row: 1;
}

.lk-stock-row-remove {
  grid-column: 2;
  grid-row: 1;
}

.lk-stock-row-name { font-size: 15px; font-weight: 500; }
.lk-stock-row-sub {
  font-size: 11px;
  line-height: 1.25;
  color: var(--text-tertiary);
  margin: 0;
  max-width: none;
  white-space: normal;
  overflow-wrap: anywhere;
  flex: 1 1 auto;
  min-width: 0;
  text-align: left;
}

.lk-stock-row-qty {
  grid-column: 1 / -1;
  grid-row: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  padding: 6px 10px;
  justify-self: stretch;
}

body.lk-app-mode .lk-stock-row-qty input {
  width: 4.5rem;
  min-width: 0;
  flex: 0 0 auto;
  border: none;
  background: none;
  outline: none;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  text-align: left;
}

body.lk-app-mode .lk-stock-row-qty .lk-qty-unit {
  width: auto;
  min-width: 1.5rem;
  text-align: left;
  justify-self: start;
  flex: 0 0 auto;
}

body.lk-app-mode .lk-stock-row select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13px;
  color: var(--text);
  font-family: inherit;
}

body.lk-app-mode .lk-stock-row-remove {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 15px;
  color: #8C4A33;
  padding: 4px 6px;
  flex: none;
  justify-self: end;
  width: 28px;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

span.lk-stock-row-remove {
  cursor: default;
  visibility: hidden;
  pointer-events: none;
}

.lk-stock-row-sub:empty { display: none; }

@media (max-width: 640px) {
  .lk-stock-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 28px;
    align-items: start;
    gap: 8px 10px;
  }
  .lk-stock-row > select {
    grid-column: 1;
    grid-row: 1;
    flex: none;
    min-width: 0;
  }
  .lk-stock-row-remove {
    grid-column: 2;
    grid-row: 1;
    order: unset;
  }
  .lk-stock-row-qty {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    order: unset;
    justify-self: stretch;
  }
}

body.lk-miniapp .lk-stock-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  align-items: start;
  gap: 8px 10px;
}

body.lk-miniapp .lk-stock-row > select {
  grid-column: 1;
  grid-row: 1;
  flex: none;
  min-width: 0;
}

body.lk-miniapp .lk-stock-row-remove {
  grid-column: 2;
  grid-row: 1;
  order: unset;
}

body.lk-miniapp .lk-stock-row-qty {
  grid-column: 1 / -1;
  grid-row: 2;
  width: 100%;
  order: unset;
  justify-self: stretch;
}

body.lk-app-mode .lk-btn-receipt {
  border: 1px solid var(--accent);
  background: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  color: var(--accent);
  padding: 11px 20px;
  border-radius: var(--radius-pill);
  min-height: 44px;
}

body.lk-app-mode .lk-btn-receipt:hover {
  background: var(--accent);
  color: var(--bg);
}

body.lk-app-mode .lk-btn-writeoff {
  border: 1px solid #8C4A33;
  background: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  color: #8C4A33;
  padding: 11px 20px;
  border-radius: var(--radius-pill);
  min-height: 44px;
}

body.lk-app-mode .lk-btn-writeoff:hover { background: #8C4A33; color: var(--bg); }

/* ---- Аналитика ---- */
.lk-analytics-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
}

.lk-chart-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

@media (max-width: 900px) {
  .lk-chart-grid { grid-template-columns: 1fr; }
}

.lk-chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 26px 28px 22px;
}

.lk-chart-title { font-size: 19px; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 6px; }
.lk-chart-lead { font-size: 14px; color: var(--text-tertiary); margin: 0 0 26px; }

.lk-bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 190px;
  margin-bottom: 12px;
}

.lk-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 2px;
  min-width: 0;
}

.lk-bar-cancel { background: #8C4A33; border-radius: 4px 4px 0 0; }
.lk-bar-ok { background: var(--accent); border-radius: 0 0 4px 4px; }

.lk-bars-axis {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-tertiary);
}

.lk-split-row { margin-bottom: 16px; }
.lk-split-row:last-child { margin-bottom: 0; }

.lk-split-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}

.lk-split-label { font-size: 15px; }
.lk-split-value { font-family: var(--mono); font-size: 14px; color: var(--text-secondary); }

.lk-split-track {
  height: 8px;
  border-radius: 99px;
  background: #EAE9DF;
  overflow: hidden;
}

.lk-split-fill { height: 100%; border-radius: 99px; }

.lk-chart-note {
  border-top: 1px solid var(--border);
  margin-top: 24px;
  padding-top: 20px;
}

.lk-chart-note-title { font-size: 15px; font-weight: 500; margin-bottom: 12px; }
.lk-chart-note-text { font-size: 14px; line-height: 1.55; color: var(--text-secondary); margin: 0; }

/* ---- Справочники ---- */
.lk-request-banner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  background: var(--chip-bg);
  border: 1px solid var(--chip-border);
  border-radius: var(--radius-card);
  padding: 24px 26px;
  margin-bottom: 24px;
}

.lk-request-banner-title { font-size: 19px; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 8px; }
.lk-request-banner-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.lk-request-banner-name { font-size: 16px; font-weight: 500; }
.lk-request-banner-meta { font-size: 14px; color: #5E6B5F; }

.lk-filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

body.lk-app-mode .lk-filter-bar .lk-input,
body.lk-app-mode .lk-filter-bar select {
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: var(--radius-pill);
  padding: 11px 18px;
  font-size: 15px;
  font-family: inherit;
}

.lk-filter-bar .lk-input { flex: 1; min-width: 220px; }

@media (max-width: 640px) {
  .lk-filter-bar {
    padding: 14px 16px;
  }
  .lk-filter-bar .lk-input {
    min-width: 0;
    width: 100%;
    flex: 1 1 100%;
  }
  body.lk-app-mode .lk-filter-bar select {
    flex: 1 1 calc(50% - 6px);
    min-width: 0;
  }
}

body.lk-miniapp .lk-settings-block {
  padding: 18px 16px 20px;
}

body.lk-miniapp .lk-card {
  padding: 18px 16px 20px;
}

/* ---- Модалка (переиспользует .lk-login-dialog/.lk-login-box) ---- */
.lk-modal-box {
  max-width: 560px;
  width: 100%;
}

.lk-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.lk-modal-title { font-size: 24px; font-weight: 600; letter-spacing: -0.025em; }

.lk-modal-lead { font-size: 15px; line-height: 1.55; color: var(--text-secondary); margin: 0 0 24px; }

body.lk-app-mode .lk-modal-close {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 20px;
  color: var(--text-tertiary);
  line-height: 1;
  padding: 2px 4px;
}

.lk-modal-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

.lk-modal-fields .lk-field--span2 { grid-column: span 2; }

.lk-modal-note {
  font-size: 13px;
  line-height: 1.5;
  color: #A8AB9C;
  margin: 0 0 24px;
}

/* ---- Обращения / Доступ / Настройки — общие карточки ---- */
.lk-two-col {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 900px) {
  .lk-two-col { grid-template-columns: 1fr; }
}

.lk-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 26px 28px 28px;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
}

.lk-card-title { font-size: 19px; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 8px; }
.lk-card-lead { font-size: 15px; line-height: 1.55; color: var(--text-secondary); margin: 0 0 22px; }

.lk-ticket-item {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
  background: var(--bg);
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
}

.lk-ticket-item + .lk-ticket-item { margin-top: 12px; }

.lk-ticket-item-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}

.lk-ticket-item-title {
  font-size: 16px;
  font-weight: 500;
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.3;
}
.lk-ticket-item-head .lk-status-pill { justify-self: end; flex-shrink: 0; }
.lk-ticket-item-text {
  font-size: 15px;
  line-height: 1.5;
  color: #3C4038;
  margin: 0;
  overflow-wrap: anywhere;
}
.lk-ticket-item-time {
  font-size: 13px;
  color: var(--text-tertiary);
  margin: 0;
  min-width: 0;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.4;
}

.lk-tickets-admin-head {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  margin-bottom: 16px;
}
.lk-tickets-admin-head__text { min-width: 0; }
.lk-tickets-admin-head__text .lk-card-title {
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.25;
}
body.lk-app-mode .lk-tickets-admin-head__btn {
  width: 100%;
  justify-content: center;
  box-sizing: border-box;
}
@media (min-width: 720px) {
  .lk-tickets-admin-head {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
  }
  body.lk-app-mode .lk-tickets-admin-head__btn {
    width: auto;
    flex: 0 0 auto;
    white-space: nowrap;
  }
}

body.lk-app-mode .lk-stock-history-row {
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  cursor: pointer;
  font: inherit;
  font-weight: inherit;
  border: none;
  background: transparent;
  color: inherit;
  padding: 12px 14px;
  box-sizing: border-box;
  border-radius: 0;
  box-shadow: none;
}
.lk-stock-history-row__main {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.lk-stock-history-row__title {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.lk-stock-history-row__sub { font-size: 13px; }
.lk-stock-history-row__time {
  flex: 0 0 auto;
  margin: 0 0 0 auto;
  font-size: 13px;
  color: var(--text-tertiary);
  text-align: right;
  white-space: nowrap;
  line-height: 1.35;
  align-self: flex-start;
}
.lk-stock-history-row__body {
  padding: 0 14px 12px;
  border-top: 1px solid #EAE9DF;
}

/* ---- Строка истории продаж на месте (сворачиваемая) ---- */
.lk-history-item { padding: 0; overflow: hidden; }

body.lk-app-mode .lk-history-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  font-weight: inherit;
  border: none;
  background: transparent;
  color: inherit;
  padding: 12px 14px;
  min-height: 44px;
  box-sizing: border-box;
  border-radius: 0;
  box-shadow: none;
}
body.lk-app-mode .lk-history-toggle:hover {
  background: transparent;
  color: inherit;
}

.lk-history-toggle-info { min-width: 0; }
.lk-history-toggle-info .lk-ticket-item-head { margin-bottom: 2px; }
.lk-history-toggle-info .lk-ticket-item-time { margin-bottom: 0; }

.lk-history-toggle-right {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  flex: none;
}

.lk-history-toggle-total { font-size: 14px; font-weight: 500; }
.lk-history-toggle-sign { font-size: 18px; color: var(--accent); line-height: 1; }

.lk-history-toggle-body {
  border-top: 1px solid #EAE9DF;
  padding: 4px 14px 12px;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.lk-history-toggle-body .lk-order-items { font-size: 14px; }

/* Кнопки ответа в обращении — в столбик на узком экране миниаппа */
.lk-ticket-item .lk-order-actions {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

@media (max-width: 720px), (max-width: 900px) {
  body.lk-miniapp .lk-ticket-item .lk-order-actions,
  body.lk-app-mode .lk-ticket-item .lk-order-actions {
    flex-direction: column;
    align-items: stretch;
  }
  body.lk-miniapp .lk-ticket-item .lk-order-actions > button,
  body.lk-app-mode .lk-ticket-item .lk-order-actions > button {
    width: 100%;
    justify-content: center;
    box-sizing: border-box;
    white-space: normal;
  }
}

.lk-person-row {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
  background: var(--bg);
}

.lk-person-row + .lk-person-row { margin-top: 12px; }
.lk-person-card + .lk-person-card { margin-top: 0; }

.lk-person-avatar {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--chip-bg);
  border: 1px solid var(--chip-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  flex: none;
}

.lk-person-name { font-size: 15px; font-weight: 500; }
.lk-person-sub { font-size: 13px; color: var(--text-tertiary); margin-top: 2px; }

/* ---- Настройки ---- */
.lk-settings-stack { display: flex; flex-direction: column; gap: 24px; }
.lk-settings-row { display: grid; grid-template-columns: 1.15fr 1fr; gap: 24px; }

@media (max-width: 900px) {
  .lk-settings-row { grid-template-columns: 1fr; }
}

.lk-schedule-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

.lk-schedule-row {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1.2fr auto;
  gap: 14px;
  align-items: center;
  padding: 13px 18px;
  background: var(--bg);
  font-size: 15px;
}

@media (max-width: 640px) {
  .lk-schedule-row { grid-template-columns: 1fr; }
}

.lk-schedule-day { font-weight: 500; }
.lk-schedule-hours { font-family: var(--mono); font-size: 14px; color: #3C4038; }
.lk-schedule-pause { font-size: 14px; color: var(--text-tertiary); }

body.lk-app-mode .lk-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  border-radius: 50%;
  font-size: 14px;
  cursor: pointer;
}

body.lk-app-mode .lk-icon-btn:hover {
  border-color: var(--text);
  color: var(--text);
}

.lk-qr-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.lk-qr-box {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  text-align: center;
  background: var(--bg);
}

.lk-qr-box img { width: 82px; height: 82px; margin: 0 auto 12px; display: block; border-radius: 10px; }

.lk-qr-placeholder {
  width: 82px;
  height: 82px;
  margin: 0 auto 12px;
  border-radius: 10px;
  background-color: var(--text);
  background-image:
    repeating-linear-gradient(90deg, var(--text) 0 6px, var(--bg) 6px 12px),
    repeating-linear-gradient(0deg, var(--text) 0 6px, transparent 6px 12px);
}

.lk-qr-label { font-size: 14px; font-weight: 500; }

.lk-loyalty-table {
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  min-width: 520px;
}

.lk-loyalty-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.lk-loyalty-head {
  display: grid;
  grid-template-columns: 1fr 1.2fr 0.8fr;
  gap: 14px;
  padding: 12px 18px;
  background: var(--chip-bg);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #4E6B57;
}

.lk-loyalty-row {
  display: grid;
  grid-template-columns: 1fr 1.2fr 0.8fr;
  gap: 14px;
  align-items: center;
  padding: 14px 18px;
  border-top: 1px solid #EAE9DF;
  font-size: 15px;
  background: var(--bg);
}

.lk-loyalty-name { display: flex; align-items: center; gap: 10px; }
.lk-loyalty-dot { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.lk-loyalty-from { font-family: var(--mono); font-size: 14px; color: var(--text-secondary); }
.lk-loyalty-discount { text-align: right; font-family: var(--mono); font-size: 15px; font-weight: 600; color: var(--accent); }

.lk-theme-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

@media (max-width: 480px) {
  .lk-theme-grid { grid-template-columns: 1fr; }
}

.lk-theme-swatch {
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg);
}

.lk-theme-swatch.is-selected { border-color: var(--accent); }

.lk-theme-swatch-color { height: 56px; }

.lk-theme-swatch-body { padding: 12px 14px 14px; }
.lk-theme-swatch-name { font-size: 14px; font-weight: 500; }
.lk-theme-swatch-tag { font-size: 12px; color: var(--text-tertiary); margin-top: 3px; }

.lk-notify-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 13px 16px;
  background: var(--bg);
}

.lk-notify-row + .lk-notify-row { margin-top: 10px; }

.lk-notify-channel { font-size: 15px; font-weight: 500; }
.lk-notify-id { font-family: var(--mono); font-size: 13px; color: var(--text-tertiary); margin-top: 2px; }

.lk-inline-stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 13px 16px;
  background: var(--bg);
  margin-bottom: 12px;
}

.lk-inline-stat-label { font-size: 15px; color: var(--text-secondary); }
.lk-inline-stat-value { font-family: var(--mono); font-size: 15px; font-weight: 500; }

.lk-link-arrow {
  display: inline-block;
  font-size: 15px;
  font-weight: 500;
  color: var(--accent);
  border-bottom: 1px solid var(--chip-border);
  padding-bottom: 2px;
  margin-top: 18px;
}

.lk-link-arrow:hover { color: var(--text); }

/* ---- Настройки — переиспользуем существующую разметку
   .lk-settings/.lk-settings-block/.lk-settings-sub из lk-login.css (там же
   вся логика драфтов/сохранения), здесь только переопределяем внешний вид
   под dvorik: карточка вместо «инфо-карты лендинга», Instrument Sans вместо
   DM Serif Display, токены цвета. ---- */
body.lk-app-mode .lk-settings-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 26px 28px 28px;
  box-shadow: none;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
}

body.lk-app-mode .lk-settings-block--accent {
  border-color: var(--chip-border);
  box-shadow: none;
  background: var(--surface);
}

body.lk-app-mode .lk-settings-block__title {
  font-family: var(--sans);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}

body.lk-app-mode .lk-settings-block__head {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
}

body.lk-app-mode .lk-settings-block__head-text {
  min-width: 0;
  flex: 0 0 auto;
  width: 100%;
}

body.lk-app-mode .lk-settings-block__head-text .lk-settings-block__title,
body.lk-app-mode .lk-settings-block__head-text .lk-settings-block__lead {
  overflow-wrap: break-word;
  word-break: normal;
}

body.lk-app-mode .lk-settings-block__head-text .lk-settings-block__lead {
  margin-bottom: 0;
}

body.lk-app-mode .lk-btn-point-paused {
  flex: 1 1 auto;
  min-width: 0;
  white-space: normal;
  text-align: center;
  border: 1px solid var(--border, #d8d5c8);
  background: var(--surface, #fff) !important;
  color: var(--text) !important;
  font-size: 13px;
  font-weight: 500;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  box-sizing: border-box;
  position: static;
  margin: 0;
}

body.lk-app-mode .lk-btn-point-paused.is-active {
  border-color: #c45c4a;
  background: #fdf0ed !important;
  color: #8b2e22 !important;
}

body.lk-app-mode .lk-btn-settings-save {
  flex: 0 0 auto;
  white-space: nowrap;
  box-sizing: border-box;
  position: static;
  margin: 0;
}

body.lk-app-mode .lk-settings-block__lead {
  color: var(--text-secondary);
  line-height: 1.55;
}

body.lk-app-mode .lk-settings-sub {
  border-top-color: var(--border);
}

body.lk-app-mode .lk-settings-sub__title {
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

body.lk-app-mode .lk-settings .muted { color: var(--text-tertiary); }

.lk-horizon-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  min-height: 0;
  flex-wrap: wrap;
}
.lk-horizon-row__label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  font-size: 14px;
  line-height: 1.3;
}
body.lk-app-mode .lk-horizon-row__label input {
  width: 4.5rem;
  min-width: 4.5rem;
  max-width: 4.5rem;
  flex: none;
  margin: 0;
}
.lk-horizon-row__status {
  flex: 0 0 auto;
  margin: 0;
  margin-left: auto;
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
  text-align: right;
}

body.lk-app-mode .lk-settings-block__head-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: stretch;
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  position: relative;
}

@media (max-width: 900px) {
  body.lk-app-mode .lk-settings-block__head-actions {
    flex-direction: column;
  }
  body.lk-app-mode .lk-settings-block__head-actions > button {
    width: 100%;
    max-width: 100%;
    flex: 0 0 auto;
  }
}

body.lk-miniapp .lk-settings-block__head-actions {
  flex-direction: column;
  align-items: stretch;
}
body.lk-miniapp .lk-settings-block__head-actions > button {
  width: 100%;
  max-width: 100%;
  flex: 0 0 auto;
}

@media (min-width: 901px) {
  body.lk-app-mode:not(.lk-miniapp) .lk-settings-block__head {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
  }
  body.lk-app-mode:not(.lk-miniapp) .lk-settings-block__head-text {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
  }
  body.lk-app-mode:not(.lk-miniapp) .lk-settings-block__head-actions {
    width: auto;
    flex: 0 0 auto;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  body.lk-app-mode:not(.lk-miniapp) .lk-settings-block__head-actions > button {
    width: auto;
  }
}

/* Строки графика самовывоза */
.lk-hours-day {
  display: grid;
  grid-template-columns: minmax(7.5rem, auto) auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  min-width: 0;
}
.lk-hours-day__label {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  margin: 0;
  font-size: 14px;
  font-weight: 500;
}
.lk-hours-day__times {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  min-width: 0;
}
body.lk-app-mode .lk-hours-day__times input[type="time"] {
  width: auto;
  min-width: 5.5rem;
  max-width: 7.5rem;
  flex: none;
  margin: 0;
  box-sizing: border-box;
}
.lk-hours-day__dash {
  color: var(--text-tertiary);
  flex: none;
}
.lk-hours-day__breaks {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}

@media (max-width: 720px) {
  .lk-hours-day {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "label pencil"
      "times times"
      "breaks breaks";
  }
  .lk-hours-day__label { grid-area: label; }
  .lk-hours-day__times { grid-area: times; }
  .lk-hours-day__breaks { grid-area: breaks; }
  .lk-hours-day > button {
    grid-area: pencil;
    justify-self: end;
  }
}

body.lk-miniapp .lk-hours-day {
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "label pencil"
    "times times"
    "breaks breaks";
}
body.lk-miniapp .lk-hours-day__label { grid-area: label; }
body.lk-miniapp .lk-hours-day__times { grid-area: times; }
body.lk-miniapp .lk-hours-day__breaks { grid-area: breaks; }
body.lk-miniapp .lk-hours-day > button {
  grid-area: pencil;
  justify-self: end;
}

/* ---- Форма «Добавить товар» (Витрина) — переиспользует уже существующую
   разметку .lk-product-form/.lk-form-field/.lk-form-control из lk-login.css
   (3-колоночная сетка на широких экранах), здесь только приводим цвета/радиусы
   к dvorik и оформляем обёртку карточкой. ---- */
body.lk-app-mode .lk-form-control {
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--text);
  font-family: inherit;
}

.lk-form-label { color: var(--text-secondary) !important; }
.form-req { color: #8C4A33 !important; }

body.lk-app-mode .lk-category-badge {
  background: var(--chip-bg);
  border: 1px solid var(--chip-border);
  color: var(--chip-text);
  border-radius: 10px;
}

body.lk-app-mode .lk-settings-sub__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

body.lk-app-mode .lk-settings-sub__head .lk-settings-sub__title {
  margin: 0;
}

body.lk-app-mode .lk-settings-sub__head-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.lk-product-form-details {
  border: none;
}

.lk-product-form-details > summary {
  list-style: none;
  cursor: pointer;
}

.lk-product-form-details > summary::-webkit-details-marker {
  display: none;
}

.lk-product-form-summary {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.lk-photo-preview-wrap {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.lk-photo-preview-wrap .lk-form-control {
  flex: 1 1 auto;
  min-width: 0;
}

.lk-photo-preview {
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border, #e5e5e0);
  background: #f5f5f0;
}

.lk-product-form__hint { color: var(--text-tertiary) !important; }

/* ---- Переключатель свёрнутой группы (обработанные/отменённые) ---- */
.lk-group-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-family: inherit;
  font-size: 15px;
  color: var(--text-secondary);
  padding: 12px 0;
  border-top: 1px solid var(--border);
  margin-top: 4px;
  user-select: none;
}

.lk-group-toggle:hover { color: var(--text); }

.lk-group-toggle-arrow {
  font-size: 11px;
  color: var(--text-tertiary);
  transition: transform .15s ease;
}

.lk-group-toggle.is-open .lk-group-toggle-arrow { transform: rotate(90deg); }

.lk-tickets-processed-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 8px 0 12px;
}

.lk-tickets-processed-filter label {
  display: flex;
  align-items: center;
  gap: 4px;
}

.lk-tickets-processed-filter input[type="date"] {
  font-family: inherit;
  font-size: 13px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}

/* ---- Общие alert/confirm-модалки кабинета (showLkAlertModal/showLkConfirmModal) —
   класс .checkout-modal нигде больше в проекте не стилизован (голый <dialog>
   браузера), можно безопасно оформить здесь. ---- */
.checkout-modal {
  border: none;
  padding: 0;
  margin: auto;
  max-width: calc(100vw - 32px);
  background: transparent;
  border-radius: 20px;
}

.checkout-modal::backdrop {
  background: rgba(20, 23, 15, 0.42);
  backdrop-filter: blur(4px);
}

.checkout-modal__panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 26px 60px -36px rgba(20, 23, 15, 0.45);
  font-family: var(--sans);
  color: var(--text);
}

.checkout-modal__panel h3 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

body.lk-app-mode .checkout-modal__panel button {
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  color: var(--bg);
  background: var(--accent);
  padding: 11px 20px;
  border-radius: var(--radius-pill);
  min-height: 44px;
}

body.lk-app-mode .checkout-modal__panel button:hover { background: var(--text); }

body.lk-app-mode .checkout-modal__panel button.secondary {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

body.lk-app-mode .checkout-modal__panel button.secondary:hover { border-color: var(--text); color: var(--text); }

.lk-confirm-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 4px;
}

.lk-confirm-table th {
  text-align: left;
  padding: 10px 12px;
  background: var(--chip-bg);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #4E6B57;
}

.lk-confirm-table td {
  padding: 10px 12px;
  border-top: 1px solid #EAE9DF;
  font-size: 14px;
}

.lk-tickets-duo {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}
@media (max-width: 980px) {
  .lk-tickets-duo { grid-template-columns: 1fr; }
}
.lk-ticket-group-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 16px 0 10px;
}
.lk-ticket-group-title:first-child { margin-top: 0; }
.lk-history-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}
body.lk-app-mode .lk-history-filter {
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-secondary);
  cursor: pointer;
}
body.lk-app-mode .lk-history-filter.is-active {
  border-color: var(--accent);
  color: var(--accent);
  background: #EAF3EC;
}
