/* ══════════════════════════════════════════════════════════════════
   IDISI — BOTTOM SHEETS & MODALS (VIDEOMAKER FROSTED MONOCHROME)
   With Dynamic Hover Color Manifestation
   ══════════════════════════════════════════════════════════════════ */

.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 90;
  opacity: 0;
  visibility: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  transition: opacity 0.28s var(--ease), visibility 0.28s var(--ease);
}

.sheet-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.sheet-panel {
  width: 100%;
  max-width: 620px;
  max-height: 88dvh;
  background: var(--sheet-bg);
  backdrop-filter: var(--glass-sheet);
  -webkit-backdrop-filter: var(--glass-sheet);
  border: 1px solid var(--border-light);
  border-bottom: none;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  box-shadow: var(--sheet-shadow);
  transform: translate3d(0, 100%, 0);
  will-change: transform, opacity;
  transition: transform 0.28s var(--ease), opacity 0.28s var(--ease), background 0.3s var(--ease);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: var(--font);
  touch-action: pan-y;
}

.sheet-panel.dragging {
  transition: none !important;
  user-select: none;
  -webkit-user-select: none;
}

.sheet-backdrop.open .sheet-panel {
  transform: translate3d(0, 0, 0);
}

/* Bottom Sheet Drag Handle (Mobile Only) */
.sheet-handle-bar {
  width: 44px;
  height: 5px;
  border-radius: var(--r-full);
  background: var(--handle-bar);
  margin: 8px auto 4px;
  flex-shrink: 0;
  cursor: grab;
  position: relative;
  touch-action: none;
}

.sheet-handle-bar::before {
  content: '';
  position: absolute;
  top: -12px;
  bottom: -12px;
  left: -24px;
  right: -24px;
}

/* ── Responsive Tablet & Desktop Dialog Mode ───────────────────── */
@media (min-width: 768px) {
  .sheet-backdrop {
    align-items: center;
    justify-content: center;
    padding: 24px;
  }

  .sheet-panel {
    max-width: 660px;
    max-height: 86vh;
    border-radius: var(--r-xl);
    border: 1px solid var(--border-light);
    box-shadow: 0 28px 72px rgba(0, 0, 0, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transform: scale(0.94) translateY(12px);
    opacity: 0;
  }

  .sheet-backdrop.open .sheet-panel {
    transform: scale(1) translateY(0);
    opacity: 1;
  }

  .sheet-handle-bar {
    display: none;
  }
}

@media (min-width: 1024px) {
  .sheet-panel {
    max-width: 720px;
  }
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sheet-header h2 {
  font-size: var(--fs-title);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.sheet-close-btn {
  width: 30px;
  height: 30px;
  border-radius: var(--r-full);
  border: 1px solid var(--border);
  background: var(--glass-pill);
  color: var(--text-muted);
  font-size: var(--fs-body);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s var(--ease);
}

.sheet-close-btn:hover {
  background: var(--glass-bg-hover);
  border-color: var(--border-light);
  color: var(--text-main);
  transform: scale(1.08);
}

.sheet-body {
  padding: 16px 16px calc(24px + env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Hero & Info Card (Mobile-First Ergonomic Layout) ───────────── */
.detail-header-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--r-lg);
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.detail-hero-box {
  width: 86px;
  height: 122px;
  min-width: 86px;
  min-height: 122px;
  flex-shrink: 0;
  position: relative;
  border-radius: var(--r-md);
  overflow: hidden;
  background: rgba(10, 10, 10, 0.9);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.detail-hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(20px) brightness(0.4);
  transform: scale(1.2);
}

.detail-hero-cover {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--r-md);
}

.detail-hero-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  background: var(--glass-pill);
}

.detail-info-box {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-book-title {
  font-size: var(--fs-body);
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.detail-book-author {
  font-size: var(--fs-label);
  color: var(--text-muted);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.detail-sku-wrap {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.detail-stock-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 3px 8px;
  min-width: 32px;
  height: 22px;
  border-radius: var(--r-full);
  font-size: var(--fs-meta);
  font-weight: 700;
  border: 1px solid var(--border);
  background: var(--glass-pill);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  line-height: 1;
  transition: all 0.2s var(--ease);
}

.stock-chip-dot {
  width: 6.5px;
  height: 6.5px;
  border-radius: var(--r-full);
  flex-shrink: 0;
}

/* Твёрдый: изумрудный зеленый (Success) */
.detail-stock-chip.hard {
  color: #4ade80;
  border-color: rgba(34, 197, 94, 0.4);
  background: rgba(34, 197, 94, 0.12);
}
.detail-stock-chip.hard .stock-chip-dot {
  background: #22c55e;
  box-shadow: none;
}

/* Мягкий: янтарный желтый (Warning) */
.detail-stock-chip.soft {
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.12);
}
.detail-stock-chip.soft .stock-chip-dot {
  background: #f59e0b;
  box-shadow: none;
}

/* При 0 шт. - приглушённый вид */
.detail-stock-chip.zero {
  opacity: 0.45;
  color: var(--text-muted);
  border-color: var(--border);
  background: var(--glass-pill);
}
.detail-stock-chip.zero .stock-chip-dot {
  background: var(--text-dim);
  box-shadow: none;
}

.btn-secondary-block {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-light);
  background: var(--glass-pill);
  color: var(--text-main);
  font-size: var(--fs-label);
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: var(--shadow-sm);
  transition: all 0.22s var(--ease);
  font-family: var(--font);
}

.btn-secondary-block:hover {
  background: rgba(99, 102, 241, 0.14);
  border-color: var(--accent);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.22);
}

.btn-secondary-block:active {
  transform: var(--press-scale);
}

.btn-secondary-block:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

/* Telegram layout send button styling */
#dSheetPrintBtn.btn-secondary-block {
  background: rgba(14, 165, 233, 0.08);
  border-color: rgba(56, 189, 248, 0.3);
  color: #38bdf8;
}

#dSheetPrintBtn.btn-secondary-block:hover {
  background: rgba(14, 165, 233, 0.18);
  border-color: rgba(56, 189, 248, 0.55);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(14, 165, 233, 0.3);
}

.spin-icon {
  animation: spin 0.8s linear infinite;
}

@media (min-width: 768px) {
  .sheet-body {
    padding: 20px 24px 32px;
    gap: 16px;
  }

  .detail-header-card {
    flex-direction: column;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    gap: 12px;
  }

  .detail-hero-box {
    width: 100%;
    height: 240px;
    min-width: 100%;
    min-height: 240px;
    border-radius: var(--r-lg);
  }

  .detail-hero-cover {
    width: auto;
    max-height: 86%;
    object-fit: contain;
    border-radius: var(--r-sm);
  }

  .detail-info-box {
    align-items: center;
    text-align: center;
  }

  .detail-book-title {
    font-size: var(--fs-title);
    -webkit-line-clamp: 3;
  }
}

.book-sku-tag {
  display: inline-block;
  padding: 3px 8px;
  border-radius: var(--r-xs);
  background: var(--glass-pill);
  color: var(--text-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: var(--fs-meta);
  font-weight: 600;
  border: 1px solid var(--border);
  transition: all 0.2s var(--ease);
}

.book-sku-tag:hover {
  color: var(--text-main);
  border-color: var(--border-light);
  background: var(--glass-bg-hover);
}

/* ── Autocomplete Dropdown ─────────────────────────────────────── */
.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-card-solid);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-lg);
  border-radius: var(--r-md);
  margin-top: 8px;
  max-height: 220px;
  overflow-y: auto;
  z-index: 60;
  
  
}

.autocomplete-item {
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: all 0.16s var(--ease);
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item:hover {
  background: var(--glass-bg-hover);
}

.autocomplete-item-num {
  font-size: var(--fs-meta);
  font-weight: 700;
  color: var(--text-main);
  background: var(--glass-pill);
  padding: 2px 8px;
  border-radius: var(--r-xs);
  border: 1px solid var(--border);
}

.autocomplete-item-title {
  font-size: var(--fs-label);
  font-weight: 500;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

/* ── Act Composition Modal Components ──────────────────────────── */
.act-stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.act-stat-pill {
  padding: 8px 8px;
  border-radius: var(--r-md);
  background: var(--glass-card);
  
  
  border: 1px solid var(--border);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: all 0.25s var(--ease);
}

.act-stat-pill .val {
  font-size: var(--fs-title);
  font-weight: 700;
  color: var(--text-main);
  transition: all 0.25s var(--ease);
}

.act-stat-pill .lbl {
  font-size: var(--fs-meta);
  color: var(--text-muted);
  font-weight: 600;
}

/* Hover reveal on stat pills */
.act-stat-pill.hard:hover {
  border-color: var(--success-border-hover);
  background: var(--success-bg-hover);
  box-shadow: var(--success-glow);
}
.act-stat-pill.hard:hover .val {
  color: var(--success-light);
}

.act-stat-pill.soft:hover {
  border-color: var(--warning-border-hover);
  background: var(--warning-bg-hover);
  box-shadow: var(--warning-glow);
}
.act-stat-pill.soft:hover .val {
  color: var(--warning-light);
}

.act-printed-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--r-md);
  background: var(--glass-card);
  border: 1px solid var(--border);
  transition: all 0.25s var(--ease);
}

.act-printed-banner.printed:hover {
  background: var(--success-bg-hover);
  border-color: var(--success-border-hover);
  box-shadow: var(--success-glow);
}

.act-printed-banner.unprinted:hover {
  background: var(--warning-bg-hover);
  border-color: var(--warning-border-hover);
  box-shadow: var(--warning-glow);
}

.act-printed-banner .banner-icon {
  font-size: var(--fs-section);
}

.act-printed-banner .banner-text {
  display: flex;
  flex-direction: column;
}

.act-printed-banner .banner-text strong {
  font-size: var(--fs-label);
  color: var(--text-main);
}

.act-printed-banner .banner-text span {
  font-size: var(--fs-meta);
  color: var(--text-muted);
}

.act-books-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 8px 0 2px;
}

.act-books-header h4 {
  font-size: var(--fs-label);
  font-weight: 700;
  color: var(--text-main);
  
  
}

.act-books-count {
  font-size: var(--fs-meta);
  color: var(--text-muted);
  font-weight: 600;
}

.act-items-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 2px;
}

@media (min-width: 768px) {
  .act-items-list {
    max-height: 420px;
  }
}

.act-item-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: var(--glass-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  transition: all 0.2s var(--ease);
}

.act-item-card:hover {
  background: var(--glass-card-hover);
  border-color: var(--border-light);
  transform: translateY(-1px);
}

.act-item-thumb {
  width: 42px;
  height: 58px;
  border-radius: var(--r-xs);
  object-fit: cover;
  background: #111;
  flex-shrink: 0;
}

.act-item-info {
  flex: 1;
  min-width: 0;
}

.act-item-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}

.act-item-num {
  font-size: var(--fs-meta);
  font-weight: 700;
  color: #000;
  background: #fff;
  padding: 1px 8px;
  border-radius: var(--r-xs);
}

.act-item-cover-badge {
  font-size: var(--fs-meta);
  font-weight: 700;
  padding: 1px 8px;
  border-radius: var(--r-xs);
  background: var(--glass-pill);
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: all 0.2s var(--ease);
}

.act-item-card:hover .act-item-cover-badge.hard {
  background: var(--success-bg-hover);
  border-color: var(--success-border-hover);
  color: var(--success-light);
}

.act-item-card:hover .act-item-cover-badge.soft {
  background: var(--warning-bg-hover);
  border-color: var(--warning-border-hover);
  color: var(--warning-light);
}

.act-item-title {
  font-size: var(--fs-label);
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.act-item-meta {
  font-size: var(--fs-meta);
  color: var(--text-muted);
  display: flex;
  gap: 8px;
  margin-top: 2px;
}

.act-item-qty {
  font-size: var(--fs-label);
  font-weight: 700;
  color: var(--text-main);
  padding: 8px 8px;
  background: var(--glass-pill);
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.act-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.act-modal-secondary-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.act-secondary-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--glass-pill);
  color: var(--text-main);
  font-size: var(--fs-label);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  font-family: var(--font);
}

.act-secondary-btn:hover {
  background: var(--glass-bg-hover);
  border-color: var(--border-light);
  transform: translateY(-1px);
}

.act-secondary-btn:active {
  transform: var(--press-scale);
}

/* ══════════════════════════════════════════════════════════════════
   HOTKEYS CHEATSHEET MODAL STYLES (APPLE PRO ELEVATION)
   ══════════════════════════════════════════════════════════════════ */
.hotkeys-panel {
  max-width: 640px;
}

.hotkeys-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hotkeys-header-title svg {
  color: var(--text-muted);
}

.hotkeys-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  padding: 16px 20px 28px;
  overflow-y: auto;
}

@media (min-width: 600px) {
  .hotkeys-grid {
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }
}

.hotkey-section-title {
  font-size: var(--fs-meta);
  font-weight: 700;
  
  
  color: var(--text-muted);
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.hotkey-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
}

.hotkey-label {
  font-size: var(--fs-label);
  font-weight: 500;
  color: var(--text-main);
}

.hotkey-keys {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.hotkey-k {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  font-size: var(--fs-meta);
  font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--text-main);
  background: var(--glass-card);
  border: 1px solid var(--border-light);
  border-radius: var(--r-xs);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

[data-theme="light"] .hotkey-k {
  background: var(--bg-surface);
  border-color: var(--border-light);
  color: var(--text-main);
  box-shadow: 0 1px 3px rgba(60, 50, 40, 0.05);
}

.kbd-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  font-size: var(--fs-meta);
  font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  border-radius: var(--r-xs);
  margin-left: 8px;
  line-height: 1;
  vertical-align: middle;
}

[data-theme="light"] .kbd-badge {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.14);
  color: #475569;
}
