/* ============================================================================
   receipts-theme.css — редизайн страницы «Чеки» в стиле модуля «Здоровье».
   Сине-зелёная палитра, белые карточки, толстые заголовки, зелёные кнопки.

   ВСЁ скоуплено под:
     .receipts-themed         — обёртка контента страницы (router.js)
     #modal-receiptDetail / #modal-cardSearch / #modal-addReceipt /
     #modal-receiptScanner    — модалки чеков
   Глобальные стили приложения НЕ затрагиваются.
   ========================================================================== */

.receipts-themed {
  --rcv-grad:   linear-gradient(135deg, #059669 0%, #047857 100%);
  --rcv-green:  #059669;
  --rcv-green-d:#047857;
  --rcv-green-bg: rgba(5,150,105,.07);
  --rcv-green-bg-h: rgba(5,150,105,.13);
  --rcv-teal:   #0f766e;
  --rcv-rose:   #e11d48;
  --rcv-rose-bg: rgba(225,29,72,.07);
  --rcv-font:   'Outfit', 'Onest', -apple-system, sans-serif;
  --rcv-radius: 14px;
  --rcv-shadow: 0 4px 24px -8px rgba(15,23,42,.10), 0 1px 3px rgba(15,23,42,.04);
  --rcv-shadow-h: 0 8px 30px -8px rgba(5,150,105,.22), 0 2px 6px rgba(15,23,42,.06);
  font-family: var(--rcv-font);
}

/* ── Заголовок страницы ─────────────────────────────────────────────────── */
.receipts-themed .pt {
  font-family: var(--rcv-font);
  font-weight: 700;
  letter-spacing: -.3px;
  color: #0f172a;
}
.receipts-themed .ps {
  font-family: var(--rcv-font);
  font-weight: 500;
  color: #64748b;
}

/* ── Кнопки в шапке ─────────────────────────────────────────────────────── */
.receipts-themed .btn {
  font-family: var(--rcv-font);
  font-weight: 600;
  border-radius: 10px;
  transition: transform .18s, box-shadow .18s, background .15s, border-color .15s;
}
.receipts-themed .btn-primary {
  background: var(--rcv-grad);
  border: none;
  color: #fff;
  box-shadow: 0 4px 12px rgba(5,150,105,.25);
}
.receipts-themed .btn-primary:hover {
  background: var(--rcv-grad);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(5,150,105,.32);
}
.receipts-themed .btn-ghost {
  background: #fff;
  border: 1px solid rgba(15,23,42,.12);
  color: #0f172a;
}
.receipts-themed .btn-ghost:hover {
  background: #f0fdf9;
  border-color: rgba(5,150,105,.35);
  color: var(--rcv-green-d);
}

/* ── Заголовок-разделитель дня ──────────────────────────────────────────── */
.receipts-themed .receipt-day {
  font-family: var(--rcv-font);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--rcv-teal);
  margin: 22px 0 12px;
  padding: 0 2px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.receipts-themed .receipt-day::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(5,150,105,.18), rgba(5,150,105,0));
}
.receipts-themed .receipt-day:first-child { margin-top: 4px; }

/* ── Карточка чека ──────────────────────────────────────────────────────── */
.receipts-themed .receipt-item {
  position: relative;
  background: #fff;
  border: 1px solid rgba(15,23,42,.07);
  border-radius: var(--rcv-radius);
  padding: 16px 18px 16px 22px;
  margin-bottom: 12px;
  cursor: pointer;
  box-shadow: var(--rcv-shadow);
  transition: transform .18s cubic-bezier(.4,0,.2,1), box-shadow .18s, border-color .18s;
  overflow: hidden;
}
/* Цветная полоса слева (акцент по магазину задаётся inline-переменной --rcv-bar) */
.receipts-themed .receipt-item::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--rcv-bar, var(--rcv-grad));
}
/* Лёгкий зелёный градиент-блик сверху, как в карточках медицины */
.receipts-themed .receipt-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(5,150,105,.035) 0%, rgba(255,255,255,0) 55%);
  pointer-events: none;
}
.receipts-themed .receipt-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--rcv-shadow-h);
  border-color: rgba(5,150,105,.22);
}

.receipts-themed .receipt-store {
  font-family: var(--rcv-font);
  font-weight: 700;
  font-size: 14.5px;
  color: #0f172a;
  letter-spacing: -.2px;
}
.receipts-themed .receipt-meta {
  font-family: var(--rcv-font);
  font-size: 12px;
  font-weight: 500;
  color: #94a3b8;
  margin-top: 1px;
}
.receipts-themed .receipt-total {
  font-family: var(--rcv-font);
  font-size: 16px;
  font-weight: 700;
  color: var(--rcv-green-d);
  letter-spacing: -.3px;
  white-space: nowrap;
  margin-right: 30px;
}

/* ── Чипы-позиции ───────────────────────────────────────────────────────── */
.receipts-themed .receipt-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
.receipts-themed .receipt-tag {
  font-family: var(--rcv-font);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--rcv-green-d);
  background: var(--rcv-green-bg);
  border: 1px solid rgba(5,150,105,.16);
  border-radius: 20px;
  padding: 3px 11px;
  transition: background .15s;
}
.receipts-themed .receipt-item:hover .receipt-tag {
  background: var(--rcv-green-bg-h);
}

/* ── Кнопка удаления ────────────────────────────────────────────────────── */
.receipts-themed .receipt-del {
  position: absolute;
  top: 12px; right: 12px;
  z-index: 2;
  background: rgba(15,23,42,.04);
  border: none;
  cursor: pointer;
  color: #94a3b8;
  font-size: 15px;
  width: 24px; height: 24px;
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s;
}
.receipts-themed .receipt-del:hover {
  background: var(--rcv-rose-bg);
  color: var(--rcv-rose);
}

/* ── Пустое состояние / загрузка ────────────────────────────────────────── */
.receipts-themed .loading .spinner {
  border-top-color: var(--rcv-green);
}

/* ============================================================================
   МОДАЛКИ ЧЕКОВ — тот же язык, что у модалок медицины
   ========================================================================== */
#modal-receiptDetail .modal,
#modal-cardSearch .modal,
#modal-addReceipt .modal,
#modal-receiptScanner .modal {
  border-radius: 18px;
  border: 1px solid rgba(15,23,42,.08);
  box-shadow: 0 24px 60px -12px rgba(15,23,42,.28), 0 8px 24px rgba(15,23,42,.12);
  overflow: hidden;
}

/* Шапка модалки с лёгким зелёным градиентом */
#modal-receiptDetail .modal-hdr,
#modal-cardSearch .modal-hdr,
#modal-addReceipt .modal-hdr,
#modal-receiptScanner .modal-hdr {
  background: linear-gradient(135deg, rgba(5,150,105,.05) 0%, rgba(255,255,255,0) 60%);
  border-bottom: 1px solid rgba(15,23,42,.06);
}
#modal-receiptDetail .modal-title,
#modal-cardSearch .modal-title,
#modal-addReceipt .modal-title,
#modal-receiptScanner .modal-title {
  font-family: var(--med-font, 'Outfit', sans-serif);
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -.2px;
}
#modal-receiptDetail .modal-title::before { content: '🧾'; font-size: 15px; margin-right: 7px; }
#modal-cardSearch .modal-title::before    { content: '🔍'; font-size: 15px; margin-right: 7px; }
#modal-addReceipt .modal-title::before    { content: '➕'; font-size: 14px; margin-right: 7px; }
#modal-receiptScanner .modal-title::before{ content: '📷'; font-size: 15px; margin-right: 7px; }

/* Кнопка закрытия */
#modal-receiptDetail .modal-close:hover,
#modal-cardSearch .modal-close:hover,
#modal-addReceipt .modal-close:hover,
#modal-receiptScanner .modal-close:hover {
  background: rgba(225,29,72,.08);
  color: #e11d48;
}

/* Подвал модалки + кнопки */
/* Outfit на ВСЕ кнопки/тексты внутри модалок чеков (перекрывает глобальный Onest) */
#modal-receiptDetail .btn,
#modal-cardSearch .btn,
#modal-addReceipt .btn,
#modal-receiptScanner .btn,
#modal-receiptDetail .modal-foot button,
#modal-addReceipt .modal-foot button {
  font-family: 'Outfit', sans-serif !important;
  font-weight: 600;
}

#modal-receiptDetail .modal-foot,
#modal-cardSearch .modal-foot,
#modal-addReceipt .modal-foot,
#modal-receiptScanner .modal-foot {
  border-top: 1px solid rgba(15,23,42,.06);
  background: rgba(248,250,252,.7);
}
#modal-receiptDetail .modal-foot .btn-primary,
#modal-addReceipt .modal-foot .btn-primary,
#modal-receiptScanner .modal-body .btn-primary {
  background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
  border: none !important;
  color: #fff !important;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(5,150,105,.25);
  transition: transform .18s, box-shadow .18s;
}
#modal-receiptDetail .modal-foot .btn-primary:hover,
#modal-addReceipt .modal-foot .btn-primary:hover,
#modal-receiptScanner .modal-body .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(5,150,105,.32);
}
#modal-receiptDetail .modal-foot .btn-ghost,
#modal-addReceipt .modal-foot .btn-ghost {
  background: #fff !important;
  border: 1px solid rgba(15,23,42,.12) !important;
  color: #0f172a !important;
  font-family: 'Outfit', sans-serif;
  border-radius: 10px;
}
#modal-receiptDetail .modal-foot .btn-ghost:hover,
#modal-addReceipt .modal-foot .btn-ghost:hover {
  background: #f8fafc !important;
  border-color: rgba(5,150,105,.3) !important;
}

/* Инпуты фокус — зелёный */
#modal-addReceipt input:focus,
#modal-cardSearch input:focus,
#modal-receiptScanner input:focus {
  border-color: #059669 !important;
  box-shadow: 0 0 0 3px rgba(5,150,105,.12) !important;
  outline: none;
}

/* ── Разбор чека (rasdrop) внутри modal-receiptDetail ───────────────────── */
#modal-receiptDetail .rasdrop {
  border: 1px solid rgba(15,23,42,.08);
  border-radius: 12px;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
#modal-receiptDetail .rasdrop:hover {
  border-color: rgba(5,150,105,.25);
  box-shadow: 0 2px 10px -4px rgba(5,150,105,.2);
}
#modal-receiptDetail .rasdrop-name {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  color: #0f172a;
}
#modal-receiptDetail .rasdrop-price {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  color: var(--rcv-green-d, #047857);
}
#modal-receiptDetail .ras-link-btn {
  background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
  border: none !important;
  color: #fff !important;
  font-weight: 600;
}
#modal-receiptDetail .ras-link-btn:hover { filter: brightness(1.05); }

/* Поиск товара — строки */
#modal-cardSearch .card-search-item:hover {
  background: var(--rcv-green-bg, rgba(5,150,105,.07)) !important;
}

/* ── Карточка чека на мобиле ────────────────────────────────────────────── */
@media (max-width: 768px) {
  .receipts-themed .receipt-item { padding: 14px 16px 14px 20px; }
  .receipts-themed .receipt-total { font-size: 15px; }
}
