/* ============================================
   BanketPro — Переиспользуемые компоненты
   Современный унифицированный дизайн
   ============================================ */

/* === СТАТУСНЫЕ БЕЙДЖИ === */
/* Единая система бейджей для всех статусов в приложении */

/* Базовый стиль бейджа */
.badge-status,
.status-badge {
  padding: 0.4em 0.85em;
  border-radius: 8px;
  font-size: 0.75em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  transition: all 0.2s ease;
  white-space: nowrap;
}

/* Статус: Подтверждено / Успех */
.badge-status.confirmed,
.status-badge.status-confirmed,
.badge.bg-status-confirmed {
  background: var(--color-success-bg, #f0fdf4);
  color: var(--color-success-hover, #15803d);
  border-color: var(--color-success-light, #bbf7d0);
}

/* Статус: В работе / Ожидание */
.badge-status.in-progress,
.status-badge.status-in_progress,
.badge.bg-status-in_progress {
  background: var(--color-warning-bg, #fff7ed);
  color: var(--color-warning-hover, #c2410c);
  border-color: var(--color-warning-light, #fdba74);
}

/* Статус: Просрочено */
.badge-status.overdue,
.status-badge.status-overdue,
.badge.bg-status-overdue {
  background: var(--color-danger-bg, #fee2e2);
  color: var(--color-danger-hover, #b91c1c);
  border-color: var(--color-danger-light, #fecdd3);
}

/* Статус: Отменено */
.badge-status.canceled,
.status-badge.status-canceled,
.badge.bg-status-canceled {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fecaca;
}

/* Статус: Завершено */
.badge-status.done,
.status-badge.status-done,
.badge.bg-status-done {
  background: #f8fafc;
  color: #6b7280;
  border-color: #e2e8f0;
}

/* Статус: Новый / По умолчанию */
.badge-status.new,
.status-badge.status-new {
  background: var(--color-info-bg, #dbeafe);
  color: var(--color-info-hover, #1d4ed8);
  border-color: var(--color-info-light, #93c5fd);
}

/* === БЕЙДЖИ СЛОТОВ ВРЕМЕНИ === */
.badge-slot {
  padding: 0.3em 0.65em;
  border-radius: 999px;
  font-size: 0.8em;
  font-weight: 600;
  border: 1px solid transparent;
}

.badge-slot.slot-am,
.badge-slot-am {
  background: #dbeafe;
  color: #1d4ed8;
  border-color: #93c5fd;
}

.badge-slot.slot-pm,
.badge-slot-pm {
  background: #d1fae5;
  color: #047857;
  border-color: #6ee7b7;
}

.badge-slot.slot-fd,
.badge-slot-fd {
  background: #fef3c7;
  color: #92400e;
  border-color: #fcd34d;
}

/* === БЕЙДЖИ ИСТОЧНИКОВ === */
.badge-source {
  padding: 0.25em 0.6em;
  border-radius: 6px;
  font-size: 0.8em;
  font-weight: 500;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

.badge-source.source-yandex {
  background: #fef3c7;
  color: #92400e;
  border-color: #fcd34d;
}

.badge-source.source-2gis {
  background: #d1fae5;
  color: #047857;
  border-color: #6ee7b7;
}

.badge-source.source-site {
  background: #dbeafe;
  color: #1d4ed8;
  border-color: #93c5fd;
}

.badge-source.source-ref {
  background: #ede9fe;
  color: #6d28d9;
  border-color: #c4b5fd;
}

/* === БЕЙДЖИ КАТЕГОРИЙ СОТРУДНИКОВ === */
.badge-category {
  padding: 0.3em 0.65em;
  border-radius: 999px;
  font-size: 0.8em;
  font-weight: 600;
}

.badge-category.category-kitchen {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
}

.badge-category.category-service {
  background: #cffafe;
  color: #0e7490;
  border: 1px solid #67e8f9;
}

.badge-category.category-management {
  background: #ede9fe;
  color: #6d28d9;
  border: 1px solid #c4b5fd;
}

/* === БЕЙДЖИ ТИПОВ ОПЛАТЫ === */
.badge-payment {
  padding: 0.2em 0.5em;
  border-radius: 6px;
  font-size: 0.75em;
  font-weight: 600;
}

.badge-payment.payment-prepayment {
  background: #dbeafe;
  color: #1d4ed8;
}

.badge-payment.payment-final {
  background: #d1fae5;
  color: #047857;
}

.badge-payment.payment-other {
  background: #f1f5f9;
  color: #475569;
}


/* === ГРУППЫ КНОПОК ДЕЙСТВИЙ === */
/* Используются в таблицах для Редактировать/Удалить */
.btn-action-group {
  display: inline-flex;
  gap: 0;
}

.btn-action-group .btn {
  margin: 0;
  border-radius: 0;
  border-left-width: 0;
}

.btn-action-group .btn:first-child {
  border-top-left-radius: var(--radius-sm);
  border-bottom-left-radius: var(--radius-sm);
  border-left-width: 1px;
}

.btn-action-group .btn:last-child {
  border-top-right-radius: var(--radius-sm);
  border-bottom-right-radius: var(--radius-sm);
}

.btn-icon {
  padding: 0.25rem 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
}

/* === ПУСТЫЕ СОСТОЯНИЯ === */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--color-muted);
}

.empty-state-icon {
  font-size: 3rem;
  opacity: 0.5;
  margin-bottom: 1rem;
  display: block;
}

.empty-state-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--color-ink);
}

.empty-state-text {
  color: var(--color-muted);
  margin-bottom: 1.5rem;
}

/* === ПОИСКОВАЯ ПАНЕЛЬ === */
.search-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.search-panel:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(79, 70, 229, 0.12);
}

/* === АВАТАРЫ/ИНИЦИАЛЫ === */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--gradient-primary);
  color: white;
  font-weight: 600;
  flex-shrink: 0;
}

.avatar-sm {
  width: 32px;
  height: 32px;
  font-size: 0.875rem;
}

.avatar-md {
  width: 40px;
  height: 40px;
  font-size: 1rem;
}

.avatar-lg {
  width: 56px;
  height: 56px;
  font-size: 1.25rem;
}

/* === ТЕГИ/ЧИПЫ === */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 500;
  background: var(--color-light);
  color: var(--color-ink);
  border: 1px solid var(--color-border);
  transition: all 0.2s ease;
}

.chip:hover {
  background: var(--color-primary-light);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.chip-removable {
  cursor: pointer;
}

.chip-remove {
  margin-left: 0.25rem;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

.chip-remove:hover {
  opacity: 1;
}

/* === ЗАГРУЗЧИК/СПИННЕР === */
.spinner {
  display: inline-block;
  width: 1.5rem;
  height: 1.5rem;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.spinner-sm {
  width: 1rem;
  height: 1rem;
  border-width: 2px;
}

.spinner-lg {
  width: 2.5rem;
  height: 2.5rem;
  border-width: 4px;
}

/* === РАЗДЕЛИТЕЛИ === */
.divider {
  height: 1px;
  background: var(--color-border);
  margin: 1.5rem 0;
}

.divider-vertical {
  width: 1px;
  background: var(--color-border);
  margin: 0 1rem;
  align-self: stretch;
}

/* === ВСПЛЫВАЮЩИЕ ПОДСКАЗКИ === */
.tooltip-custom {
  position: relative;
  display: inline-block;
}

.tooltip-custom::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-0.5rem);
  padding: 0.5rem 0.75rem;
  background: var(--color-dark);
  color: white;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.tooltip-custom:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(-0.25rem);
}

/* === МЕТРИКИ/СТАТИСТИКА — Современный стиль === */
.metric-box {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.5rem;
  background: white;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 16px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.metric-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(135deg, var(--color-primary, #4f46e5) 0%, #2563eb 100%);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.metric-box:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(79, 70, 229, 0.12);
}

.metric-box:hover::before {
  opacity: 1;
}

.metric-label {
  font-size: 0.8rem;
  color: var(--color-muted, #6b7280);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.metric-value {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--color-ink, #0f172a);
  line-height: 1;
  letter-spacing: -0.02em;
}

.metric-trend {
  font-size: 0.875rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.metric-trend.up {
  color: var(--color-success, #10b981);
}

.metric-trend.down {
  color: var(--color-danger, #ef4444);
}

/* Иконка метрики */
.metric-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  font-size: 1.25rem;
  background: linear-gradient(135deg, var(--color-primary, #4f46e5) 0%, #2563eb 100%);
  color: white;
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.3);
}


/* === BOOTSTRAP SUBTLE BADGE HELPERS === */
/* Для совместимости с Bootstrap 5.3+ */

.bg-success-subtle {
  background-color: #d1fae5 !important;
}

.bg-danger-subtle {
  background-color: #fee2e2 !important;
}

.bg-warning-subtle {
  background-color: #fef3c7 !important;
}

.bg-info-subtle {
  background-color: #dbeafe !important;
}

.bg-secondary-subtle {
  background-color: #f1f5f9 !important;
}

.bg-primary-subtle {
  background-color: #eef2ff !important;
}

/* Бейдж "В работе" */
.badge-in-progress {
  background-color: #dbeafe !important;
  color: #1d4ed8 !important;
}

/* Текстовые цвета для subtle бейджей */
.text-success-emphasis { color: #047857 !important; }
.text-danger-emphasis { color: #b91c1c !important; }
.text-warning-emphasis { color: #92400e !important; }
.text-info-emphasis { color: #1d4ed8 !important; }
.text-secondary-emphasis { color: #475569 !important; }
.text-primary-emphasis { color: #4f46e5 !important; }

/* === TABLE TEXT VISIBILITY === */
/* Исправление видимости текста в таблицах */

.table .text-muted {
  color: #64748b !important;
}

.table .text-body {
  color: #1f2937 !important;
}

/* Бейджи в таблицах должны быть видимыми */
.table .badge.bg-light {
  background-color: #f1f5f9 !important;
  color: #334155 !important;
  border: 1px solid #e2e8f0 !important;
}

