/* ==========================================================================
   ИТ-Диспетчер - Единая дизайн-система (DANA Medical Purple Theme)
   Точное соответствие цветовой гамме, геометрии и элементам референса
   ========================================================================== */

:root {
  --sidebar-width: 240px;
  --sidebar-collapsed-width: 68px;
  --topbar-height: 54px;
  --subheader-height: 44px;

  /* Точные цвета из приложенного образца */
  --sidebar-bg: #493ba4;
  --sidebar-header-bg: #493ba4;
  --sidebar-text: #e8e4f8;
  --sidebar-text-muted: #b3a8e9;
  --sidebar-active-bg: rgba(255, 255, 255, 0.18);
  --sidebar-active-border: rgba(255, 255, 255, 0.22);
  --sidebar-hover-bg: rgba(255, 255, 255, 0.10);

  --topbar-bg: #261a5b;
  --topbar-text: #b9b1e5;
  --topbar-text-hover: #ffffff;
  --topbar-active: #ffffff;

  --body-bg: #f4f6fa;
  --card-bg: #ffffff;
  --border-color: #e5e9f2;

  --primary-blue: #3b82f6;
  --primary-blue-hover: #2563eb;
  --avatar-green: #22c55e;

  /* Палитра статусов (Легенда статусов из образца) */
  --status-planned-bg: #fef3c7;
  --status-planned-border: #fde68a;
  --status-planned-text: #92400e;

  --status-confirmed-bg: #ecfccb;
  --status-confirmed-border: #d9f99d;
  --status-confirmed-text: #3f6212;

  --status-progress-bg: #d1fae5;
  --status-progress-border: #a7f3d0;
  --status-progress-text: #065f46;

  --status-completed-bg: #a7f3d0;
  --status-completed-border: #6ee7b7;
  --status-completed-text: #047857;

  --status-frozen-bg: #ede9fe;
  --status-frozen-border: #ddd6fe;
  --status-frozen-text: #5b21b6;

  --status-cancelled-bg: #fee2e2;
  --status-cancelled-border: #fecaca;
  --status-cancelled-text: #991b1b;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Базовые стили */
html {
  font-size: 14px;
  position: relative;
  min-height: 100%;
}

@media (min-width: 768px) {
  html {
    font-size: 14.5px;
  }
}

body {
  background-color: var(--body-bg);
  color: #334155;
  font-family: var(--font-sans);
  overflow-x: hidden;
  min-height: 100vh;
  margin: 0;
}

.bg-dana {
  background-color: var(--body-bg) !important;
}

/* Общий контейнер приложения */
.app-wrapper {
  display: flex;
  min-height: 100vh;
  width: 100%;
  background-color: var(--body-bg);
  position: relative;
}

/* ==========================================================================
   ЛЕВЫЙ ВЕРТИКАЛЬНЫЙ САЙДБАР (DANA ROYAL PURPLE)
   ========================================================================== */

.app-sidebar {
  width: var(--sidebar-width);
  background-color: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  height: 100vh;
  z-index: 1040;
  flex-shrink: 0;
  user-select: none;
  overflow: hidden;
  transition: width 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
}

.sidebar-scrollbar::-webkit-scrollbar {
  width: 4px;
}
.sidebar-scrollbar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 4px;
}
.sidebar-scrollbar::-webkit-scrollbar-track {
  background: transparent;
}

/* Шапка сайдбара / Логотип (DANA Medical) */
.sidebar-header {
  height: var(--topbar-height);
  padding: 0 1.15rem;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  color: #ffffff;
  text-decoration: none;
  overflow: hidden;
}

.sidebar-logo-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.16);
  padding: 2px;
  overflow: hidden;
}

.sidebar-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.sidebar-logo-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: #ffffff;
  line-height: 1.15;
  white-space: nowrap;
}

/* Разделы меню */
.sidebar-nav-content {
  flex-grow: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.65rem 0.5rem;
}

.sidebar-category {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--sidebar-text-muted);
  font-weight: 700;
  padding: 0.85rem 0.75rem 0.35rem 0.75rem;
  white-space: nowrap;
}

/* Элемент навигации сайдбара */
.sidebar-nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.75rem;
  margin-bottom: 0.15rem;
  color: var(--sidebar-text);
  font-size: 0.84rem;
  font-weight: 500;
  border-radius: 10px;
  text-decoration: none;
  transition: all 0.15s ease;
  position: relative;
  white-space: nowrap;
}

.sidebar-nav-link-content {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  overflow: hidden;
}

.sidebar-nav-link i {
  font-size: 1.05rem;
  flex-shrink: 0;
  width: 20px;
  text-align: center;
  color: #d6d0f6;
  transition: color 0.15s ease;
}

.sidebar-nav-link:hover {
  color: #ffffff;
  background: var(--sidebar-hover-bg);
}

.sidebar-nav-link:hover i {
  color: #ffffff;
}

/* Активное состояние - как в образце (полупрозрачная светлая плашка со скруглением) */
.sidebar-nav-link.active {
  color: #ffffff;
  background: var(--sidebar-active-bg);
  border: 1px solid var(--sidebar-active-border);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.sidebar-nav-link.active i {
  color: #ffffff;
}

/* Подвал сайдбара / Профиль и кнопка сворачивания */
.sidebar-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.65rem 0.75rem;
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.08);
}

.sidebar-collapse-btn {
  border: 0;
  background: transparent;
  color: #d0c8f5;
  padding: 0.45rem 0.5rem;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.82rem;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sidebar-collapse-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.sidebar-user-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.35rem 0.4rem;
  border-radius: 10px;
}

.sidebar-user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--avatar-green);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.78rem;
  flex-shrink: 0;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

.user-name-text {
  color: #ffffff;
  font-weight: 600;
  font-size: 0.82rem;
  line-height: 1.2;
}

.user-role-text {
  color: var(--sidebar-text-muted);
  font-size: 0.7rem;
  line-height: 1.2;
}

.sidebar-logout-btn {
  border: 0;
  background: transparent;
  color: var(--sidebar-text-muted);
  padding: 0.25rem 0.35rem;
  font-size: 1rem;
  cursor: pointer;
  border-radius: 6px;
  transition: color 0.15s ease;
}

.sidebar-logout-btn:hover {
  color: #ef4444;
}

/* Свернутое состояние сайдбара */
.sidebar-collapsed .sidebar-text,
.sidebar-collapsed .sidebar-category,
.sidebar-collapsed .sidebar-logo-text,
.sidebar-collapsed .user-info-text {
  display: none !important;
}

.sidebar-collapsed .sidebar-nav-link {
  justify-content: center;
  padding: 0.65rem 0;
  margin: 0.15rem 0.25rem;
}

.sidebar-collapsed .sidebar-nav-link-content {
  gap: 0;
  justify-content: center;
}

.sidebar-collapsed .sidebar-nav-link i {
  font-size: 1.2rem;
  width: auto;
}

.sidebar-collapsed .sidebar-header {
  padding: 0;
  justify-content: center;
}

.sidebar-collapsed .sidebar-collapse-btn {
  justify-content: center;
  padding: 0.5rem 0;
}

.sidebar-collapsed .sidebar-user-card {
  justify-content: center;
  padding: 0.25rem 0;
}

/* Позиционирование рабочей зоны */
@media (min-width: 992px) {
  .app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    height: 100vh;
    width: var(--sidebar-width);
  }

  .app-main {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    min-width: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--body-bg);
    transition: margin-left 0.22s cubic-bezier(0.4, 0, 0.2, 1), width 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .sidebar-collapsed .app-sidebar {
    width: var(--sidebar-collapsed-width);
  }

  .sidebar-collapsed .app-main {
    margin-left: var(--sidebar-collapsed-width);
    width: calc(100% - var(--sidebar-collapsed-width));
  }
}

@media (max-width: 991.98px) {
  .app-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    height: 100vh;
    width: var(--sidebar-width);
    transform: translateX(-100%);
    box-shadow: 0 0 35px rgba(0, 0, 0, 0.45);
    z-index: 1050;
    transition: transform 0.22s ease-in-out;
  }

  .app-sidebar.mobile-open {
    transform: translateX(0);
  }

  .app-main {
    margin-left: 0 !important;
    width: 100% !important;
    min-width: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--body-bg);
  }

  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(38, 26, 91, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1045;
  }

  .sidebar-backdrop.active {
    display: block;
  }
}

/* ==========================================================================
   ВЕРХНЯЯ ШАПКА (TOPBAR - MIDNIGHT DEEP VIOLET)
   ========================================================================== */

.app-topbar {
  height: var(--topbar-height);
  width: 100%;
  background-color: var(--topbar-bg);
  border-bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  position: sticky;
  top: 0;
  z-index: 1020;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.topbar-toggle-btn {
  border: 0;
  background: transparent;
  color: var(--topbar-text);
  padding: 0.25rem 0.4rem;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.topbar-toggle-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.topbar-nav-link {
  color: var(--topbar-text);
  font-size: 0.84rem;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.topbar-nav-link:hover {
  color: var(--topbar-text-hover);
  background: rgba(255, 255, 255, 0.08);
}

.topbar-nav-link.active {
  color: #ffffff;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.14);
}

/* Фирменный логотип в центре шапки */
.topbar-center-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.topbar-brand-shapes {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 22px;
}

.topbar-brand-shapes .shape-cyan {
  width: 8px;
  height: 18px;
  background: #06b6d4;
  border-radius: 4px;
}

.topbar-brand-shapes .shape-rose {
  width: 9px;
  height: 22px;
  background: #f43f5e;
  border-radius: 4px;
}

.topbar-brand-shapes .shape-gold {
  width: 8px;
  height: 14px;
  background: #f59e0b;
  border-radius: 4px;
}

.topbar-brand-title {
  color: #ffffff;
  font-weight: 700;
  font-size: 0.86rem;
  line-height: 1.15;
}

.topbar-brand-sub {
  color: #b9b1e5;
  font-size: 0.68rem;
  line-height: 1.15;
}

/* Правые элементы шапки */
.topbar-pill {
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  color: #ffffff;
  padding: 4px 12px;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.topbar-pill:hover {
  background: rgba(255, 255, 255, 0.16);
}

.topbar-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  display: inline-block;
  box-shadow: 0 0 6px #22c55e;
}

.topbar-work-badge {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  color: #ffffff;
  padding: 4px 12px;
  font-size: 0.78rem;
  font-weight: 500;
}

.topbar-icon-btn {
  border: 0;
  background: transparent;
  color: var(--topbar-text);
  padding: 0.35rem 0.5rem;
  font-size: 1.1rem;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.topbar-icon-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.topbar-user-avatar-btn {
  border: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--avatar-green);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s ease;
}

.topbar-user-avatar-btn:hover {
  transform: scale(1.05);
}

/* ==========================================================================
   ВТОРИЧНЫЙ ТАБ-БАР (SUBHEADER WHITE BAR)
   ========================================================================== */

.app-subheader {
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  padding: 0 1.5rem;
  height: var(--subheader-height);
  display: flex;
  align-items: center;
  position: sticky;
  top: var(--topbar-height);
  z-index: 1010;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.subheader-inner {
  display: flex;
  align-items: center;
  height: 100%;
  width: 100%;
  gap: 1.5rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.subheader-inner::-webkit-scrollbar {
  display: none;
}

.subheader-tab {
  color: #64748b;
  font-size: 0.84rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  line-height: 1;
  padding: 0 0.35rem;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.subheader-tab:hover {
  color: #1e293b;
}

.subheader-tab.active {
  color: var(--primary-blue);
  font-weight: 600;
  border-bottom-color: var(--primary-blue);
}

/* Основное тело страницы */
.app-content {
  flex-grow: 1;
  width: 100%;
  padding: 1.5rem 1.5rem 2rem 1.5rem;
}

.app-footer {
  background: #ffffff;
  border-top: 1px solid var(--border-color);
  padding: 0.85rem 1.5rem;
}

/* ==========================================================================
   DANA UI КОМПОНЕНТЫ: ЗАГОЛОВОК, СВИТЧЕРЫ, КНОПКИ, ПИЛЛЫ
   ========================================================================== */

.dana-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.dana-title {
  font-size: 1.55rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

/* Переключатель вида (Расписание | Список / Таблица | Карточки) */
.dana-view-switcher {
  background: #e9eef5;
  border-radius: 8px;
  padding: 3px;
  display: inline-flex;
  gap: 2px;
}

.dana-view-tab {
  border: 0;
  background: transparent;
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.dana-view-tab.active {
  background: #ffffff;
  color: #1e293b;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Кнопки действий (белые контурные и яркая синяя главная кнопка) */
.btn-dana-white {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: #334155;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.45rem 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: all 0.15s ease;
  text-decoration: none;
}

.btn-dana-white:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #1e293b;
  transform: translateY(-1px);
}

.btn-dana-primary {
  background: var(--primary-blue);
  border: 1px solid var(--primary-blue);
  border-radius: 8px;
  color: #ffffff !important;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.45rem 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
  transition: all 0.15s ease;
  text-decoration: none;
}

.btn-dana-primary:hover {
  background: var(--primary-blue-hover);
  border-color: var(--primary-blue-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(59, 130, 246, 0.4);
}

.btn-filter-icon {
  width: 31px !important;
  height: 31px !important;
  min-width: 31px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 7px !important;
  flex-shrink: 0 !important;
  font-size: 0.85rem !important;
}

/* Сегментированная линейка фильтров (День | 3 дня | Неделя | Текущий месяц / Категории) */
.dana-segmented-bar {
  background: #e9eef5;
  border-radius: 10px;
  padding: 3px;
  display: inline-flex;
  gap: 3px;
  overflow-x: auto;
  max-width: 100%;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.dana-segmented-bar::-webkit-scrollbar {
  display: none;
}

.dana-segmented-pill {
  border: 0;
  background: transparent;
  color: #475569;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.85rem;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.dana-segmented-pill.active {
  background: #ffffff;
  color: #1e293b;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.dana-segmented-pill:hover:not(.active) {
  background: rgba(255, 255, 255, 0.6);
  color: #1e293b;
}

/* ==========================================================================
   ПРАВАЯ ПАНЕЛЬ С КАЛЕНДАРЕМ, ПОИСКОМ И ЛЕГЕНДОЙ СТАТУСОВ
   ========================================================================== */

.dana-right-panel {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1.15rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

/* Мини-календарь */
.mini-cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  font-size: 0.84rem;
  color: #1e293b;
  margin-bottom: 0.75rem;
}

.mini-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  gap: 3px;
  font-size: 0.75rem;
}

.mini-cal-day-head {
  color: #94a3b8;
  font-weight: 600;
  padding: 4px 0;
  font-size: 0.68rem;
}

.mini-cal-day {
  padding: 4px 0;
  border-radius: 50%;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s ease;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

.mini-cal-day:hover {
  background: #eff6ff;
}

.mini-cal-day.active {
  background: var(--primary-blue);
  color: #ffffff;
  font-weight: 700;
}

.mini-cal-day.muted {
  color: #cbd5e1;
}

/* Легенда статусов */
.dana-legend-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.78rem;
  color: #475569;
  margin-bottom: 0.45rem;
}

.dana-legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}

.dot-planned {
  background: var(--status-planned-bg);
  border: 1px solid var(--status-planned-border);
}

.dot-confirmed {
  background: var(--status-confirmed-bg);
  border: 1px solid var(--status-confirmed-border);
}

.dot-progress {
  background: var(--status-progress-bg);
  border: 1px solid var(--status-progress-border);
}

.dot-completed {
  background: var(--status-completed-bg);
  border: 1px solid var(--status-completed-border);
}

.dot-frozen {
  background: var(--status-frozen-bg);
  border: 1px solid var(--status-frozen-border);
}

.dot-cancelled {
  background: var(--status-cancelled-bg);
  border: 1px solid var(--status-cancelled-border);
}

/* ==========================================================================
   БЕЙДЖИ И ПАСТЕЛЬНЫЕ ПИЛЛЫ СТАТУСОВ (КАК В ОБРАЗЦЕ)
   ========================================================================== */

.status-pill-planned {
  background: var(--status-planned-bg);
  border: 1px solid var(--status-planned-border);
  color: var(--status-planned-text);
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.status-pill-confirmed {
  background: var(--status-confirmed-bg);
  border: 1px solid var(--status-confirmed-border);
  color: var(--status-confirmed-text);
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.status-pill-progress {
  background: var(--status-progress-bg);
  border: 1px solid var(--status-progress-border);
  color: var(--status-progress-text);
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.status-pill-completed {
  background: var(--status-completed-bg);
  border: 1px solid var(--status-completed-border);
  color: var(--status-completed-text);
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.status-pill-frozen {
  background: var(--status-frozen-bg);
  border: 1px solid var(--status-frozen-border);
  color: var(--status-frozen-text);
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.status-pill-cancelled {
  background: var(--status-cancelled-bg);
  border: 1px solid var(--status-cancelled-border);
  color: var(--status-cancelled-text);
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

/* ==========================================================================
   ТАБЛИЦЫ И КАРТОЧКИ - ЧИСТЫЕ СКРУГЛЕННЫЕ УГЛЫ
   ========================================================================== */

.table-responsive {
  border-radius: inherit;
  overflow-x: auto;
}

.table {
  margin-bottom: 0;
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
}

.table thead th {
  background-color: #fafbfc;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-color);
  border-top: 0;
  white-space: nowrap;
}

/* Скругление углов таблицы в первом и последнем ряду для совпадения со скруглением карточки */
.table thead:first-child tr:first-child th:first-child {
  border-top-left-radius: 11px;
}
.table thead:first-child tr:first-child th:last-child {
  border-top-right-radius: 11px;
}
.table tbody tr:last-child td:first-child {
  border-bottom-left-radius: 11px;
}
.table tbody tr:last-child td:last-child {
  border-bottom-right-radius: 11px;
}

.table tbody td {
  padding: 0.85rem 1rem;
  vertical-align: middle;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
  font-size: 0.84rem;
  background-color: #ffffff;
  transition: background-color 0.15s ease;
}

.table-hover tbody tr:hover td {
  background-color: #f8fafc !important;
}

.table tbody tr:last-child td {
  border-bottom: 0;
}

/* Компактный и адаптивный режим для многоколоночных таблиц и отчетов */
.table-compact thead th {
  padding: 0.65rem 0.65rem !important;
  font-size: 0.7rem;
}
.table-compact tbody td,
.table-compact tfoot td {
  padding: 0.6rem 0.65rem !important;
  font-size: 0.81rem;
}

@media (max-width: 1400px) {
  .table thead th {
    padding: 0.75rem 0.65rem;
  }
  .table tbody td {
    padding: 0.75rem 0.65rem;
  }
}

/* Тонкий деликатный скроллбар для переполнений таблиц */
.table-responsive::-webkit-scrollbar {
  height: 6px;
}
.table-responsive::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}
.table-responsive::-webkit-scrollbar-thumb {
  background-color: #cbd5e1;
  border-radius: 4px;
}
.table-responsive::-webkit-scrollbar-thumb:hover {
  background-color: #94a3b8;
}

/* Карточки с идеальным клиппингом углов */
.card {
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background-color: #ffffff;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  overflow: hidden; /* Клиппинг всех внутренних блоков и таблиц по 12px углам */
}

.card-header {
  background-color: #ffffff;
  border-bottom: 1px solid #f1f5f9;
  padding: 1rem 1.25rem;
  font-weight: 600;
  border-top-left-radius: 11px !important;
  border-top-right-radius: 11px !important;
}

.card-footer {
  background-color: #ffffff;
  border-top: 1px solid #f1f5f9;
  padding: 0.75rem 1.25rem;
  border-bottom-left-radius: 11px !important;
  border-bottom-right-radius: 11px !important;
}

/* Формы */
.form-control, .form-select {
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  font-size: 0.84rem;
  padding: 0.45rem 0.8rem;
  background-color: #ffffff;
  color: #1e293b;
  transition: all 0.15s ease-in-out;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
  outline: none;
}

.form-control-sm, .form-select-sm {
  border-radius: 7px;
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
}

/* Коррекция внутренних углов в input-group */
.input-group > :not(:first-child):not(.dropdown-menu):not(.valid-tooltip):not(.valid-feedback):not(.invalid-tooltip):not(.invalid-feedback) {
  border-top-left-radius: 0 !important;
  border-bottom-left-radius: 0 !important;
}

.input-group > :not(:last-child):not(.dropdown-menu):not(.valid-tooltip):not(.valid-feedback):not(.invalid-tooltip):not(.invalid-feedback) {
  border-top-right-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
}

.input-group > :first-child:not(.dropdown-menu) {
  border-top-left-radius: 8px !important;
  border-bottom-left-radius: 8px !important;
}

.input-group > :last-child:not(.dropdown-menu) {
  border-top-right-radius: 8px !important;
  border-bottom-right-radius: 8px !important;
}

.input-group-sm > :first-child:not(.dropdown-menu) {
  border-top-left-radius: 7px !important;
  border-bottom-left-radius: 7px !important;
}

.input-group-sm > :last-child:not(.dropdown-menu) {
  border-top-right-radius: 7px !important;
  border-bottom-right-radius: 7px !important;
}

/* Стандартные кнопки Bootstrap */
.btn {
  font-weight: 500;
  font-size: 0.84rem;
  padding: 0.45rem 0.9rem;
  border-radius: 8px;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  line-height: 1.4;
}

/* Коррекция углов в группах кнопок btn-group */
.btn-group > .btn:not(:first-child):not(:last-child) {
  border-radius: 0 !important;
}

.btn-group > .btn:first-child:not(:last-child):not(.dropdown-toggle) {
  border-top-right-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
  border-top-left-radius: 8px !important;
  border-bottom-left-radius: 8px !important;
}

.btn-group > .btn:last-child:not(:first-child),
.btn-group > .dropdown-toggle:not(:first-child) {
  border-top-left-radius: 0 !important;
  border-bottom-left-radius: 0 !important;
  border-top-right-radius: 8px !important;
  border-bottom-right-radius: 8px !important;
}

.btn-group-sm > .btn:first-child:not(:last-child):not(.dropdown-toggle) {
  border-top-left-radius: 6px !important;
  border-bottom-left-radius: 6px !important;
}

.btn-group-sm > .btn:last-child:not(:first-child),
.btn-group-sm > .dropdown-toggle:not(:first-child) {
  border-top-right-radius: 6px !important;
  border-bottom-right-radius: 6px !important;
}

.btn-primary {
  background-color: var(--primary-blue);
  border-color: var(--primary-blue);
  color: #ffffff;
}

.btn-primary:hover, .btn-primary:focus {
  background-color: var(--primary-blue-hover);
  border-color: var(--primary-blue-hover);
  color: #ffffff;
}

.btn-outline-secondary {
  color: #475569;
  border-color: #cbd5e1;
  background-color: #ffffff;
}

.btn-outline-secondary:hover {
  background-color: #f8fafc;
  border-color: #94a3b8;
  color: #1e293b;
}

.dropdown-menu {
  border-radius: 10px;
  border: 1px solid var(--border-color);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
  padding: 0.4rem;
}

.dropdown-item {
  border-radius: 6px;
  font-size: 0.84rem;
  padding: 0.45rem 0.75rem;
}

.modal-content {
  border-radius: 14px;
  border: 1px solid var(--border-color);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

.modal-header {
  border-top-left-radius: 13px;
  border-top-right-radius: 13px;
}

.modal-footer {
  border-bottom-left-radius: 13px;
  border-bottom-right-radius: 13px;
}

.alert {
  border-radius: 10px;
}

/* Цветные метки расходников (CMYK, барабаны, бункеры) */
.consumable-badge { display: inline-flex; align-items: center; gap: 0.3rem; white-space: nowrap; }
.color-dot { display: inline-block; width: 0.75rem; height: 0.75rem; border-radius: 50%; border: 1px solid rgba(0, 0, 0, 0.25); flex: 0 0 auto; }
.color-pick { display: inline-flex; align-items: center; gap: 0.4rem; border: 1px solid #cbd5e1; border-radius: 0.5rem; padding: 0.35rem 0.6rem; cursor: pointer; user-select: none; background: #fff; }
.color-pick input { margin: 0; }
.color-pick:has(input:checked) { border-color: #2563eb; box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15); background: #eff6ff; }
.color-pick.out-of-stock { opacity: 0.75; }

/* Классы Bootstrap 5.3 (*-subtle, *-emphasis) для подключённого Bootstrap 5.1.
   Без них такие значки получали белый текст на прозрачном фоне и были не видны. */
.bg-primary-subtle { background-color: #cfe2ff !important; }
.bg-secondary-subtle { background-color: #e2e3e5 !important; }
.bg-success-subtle { background-color: #d1e7dd !important; }
.bg-info-subtle { background-color: #cff4fc !important; }
.bg-warning-subtle { background-color: #fff3cd !important; }
.bg-danger-subtle { background-color: #f8d7da !important; }
.bg-purple-subtle { background-color: #e9d8fd !important; }
.border-primary-subtle { border-color: #9ec5fe !important; }
.border-secondary-subtle { border-color: #c4c8cb !important; }
.border-success-subtle { border-color: #a3cfbb !important; }
.border-info-subtle { border-color: #9eeaf9 !important; }
.border-warning-subtle { border-color: #ffe69c !important; }
.border-danger-subtle { border-color: #f1aeb5 !important; }
.text-primary-emphasis { color: #052c65 !important; }
.text-secondary-emphasis { color: #2b2f32 !important; }
.text-success-emphasis { color: #0a3622 !important; }
.text-info-emphasis { color: #055160 !important; }
.text-warning-emphasis { color: #664d03 !important; }
.text-danger-emphasis { color: #58151c !important; }