/* Касса — стили виджета и страницы. */

/* Индикатор «Касса» в сайдбаре — один кружок, показывающий комбинированное
 * состояние ККТ и POS-терминала эквайринга. Базовый .sidebar-badge — это
 * красный pill-счётчик чатбота (chatbot.css); здесь сбрасываем его в
 * маленькую цветную точку.
 *
 * В свёрнутом сайдбаре кружок позиционируется поверх правого-верхнего угла
 * иконки кассы (наследуем absolute-позиционирование от .sidebar-badge).
 * В развёрнутом — стоит справа от текста «Касса». */
#cashboxStatusBadge {
  /* остаёмся position: absolute от .sidebar-badge, но сбрасываем pill-стили */
  background: transparent !important;
  box-shadow: none !important;
  min-width: 0 !important;
  width: auto;
  height: auto;
  padding: 0;
  border-radius: 0;
  font-size: 14px;
  line-height: 1;
  color: #94a3b8;
  /* Чуть выше и правее, чтобы точка читалась поверх иконки */
  top: 4px;
  left: 26px;
}

.sidebar.expanded #cashboxStatusBadge {
  position: static;
  top: auto;
  left: auto;
  margin-left: auto;
  padding: 0 2px;
}

#cashboxStatusBadge[data-state="green"]   { color: #16a34a; }
#cashboxStatusBadge[data-state="yellow"]  { color: #d97706; }
#cashboxStatusBadge[data-state="orange"]  { color: #ea580c; }
#cashboxStatusBadge[data-state="red"]     { color: #dc2626; }
#cashboxStatusBadge[data-state="unknown"] { color: #94a3b8; }

/* ---------- страница /cashbox/ ---------- */

.cashbox-page {
  padding: 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.cashbox-page h1 {
  margin: 0 0 24px 0;
  font-size: 24px;
  font-weight: 600;
  color: #0f172a;
}

.cashbox-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.cashbox-card h2 {
  margin: 0 0 16px 0;
  font-size: 16px;
  font-weight: 600;
  color: #0f172a;
}

.cashbox-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.cashbox-toolbar select,
.cashbox-toolbar button {
  padding: 8px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s;
}

.cashbox-toolbar button:hover:not([disabled]) {
  background: #f1f5f9;
}

.cashbox-toolbar button[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.cashbox-toolbar button.primary {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}

.cashbox-toolbar button.primary:hover:not([disabled]) {
  background: #1d4ed8;
}

.cashbox-toolbar button.danger {
  background: #fff;
  color: #dc2626;
  border-color: #fecaca;
}

.cashbox-toolbar button.danger:hover:not([disabled]) {
  background: #fef2f2;
}

/* --- Шапка устройства (какая ККТ/терминал подключены) --------------- */
.cashbox-toolbar--device {
  margin-bottom: 12px;
}

.cashbox-device {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
}

.cashbox-device[hidden],
.cashbox-device__name[hidden],
.cashbox-device-select[hidden] {
  display: none;
}

.cashbox-device__name {
  white-space: nowrap;
}

.cashbox-device-select {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.cashbox-ghost-btn {
  margin-left: auto;
}

/* --- Ряд действий: логические группы кнопок с тонкими разделителями - */
.cashbox-toolbar--actions {
  gap: 10px;
}

.cashbox-btn-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.cashbox-btn-group + .cashbox-btn-group {
  padding-left: 10px;
  border-left: 1px solid #e2e8f0;
}

.cashbox-status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  font-size: 14px;
  color: #334155;
}

.cashbox-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.cashbox-dot[data-state="green"] { background: #16a34a; }
.cashbox-dot[data-state="yellow"] { background: #d97706; }
.cashbox-dot[data-state="orange"] { background: #ea580c; }
.cashbox-dot[data-state="red"] { background: #dc2626; }
.cashbox-dot[data-state="unknown"] { background: #cbd5e1; }

/* Маленький встраиваемый в строку спиннер. */
.cashbox-spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 6px;
  border: 2px solid #cbd5e1;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: cashboxSpin 0.8s linear infinite;
  vertical-align: -2px;
}
@keyframes cashboxSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.cashbox-empty,
.cashbox-loading {
  padding: 16px;
  color: #64748b;
  font-style: italic;
}

.cashbox-error {
  color: #dc2626;
  font-size: 13px;
}

.cashbox-logs {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.cashbox-logs th,
.cashbox-logs td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid #f1f5f9;
}

.cashbox-logs th {
  background: #f8fafc;
  font-weight: 600;
  color: #475569;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cashbox-outcome {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

.cashbox-outcome--ok { background: #dcfce7; color: #166534; }
.cashbox-outcome--fail { background: #fee2e2; color: #991b1b; }
.cashbox-outcome--pending { background: #fef9c3; color: #854d0e; }

/* ---------- индикатор фискального статуса в таблице транзакций ---------- */

.fiscal-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.fiscal-badge--registered { background: #dcfce7; color: #166534; }
.fiscal-badge--pending { background: #fef9c3; color: #854d0e; }
.fiscal-badge--failed { background: #fee2e2; color: #991b1b; }
.fiscal-badge--not_required { background: #f1f5f9; color: #64748b; }
.fiscal-badge--corrected { background: #e0e7ff; color: #3730a3; }

/* ---------- модалка приёма оплаты — шаги ---------- */

.payment-wizard {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.payment-wizard__steps {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.payment-wizard__step {
  flex: 1;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 13px;
  text-align: center;
  font-weight: 500;
}

.payment-wizard__step--active {
  background: #2563eb;
  color: #fff;
}

.payment-wizard__step--done {
  background: #16a34a;
  color: #fff;
}

.payment-method-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.payment-method-tile {
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px 12px;
  background: #fff;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.payment-method-tile:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}

.payment-method-tile--selected {
  border-color: #2563eb;
  background: #eff6ff;
}

.payment-method-tile__icon {
  font-size: 28px;
  line-height: 1;
}

.payment-method-tile__label {
  font-weight: 500;
  font-size: 14px;
  color: #0f172a;
}

.payment-method-tile__hint {
  font-size: 11px;
  color: #64748b;
}

.fiscal-progress {
  margin-top: 12px;
  padding: 12px;
  background: #f8fafc;
  border-radius: 8px;
  font-size: 13px;
  color: #334155;
  display: none;
}

.fiscal-progress--visible { display: block; }

.fiscal-progress__step {
  padding: 4px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.fiscal-progress__step--ok::before { content: '✓'; color: #16a34a; }
.fiscal-progress__step--fail::before { content: '✗'; color: #dc2626; }
.fiscal-progress__step--pending::before { content: '⏳'; }

/* ==================================================================
   Эквайринг: центральная модалка статуса оплаты картой
   ================================================================== */

.acq-runner__content {
  max-width: 480px;
  width: 92%;
  padding: 0;
  border-radius: 16px;
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.35);
  background: #ffffff;
  text-align: center;
  overflow: hidden;
  animation: acqRunnerAppear .22s ease-out;
}

@keyframes acqRunnerAppear {
  from { transform: translateY(12px) scale(.96); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}

.acq-runner__amount-block {
  padding: 26px 28px 18px;
  background: linear-gradient(135deg, #eff6ff 0%, #ffffff 100%);
  border-bottom: 1px solid #e2e8f0;
}

.acq-runner__amount-label {
  color: #64748b;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.acq-runner__amount {
  font-size: 38px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.1;
}

.acq-runner__method {
  margin-top: 6px;
  color: #64748b;
  font-size: 14px;
}

.acq-runner__status {
  padding: 32px 28px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.acq-runner__icon {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  transition: background-color .2s, color .2s;
}

.acq-runner__icon--waiting {
  background: #dbeafe;
  color: #2563eb;
  animation: acqRunnerPulse 1.4s ease-in-out infinite;
}

.acq-runner__icon--ok {
  background: #dcfce7;
  color: #16a34a;
  animation: none;
}

.acq-runner__icon--fail {
  background: #fee2e2;
  color: #dc2626;
  animation: none;
}

.acq-runner__icon--warn {
  background: #fef3c7;
  color: #d97706;
  animation: none;
}

@keyframes acqRunnerPulse {
  0%, 100% { transform: scale(1);     box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.35); }
  50%      { transform: scale(1.06);  box-shadow: 0 0 0 16px rgba(37, 99, 235, 0); }
}

.acq-runner__title {
  font-size: 20px;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 8px;
  line-height: 1.3;
}

.acq-runner__subtitle {
  color: #475569;
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 8px;
}

.acq-runner__details {
  display: none;
  margin-top: 6px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f8fafc;
  color: #475569;
  font-size: 13px;
  text-align: left;
  width: 100%;
  box-sizing: border-box;
}

.acq-runner__details:not(:empty) { display: block; }

.acq-runner__details code {
  font-size: 12px;
  background: #e2e8f0;
  padding: 1px 6px;
  border-radius: 4px;
  color: #1e293b;
}

.acq-runner__actions {
  padding: 18px 28px 26px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.acq-runner__actions:empty { padding: 0 28px 26px; }

.acq-runner__btn {
  appearance: none;
  border: none;
  border-radius: 10px;
  padding: 12px 18px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color .15s, transform .05s;
}

.acq-runner__btn:active { transform: translateY(1px); }

.acq-runner__btn--primary {
  background: #2563eb;
  color: #ffffff;
}
.acq-runner__btn--primary:hover { background: #1d4ed8; }

.acq-runner__btn--warn {
  background: #d97706;
  color: #ffffff;
}
.acq-runner__btn--warn:hover { background: #b45309; }

.acq-runner__btn--secondary {
  background: #f1f5f9;
  color: #334155;
}
.acq-runner__btn--secondary:hover { background: #e2e8f0; }

/* Карточка «Эквайринг-терминал» на дашборде кассы — детали последней операции */
.cashbox-acquiring-details {
  color: #64748b;
  font-size: 13px;
  padding-left: 22px; /* выравниваем под точкой статуса */
}
.cashbox-acquiring-details code {
  background: #e2e8f0;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12px;
  color: #1e293b;
}

.cashbox-dialog {
  border: none;
  border-radius: 12px;
  padding: 0;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
  max-width: 380px;
  width: 90%;
}
.cashbox-dialog::backdrop { background: rgba(15, 23, 42, 0.45); }
.cashbox-dialog__form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
}
.cashbox-dialog__form h3 { margin: 0; font-size: 16px; }
.cashbox-hint { color: #64748b; font-size: 13px; margin: 0; }
.cashbox-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: #334155;
}
.cashbox-field input,
.cashbox-field select {
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 15px;
}

/* Модалка чека коррекции — полей много, делаем её шире и прокручиваемой. */
.cashbox-correction-dialog { max-width: 480px; }
.cashbox-correction-dialog .cashbox-dialog__form {
  max-height: 85vh;
  overflow-y: auto;
}
.cashbox-corr-row {
  display: flex;
  gap: 12px;
}
.cashbox-corr-row .cashbox-field { flex: 1; }
.cashbox-dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}
.cashbox-dialog__actions button {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
}
.cashbox-dialog__actions button.primary {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}
.cashbox-dialog__actions button.primary:hover { background: #1d4ed8; }

.cashbox-pending-count {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  background: #fef3c7;
  color: #92400e;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
}
.cashbox-pending-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cashbox-pending-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #fde68a;
  background: #fffbeb;
  border-radius: 8px;
}
.cashbox-pending-info { flex: 1; }
.cashbox-pending-actions button.primary {
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid #2563eb;
  background: #2563eb;
  color: #fff;
  cursor: pointer;
  font-size: 13px;
}
.cashbox-pending-actions button.primary:hover { background: #1d4ed8; }
.cashbox-pending-actions button.primary:disabled { opacity: 0.6; cursor: wait; }

/* Текст-«ссылка» (использует <button>, чтобы оставаться доступным для клавиатуры) */
.cashbox-linklike {
  background: none;
  border: none;
  padding: 0;
  color: #2563eb;
  cursor: pointer;
  font-size: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.cashbox-linklike:hover:not([disabled]) { color: #1d4ed8; }
.cashbox-linklike[disabled] { color: #94a3b8; cursor: not-allowed; text-decoration: none; }

.cashbox-muted { color: #94a3b8; font-weight: 400; }

/* ---------- вкладки страницы /cashbox/ ---------- */

.cashbox-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 16px;
}

.cashbox-tab {
  padding: 10px 18px;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #64748b;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  border-radius: 6px 6px 0 0;
}

.cashbox-tab:hover {
  color: #0f172a;
  background: #f1f5f9;
}

.cashbox-tab--active {
  color: #2563eb;
  border-bottom-color: #2563eb;
  background: transparent;
}

.cashbox-tab-panel {
  display: none;
}

.cashbox-tab-panel--active {
  display: block;
}

/* ---------- фильтры журнала операций ---------- */

.cashbox-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 12px 0 16px 0;
  align-items: end;
}

.cashbox-filter {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cashbox-filter--wide {
  grid-column: span 2;
}

.cashbox-filter input,
.cashbox-filter select {
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
  color: #0f172a;
  text-transform: none;
  letter-spacing: normal;
}

.cashbox-filter input:focus,
.cashbox-filter select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.cashbox-filters__actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.cashbox-filters__actions button {
  padding: 8px 16px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}

.cashbox-filters__actions button.primary {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}

.cashbox-filters__actions button.primary:hover {
  background: #1d4ed8;
}

.cashbox-filters__actions button:not(.primary):hover {
  background: #f1f5f9;
}

/* ---------- сама таблица журнала ---------- */

.cashbox-journal-meta {
  margin: 4px 0 8px 0;
  font-size: 12px;
  color: #64748b;
}

.cashbox-journal-table-wrap {
  overflow-x: auto;
  border: 1px solid #f1f5f9;
  border-radius: 8px;
}

.cashbox-journal-table {
  min-width: 900px;
}

.cashbox-journal-row {
  cursor: pointer;
  transition: background 0.1s;
}

.cashbox-journal-row:hover {
  background: #f8fafc;
}

.cashbox-journal-row--open {
  background: #eff6ff;
}

.cashbox-journal-row--open:hover {
  background: #dbeafe;
}

.cashbox-journal-toggle {
  display: inline-block;
  color: #94a3b8;
  font-size: 11px;
  width: 12px;
}

/* Метка POS-терминала в колонке «Устройство»: визуально отличается от
 * ККТ — фиолетовая капля, чтобы кассир сразу различал источник
 * операции (фискалка vs эквайринг). */
.cashbox-journal-device--pos {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  background: #ede9fe;
  color: #5b21b6;
  font-size: 12px;
  font-weight: 500;
}

/* Блок «Эквайринг-сводка» внутри развёрнутой строки журнала. */
.cashbox-journal-raw__acq {
  margin-top: 12px;
  padding: 8px 10px;
  border-left: 3px solid #8b5cf6;
  background: #faf5ff;
  border-radius: 4px;
  font-size: 13px;
  line-height: 1.5;
}

.cashbox-journal-raw__acq .cashbox-journal-raw__title {
  margin-bottom: 4px;
  color: #5b21b6;
}

.cashbox-journal-raw > td {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  padding: 12px 16px;
}

.cashbox-journal-raw__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.cashbox-journal-raw__grid > div:last-child.cashbox-journal-raw__meta {
  grid-column: 1 / -1;
}

.cashbox-journal-raw__title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 12px;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cashbox-journal-raw__meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 6px 16px;
  font-size: 12px;
  color: #475569;
  padding: 8px 12px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.cashbox-journal-raw__meta code {
  font-size: 11px;
  background: #f1f5f9;
  padding: 1px 4px;
  border-radius: 4px;
}

.cashbox-json {
  background: #0f172a;
  color: #e2e8f0;
  padding: 12px;
  border-radius: 8px;
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  max-height: 420px;
  overflow: auto;
  white-space: pre;
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', 'Menlo', monospace;
}

/* ---------- пагинация ---------- */

.cashbox-pagination {
  display: flex;
  gap: 4px;
  justify-content: center;
  margin-top: 16px;
  flex-wrap: wrap;
}

.cashbox-pagination__btn {
  min-width: 36px;
  padding: 6px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  font-size: 13px;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s;
}

.cashbox-pagination__btn:hover:not([disabled]):not(.cashbox-pagination__btn--active) {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.cashbox-pagination__btn[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}

.cashbox-pagination__btn--active {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
  cursor: default;
}

.cashbox-pagination__ellipsis {
  padding: 6px 6px;
  color: #94a3b8;
  font-size: 13px;
  align-self: center;
}

@media (max-width: 720px) {
  .cashbox-journal-raw__grid {
    grid-template-columns: 1fr;
  }
  .cashbox-filter--wide {
    grid-column: span 1;
  }
}

/* ---------- неблокирующие уведомления кассы ---------- */
.cashbox-toast-stack {
  position: fixed;
  right: 24px;
  bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 10000;
  pointer-events: none;
}
.cashbox-toast {
  pointer-events: auto;
  min-width: 240px;
  max-width: 360px;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  color: #fff;
  background: #16a34a;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease;
}
.cashbox-toast--visible { opacity: 1; transform: translateY(0); }
.cashbox-toast--success { background: #16a34a; }
.cashbox-toast--error { background: #dc2626; }
.cashbox-toast--info { background: #2563eb; }

/* ---------- модалка закрытия смены (Z-отчёт + settlement + сверка) ---------- */
.cashbox-close-dialog {
  max-width: 720px;
  width: 94%;
}
.cashbox-close-dialog__inner {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
}
.cashbox-close-dialog__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.cashbox-close-dialog__header h3 { margin: 0; font-size: 17px; }
.cashbox-close-dialog__x {
  border: none;
  background: none;
  font-size: 24px;
  line-height: 1;
  color: #94a3b8;
  cursor: pointer;
  padding: 0 4px;
}
.cashbox-close-dialog__x:hover { color: #475569; }

.cashbox-close-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cashbox-close-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
}
.cashbox-close-step__icon {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #cbd5e1;
  position: relative;
}
.cashbox-close-step__icon[data-state="running"] {
  border-color: #2563eb;
  border-top-color: transparent;
  animation: cashbox-spin 0.7s linear infinite;
}
.cashbox-close-step__icon[data-state="ok"] {
  border-color: #16a34a;
  background: #16a34a;
}
.cashbox-close-step__icon[data-state="ok"]::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 1px;
  width: 4px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.cashbox-close-step__icon[data-state="fail"] {
  border-color: #dc2626;
  background: #dc2626;
}
.cashbox-close-step__icon[data-state="fail"]::after {
  content: '\00d7';
  position: absolute;
  left: 2px;
  top: -4px;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}
.cashbox-close-step__icon[data-state="skip"] {
  border-style: dashed;
  border-color: #cbd5e1;
}
.cashbox-close-step__body { flex: 1; min-width: 0; }
.cashbox-close-step__title { font-size: 14px; font-weight: 600; color: #1e293b; }
.cashbox-close-step__hint { font-size: 12px; color: #94a3b8; }
.cashbox-close-step__status { font-size: 13px; color: #475569; text-align: right; max-width: 280px; }
.cashbox-close-step__retry {
  flex: 0 0 auto;
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid #2563eb;
  background: #fff;
  color: #2563eb;
  cursor: pointer;
  font-size: 12px;
}
.cashbox-close-step__retry:hover:not([disabled]) { background: #eff6ff; }

.cashbox-close-recon {
  border-top: 1px solid #e2e8f0;
  padding-top: 12px;
  max-height: 50vh;
  overflow-y: auto;
}
.cashbox-close-dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.cashbox-close-dialog__actions button {
  padding: 9px 18px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #334155;
  cursor: pointer;
  font-size: 14px;
}
.cashbox-close-dialog__actions button:hover:not([disabled]) { background: #f1f5f9; }
.cashbox-close-dialog__actions .primary {
  border: 1px solid #2563eb;
  background: #2563eb;
  color: #fff;
}
.cashbox-close-dialog__actions .primary:hover:not([disabled]) { background: #1d4ed8; }
.cashbox-close-dialog__actions .cashbox-btn-danger {
  border-color: #dc2626;
  background: #dc2626;
}
.cashbox-close-dialog__actions .cashbox-btn-danger:hover:not([disabled]) { background: #b91c1c; }
.cashbox-close-dialog__actions button:disabled { opacity: 0.5; cursor: not-allowed; }

@keyframes cashbox-spin { to { transform: rotate(360deg); } }

/* блок сверки эквайринга (три источника + settlement) */
.cashbox-acq-recon {
  margin-top: 14px;
  border-top: 1px dashed #e2e8f0;
  padding-top: 12px;
}
.cashbox-acq-recon__title { margin: 0 0 8px; font-size: 14px; color: #334155; }
.cashbox-acq-recon__pos-wrap {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
}
.cashbox-acq-recon__pos-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #475569;
  margin-bottom: 8px;
}
.cashbox-acq-recon__answer { font-size: 13px; color: #334155; margin-top: 6px; }
.cashbox-acq-recon__raw { margin-top: 8px; }
.cashbox-acq-recon__raw summary { cursor: pointer; font-size: 12px; color: #2563eb; }
.cashbox-acq-recon__raw pre {
  margin: 6px 0 0;
  padding: 10px;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 8px;
  font-size: 11px;
  overflow-x: auto;
  max-height: 240px;
}

.cashbox-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.cashbox-pill--ok { background: #dcfce7; color: #166534; }
.cashbox-pill--fail { background: #fee2e2; color: #991b1b; }

/* ---------- вкладка «Инструкция» ---------- */

.cashbox-guide-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.cashbox-guide-print-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  flex: 0 0 auto;
  padding: 10px 18px;
  border: none;
  border-radius: 8px;
  background: #2563eb;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.25);
  transition: background 0.15s, box-shadow 0.15s, transform 0.05s;
}
.cashbox-guide-print-btn:hover {
  background: #1d4ed8;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.35);
}
.cashbox-guide-print-btn:active {
  transform: translateY(1px);
}
.cashbox-guide-print-btn svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.cashbox-guide {
  color: #1e293b;
  line-height: 1.55;
  font-size: 14px;
}

.cashbox-guide__head h1 {
  font-size: 22px;
  margin: 0 0 6px;
  color: #0f172a;
}

.cashbox-guide__sub {
  color: #475569;
  margin: 0 0 8px;
  max-width: 760px;
}

.cashbox-guide__toc {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 16px;
  margin: 16px 0 24px;
}

.cashbox-guide__toc strong {
  display: block;
  margin-bottom: 6px;
  color: #0f172a;
}

.cashbox-guide__toc ol {
  margin: 0;
  padding-left: 20px;
  columns: 2;
  column-gap: 32px;
}

.cashbox-guide__toc a {
  color: #2563eb;
  text-decoration: none;
}
.cashbox-guide__toc a:hover { text-decoration: underline; }

.cashbox-guide__section {
  margin: 0 0 28px;
  scroll-margin-top: 16px;
}

.cashbox-guide__section h2 {
  font-size: 17px;
  color: #0f172a;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 6px;
  margin: 0 0 12px;
}

.cashbox-guide__section ul {
  margin: 8px 0;
  padding-left: 22px;
}
.cashbox-guide__section li { margin: 4px 0; }

.cashbox-guide__callout {
  background: #eff6ff;
  border-left: 4px solid #2563eb;
  border-radius: 0 8px 8px 0;
  padding: 10px 14px;
  margin: 12px 0;
  font-size: 13.5px;
}

.cashbox-guide__indicators {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 10px 0;
  font-size: 13px;
}
.cashbox-guide__ind {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.cashbox-guide__dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex: 0 0 auto;
}
.cashbox-guide__dot[data-c="green"]  { background: #16a34a; }
.cashbox-guide__dot[data-c="yellow"] { background: #d97706; }
.cashbox-guide__dot[data-c="orange"] { background: #ea580c; }
.cashbox-guide__dot[data-c="red"]    { background: #dc2626; }

.cashbox-guide__legend-title {
  margin: 10px 0 4px;
}

.cashbox-guide__table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 13.5px;
}
.cashbox-guide__table th,
.cashbox-guide__table td {
  border: 1px solid #e2e8f0;
  padding: 8px 12px;
  text-align: left;
  vertical-align: top;
}
.cashbox-guide__table th {
  background: #f1f5f9;
  color: #0f172a;
  font-weight: 600;
}

.cashbox-guide__receipt {
  margin: 14px 0;
  max-width: 460px;
}
.cashbox-guide__receipt figcaption {
  font-size: 12.5px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 4px;
}
.cashbox-guide__receipt pre {
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 8px;
  padding: 14px 16px;
  margin: 0;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre;
  overflow-x: auto;
}

.cashbox-guide code {
  background: #f1f5f9;
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 12.5px;
}

.cashbox-guide__foot {
  margin-top: 24px;
  border-top: 1px solid #e2e8f0;
  padding-top: 12px;
}
