/* static/css/main.css */

/* ═══════════════════════════════════════════════════════════════════
   CSS ПЕРЕМЕННЫЕ
   ═══════════════════════════════════════════════════════════════════ */
:root {
  /* Бренд */
  --color-primary:       #1e3a5f;
  --color-primary-light: #2d5a9e;
  --color-primary-dark:  #142840;
  --color-primary-50:    #eff6ff;
  --color-primary-100:   #dbeafe;
  --color-accent:        #0ea5e9;
  --color-accent-hover:  #0284c7;
  --color-accent-50:     #f0f9ff;

  /* Slate-шкала */
  --color-slate-50:  #f8fafc;
  --color-slate-100: #f1f5f9;
  --color-slate-200: #e2e8f0;
  --color-slate-300: #cbd5e1;
  --color-slate-400: #94a3b8;
  --color-slate-500: #64748b;
  --color-slate-600: #475569;
  --color-slate-700: #334155;
  --color-slate-800: #1e293b;
  --color-slate-900: #0f172a;

  /* Доменные цвета статусов */
  --color-found:       #64748b;
  --color-analysis:    #0ea5e9;
  --color-preparation: #f59e0b;
  --color-submitted:   #3b82f6;
  --color-trading:     #8b5cf6;
  --color-won:         #0891b2;
  --color-contract:    #1d4ed8;
  --color-execution:   #f97316;
  --color-closed:      #16a34a;
  --color-lost:        #ef4444;
  --color-declined:    #6b7280;
  --color-delivery:    #f97316;
  --color-acceptance:  #10b981;
  --color-payment:     #eab308;

  /* Цвета уровней доступа — единый источник для бейджей, hero и карточек */
  --level-admin:    #7c3aed;
  --level-employee: #0284c7;
  --level-observer: #64748b;

  /* Тренды */
  --color-trend-up:      #16a34a;
  --color-trend-down:    #dc2626;
  --color-trend-neutral: #64748b;

  /* Layout */
  --sidebar-width:     240px;
  --sidebar-collapsed: 64px;
  --navbar-height:     56px;

  /* Радиусы */
  --radius-xs:   4px;
  --radius-sm:   6px;
  --radius:      10px;
  --radius-lg:   16px;
  --radius-xl:   20px;
  --radius-full: 9999px;

  /* Тени */
  --shadow-xs:           0 1px 2px rgba(0,0,0,.05);
  --shadow-sm:           0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:           0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -2px rgba(0,0,0,.05);
  --shadow-lg:           0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -4px rgba(0,0,0,.04);
  --shadow-xl:           0 20px 25px -5px rgba(0,0,0,.08), 0 8px 10px -6px rgba(0,0,0,.04);
  --shadow-glow-primary: 0 0 20px rgba(30,58,95,.15);
  --shadow-glow-accent:  0 0 20px rgba(14,165,233,.15);

  /* Анимации */
  --ease-out:        cubic-bezier(.2,.8,.2,1);
  --ease-spring:     cubic-bezier(.34,1.56,.64,1);
  --duration-fast:   .15s;
  --duration-normal: .25s;
  --duration-slow:   .4s;
  --transition:        all var(--duration-normal) var(--ease-out);
  --transition-fast:   all var(--duration-fast) var(--ease-out);
  --transition-spring: transform var(--duration-normal) var(--ease-spring);

  /* Таблица — ширины sticky-колонок */
  --sticky-col-1-width: 130px;
  --sticky-col-2-width: 200px;
}

/* ═══════════════════════════════════════════════════════════════════
   БАЗА
   ═══════════════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  color: var(--color-slate-800);
  background: var(--color-slate-100);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeSpeed;
  line-height: 1.5;
}

h1, h2, h3, h4, h5, h6 { text-rendering: optimizeLegibility; }

::-webkit-scrollbar       { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--color-slate-300); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--color-slate-400); }

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

::selection {
  background: var(--color-primary-100);
  color: var(--color-primary);
}

/* ═══════════════════════════════════════════════════════════════════
   НАВБАР
   ═══════════════════════════════════════════════════════════════════ */
.app-navbar {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  height: var(--navbar-height);
  box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 4px 12px rgba(0,0,0,.08),
              inset 0 -1px 0 rgba(255,255,255,.06);
  position: fixed; top: 0; left: 0; right: 0; z-index: 1030;
}

.brand-icon {
  width: 34px; height: 34px;
  background: rgba(255,255,255,.15);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,.1);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
  transition:
    background-color var(--duration-fast) var(--ease-out),
    transform        var(--duration-fast) var(--ease-spring);
}
.brand-icon:hover { background: rgba(255,255,255,.25); transform: scale(1.05); }
.brand-text { font-size: 15px; font-weight: 700; letter-spacing: -.3px; white-space: nowrap; }

.btn-accent {
  background: var(--color-accent); color: white; border: none;
  box-shadow: 0 2px 8px rgba(14,165,233,.3);
  transition:
    background-color var(--duration-fast)   var(--ease-out),
    box-shadow       var(--duration-normal) var(--ease-out),
    transform        var(--duration-normal) var(--ease-spring);
}
.btn-accent:hover {
  background: var(--color-accent-hover); color: white;
  transform: translateY(-1px); box-shadow: 0 4px 12px rgba(14,165,233,.4);
}
.btn-accent:active { transform: translateY(0); }

.navbar-search-wrap { align-items: center; }
.navbar-search-group {
  border-radius: var(--radius-sm); overflow: hidden;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.15);
  transition:
    background-color var(--duration-fast) var(--ease-out),
    border-color     var(--duration-fast) var(--ease-out),
    box-shadow       var(--duration-fast) var(--ease-out);
}
.navbar-search-group:focus-within {
  background: rgba(255,255,255,.2); border-color: rgba(255,255,255,.35);
  box-shadow: 0 0 0 3px rgba(255,255,255,.08);
}
.navbar-search-icon  { background: transparent !important; border: none !important; color: rgba(255,255,255,.6) !important; padding: 0 8px 0 10px; }
.navbar-search-input { background: transparent !important; border: none !important; color: white !important; font-size: 13px !important; padding: 7px 8px !important; box-shadow: none !important; }
.navbar-search-input::placeholder { color: rgba(255,255,255,.45) !important; }
.navbar-search-input:focus { box-shadow: none !important; }
.navbar-search-clear { display: flex; align-items: center; padding: 0 10px; color: rgba(255,255,255,.5); font-size: 11px; text-decoration: none; background: transparent; border: none; cursor: pointer; transition: color var(--duration-fast); }
.navbar-search-clear:hover { color: rgba(255,255,255,.9); }

.navbar-mobile-toggle {
  width: 36px; height: 36px;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius-sm); color: white; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0; padding: 0;
  transition:
    background-color var(--duration-fast) var(--ease-out),
    transform        var(--duration-fast) var(--ease-spring);
}
.navbar-mobile-toggle:hover  { background: rgba(255,255,255,.2); }
.navbar-mobile-toggle:active { background: rgba(255,255,255,.25); transform: scale(.95); }

.navbar-divider { width: 1px; height: 28px; background: rgba(255,255,255,.15); margin: 0 4px; flex-shrink: 0; }

.navbar-org-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px; background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.12); border-radius: var(--radius-sm);
  color: white; cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-out);
  white-space: nowrap; max-width: 220px;
}
.navbar-org-btn:hover  { background: rgba(255,255,255,.2); }
.navbar-org-btn:active { background: rgba(255,255,255,.25); }
.navbar-org-icon { color: #fbbf24; font-size: 14px; flex-shrink: 0; }
.navbar-org-name { font-size: 12px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }

.navbar-chevron { font-size: 10px; opacity: .6; flex-shrink: 0; transition: transform var(--duration-normal) var(--ease-out); }
.show > .navbar-org-btn  .navbar-chevron,
.show > .navbar-user-btn .navbar-chevron { transform: rotate(180deg); }

.navbar-user-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 5px 10px 5px 5px; background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.1); border-radius: var(--radius);
  color: white; cursor: pointer;
  transition:
    background-color var(--duration-fast) var(--ease-out),
    border-color     var(--duration-fast) var(--ease-out);
  text-align: left;
}
.navbar-user-btn:hover  { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.2); }
.navbar-user-btn:active { background: rgba(255,255,255,.22); }

.navbar-avatar-wrap { position: relative; flex-shrink: 0; }
.navbar-online-dot {
  position: absolute; bottom: 0; right: 0;
  width: 9px; height: 9px; background: #22c55e;
  border-radius: 50%; border: 2px solid var(--color-primary);
  animation: onlinePulse 3s ease-in-out infinite;
}

.navbar-user-info { gap: 1px; min-width: 0; }
.navbar-user-name {
  font-size: 13px; font-weight: 600; color: white;
  line-height: 1.3; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; max-width: 160px; display: block;
}
.navbar-user-meta {
  font-size: 10.5px; color: rgba(255,255,255,.6);
  line-height: 1.2; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; max-width: 160px; font-weight: 400; display: block;
}

/* ═══════════════════════════════════════════════════════════════════
   LAYOUT — сайдбар + контент
   ═══════════════════════════════════════════════════════════════════ */
.app-container { display: flex; min-height: 100vh; padding-top: var(--navbar-height); }

.app-sidebar {
  width: var(--sidebar-width); background: white;
  border-right: 1px solid var(--color-slate-200);
  position: fixed; top: var(--navbar-height); bottom: 0; left: 0;
  overflow-y: auto; overflow-x: hidden;
  transition: width var(--duration-normal) var(--ease-out);
  z-index: 100;
  display: flex; flex-direction: column;
  box-shadow: 1px 0 4px rgba(0,0,0,.03);
}

.app-main {
  flex: 1; margin-left: var(--sidebar-width); min-width: 0;
  transition: margin-left var(--duration-normal) var(--ease-out);
  padding: 24px 28px; max-width: 100%;
}

.sidebar-collapsed .app-sidebar                              { width: var(--sidebar-collapsed); }
.sidebar-collapsed .app-main                                 { margin-left: var(--sidebar-collapsed); }
.sidebar-collapsed .sidebar-section-label                    { opacity: 0; pointer-events: none; }
.sidebar-collapsed .sidebar-nav .sidebar-link span:not(.status-dot) { display: none; }
.sidebar-collapsed .sidebar-soon-badge                       { display: none; }
.sidebar-collapsed .sidebar-footer-text                      { display: none; }
.sidebar-collapsed .sidebar-link                             { justify-content: center; padding: 10px 0; }
.sidebar-collapsed .sidebar-link i                           { width: auto; font-size: 18px; margin: 0; }
.sidebar-collapsed .sidebar-submenu                          { display: none !important; }
.sidebar-collapsed .sidebar-expand-btn                       { display: none; }

@media (max-width: 767.98px) {
  .app-sidebar {
    transform: translateX(-100%); width: var(--sidebar-width) !important;
    box-shadow: none;
    transition: transform var(--duration-normal) var(--ease-out);
  }
  .app-main { margin-left: 0 !important; padding: 16px; }
  .sidebar-open .app-sidebar { transform: translateX(0); box-shadow: 4px 0 24px rgba(0,0,0,.15); }
  .sidebar-open::after {
    content: ''; position: fixed; inset: 0;
    background: rgba(0,0,0,.3); z-index: 99;
    animation: fadeIn var(--duration-fast) ease;
  }
  .sidebar-collapse-btn { display: none !important; }
  .navbar-user-btn { padding: 5px; border-radius: 50%; border-color: transparent; }
}

@media (max-width: 575.98px) { .navbar-org-name { display: none; } }

/* ═══════════════════════════════════════════════════════════════════
   КНОПКА COLLAPSE САЙДБАРА
   ═══════════════════════════════════════════════════════════════════ */
.sidebar-collapse-btn {
  display: flex; align-items: center; gap: 8px;
  width: calc(100% - 16px); margin: 0 8px 8px; padding: 8px 10px;
  border-radius: var(--radius-sm); background: transparent;
  border: 1px solid transparent; color: var(--color-slate-500);
  font-size: 13px; font-weight: 500; cursor: pointer;
  transition:
    background-color var(--duration-fast) var(--ease-out),
    border-color     var(--duration-fast) var(--ease-out),
    color            var(--duration-fast) var(--ease-out);
  white-space: nowrap; overflow: hidden; flex-shrink: 0; text-align: left;
}
.sidebar-collapse-btn:hover  { background: var(--color-slate-100); border-color: var(--color-slate-200); color: var(--color-primary); }
.sidebar-collapse-btn:active { background: var(--color-primary-50); transform: scale(.98); }

.collapse-btn-icon {
  width: 28px; height: 28px; border-radius: var(--radius-sm);
  background: var(--color-slate-100); border: 1px solid var(--color-slate-200);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; flex-shrink: 0;
  transition:
    background-color var(--duration-fast) var(--ease-out),
    border-color     var(--duration-fast) var(--ease-out),
    color            var(--duration-fast) var(--ease-out);
  color: var(--color-slate-600);
}
.sidebar-collapse-btn:hover .collapse-btn-icon { background: var(--color-primary-50); border-color: var(--color-primary-100); color: var(--color-primary-light); }

.collapse-btn-label { font-size: 12.5px; font-weight: 500; color: var(--color-slate-500); transition: opacity var(--duration-fast); white-space: nowrap; overflow: hidden; }
.collapse-chevron   { transition: transform var(--duration-normal) var(--ease-out); }

.sidebar-collapsed .sidebar-collapse-btn { justify-content: center; padding: 8px 0; }
.sidebar-collapsed .collapse-btn-label   { display: none; }
.sidebar-collapsed .collapse-btn-icon    { width: 32px; height: 32px; font-size: 13px; }
.sidebar-collapsed .collapse-chevron     { transform: rotate(180deg); }

/* ═══════════════════════════════════════════════════════════════════
   САЙДБАР — МЕНЮ
   ═══════════════════════════════════════════════════════════════════ */
.sidebar-nav { padding: 16px 0; flex: 1; }

.sidebar-section-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1.2px; color: var(--color-slate-400);
  padding: 0 16px; margin-bottom: 6px; white-space: nowrap;
  overflow: hidden; transition: opacity var(--duration-normal);
}

.sidebar-menu { margin: 0; padding: 0 8px; }

.sidebar-link {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  border-radius: var(--radius-sm); color: var(--color-slate-600);
  text-decoration: none; font-weight: 500;
  transition:
    background-color var(--duration-fast) var(--ease-out),
    color            var(--duration-fast) var(--ease-out);
  white-space: nowrap; overflow: hidden; position: relative; min-height: 38px;
}
.sidebar-link i { font-size: 16px; flex-shrink: 0; width: 20px; text-align: center; transition: color var(--duration-fast); }
.sidebar-link:hover  { background: var(--color-slate-50); color: var(--color-primary); }
.sidebar-link.active {
  background: linear-gradient(135deg, var(--color-primary-50), var(--color-primary-100));
  color: var(--color-primary-light); font-weight: 600;
  box-shadow: inset 3px 0 0 var(--color-primary-light);
}
.sidebar-link.active i { color: var(--color-primary-light); }
.sidebar-link-sm { font-size: 12.5px; padding: 7px 12px; min-height: 34px; }

.status-dot { width: 8px; height: 8px; border-radius: var(--radius-full); flex-shrink: 0; box-shadow: 0 0 0 2px rgba(255,255,255,.8); }
.bg-orange  { background-color: #f97316 !important; }

.sidebar-footer      { border-top: 1px solid var(--color-slate-100); margin-top: auto; padding: 8px 0 0; display: flex; flex-direction: column; }
.sidebar-footer-text { font-size: 11px; color: var(--color-slate-400); text-align: center; padding: 4px 8px 6px; white-space: nowrap; overflow: hidden; transition: opacity var(--duration-normal); }

.sidebar-soon-badge { margin-left: auto; font-size: 9px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; color: var(--color-accent); background: var(--color-accent-50); border: 1px solid rgba(14,165,233,.2); border-radius: var(--radius-full); padding: 1px 6px; white-space: nowrap; flex-shrink: 0; }
.sidebar-stub       { opacity: .5; cursor: not-allowed !important; pointer-events: none; user-select: none; }

/* ═══════════════════════════════════════════════════════════════════
   PAGE HEADER
   ═══════════════════════════════════════════════════════════════════ */
.page-header { margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--color-slate-200); }
.page-title  { font-size: 22px; font-weight: 700; color: var(--color-slate-900); margin: 0; line-height: 1.3; letter-spacing: -.3px; }
.breadcrumb  { font-size: 12px; margin: 0; }
.breadcrumb-item + .breadcrumb-item::before { color: var(--color-slate-400); }
.breadcrumb a { color: var(--color-slate-500); transition: color var(--duration-fast); }
.breadcrumb a:hover { color: var(--color-primary-light); }

/* ═══════════════════════════════════════════════════════════════════
   KPI КАРТОЧКИ
   ═══════════════════════════════════════════════════════════════════ */
.kpi-card {
  border-radius: var(--radius) !important; box-shadow: var(--shadow-sm) !important;
  transition:
    transform  var(--duration-normal) var(--ease-out),
    box-shadow var(--duration-normal) var(--ease-out);
  overflow: hidden; position: relative; border: 1px solid rgba(0,0,0,.04);
}
.kpi-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 3px; background: var(--color-slate-200);
  transition: background-color var(--duration-normal) var(--ease-out);
}
.kpi-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg) !important; }
.kpi-card:hover::before { background: var(--color-primary-light); }
.kpi-card .card-body { padding: 20px; }

.kpi-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 20px; margin-bottom: 12px; transition: transform var(--duration-normal) var(--ease-spring); }
.kpi-card:hover .kpi-icon { transform: scale(1.08); }
.kpi-icon-blue   { background: #dbeafe; color: #1d4ed8; }
.kpi-icon-green  { background: #dcfce7; color: #15803d; }
.kpi-icon-teal   { background: #ccfbf1; color: #0f766e; }
.kpi-icon-purple { background: #ede9fe; color: #6d28d9; }
.kpi-icon-orange { background: #ffedd5; color: #c2410c; }
.kpi-icon-red    { background: #fee2e2; color: #b91c1c; }
.kpi-icon-yellow { background: #fef9c3; color: #a16207; }
.kpi-icon-indigo { background: #e0e7ff; color: #4338ca; }

.kpi-value { font-size: 28px; font-weight: 800; color: var(--color-slate-900); line-height: 1; margin-bottom: 4px; letter-spacing: -.5px; }
.kpi-label { font-size: 12px; color: var(--color-slate-500); font-weight: 500; margin-bottom: 4px; }
.kpi-sub   { font-size: 11px; font-weight: 500; }

.kpi-trend { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: var(--radius-full); line-height: 1.4; }
.kpi-trend--up      { background: #dcfce7; color: var(--color-trend-up); }
.kpi-trend--down    { background: #fee2e2; color: var(--color-trend-down); }
.kpi-trend--neutral { background: var(--color-slate-100); color: var(--color-trend-neutral); }
.kpi-trend i        { font-size: 10px; }

.kpi-card-sm .kpi-value { font-size: 20px; }
.kpi-card-sm .kpi-icon  { width: 36px; height: 36px; font-size: 16px; margin-bottom: 8px; }

/* ═══════════════════════════════════════════════════════════════════
   НАВИГАЦИЯ ДАШБОРДА
   ═══════════════════════════════════════════════════════════════════ */
.dashboard-nav {
  display: flex; align-items: center; gap: 4px;
  padding: 4px; background: white;
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-slate-200);
  margin-bottom: 24px; flex-wrap: wrap;
}
.dashboard-nav-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500; color: var(--color-slate-600);
  text-decoration: none;
  transition:
    background-color var(--duration-fast) var(--ease-out),
    color            var(--duration-fast) var(--ease-out),
    box-shadow       var(--duration-normal) var(--ease-out);
  white-space: nowrap;
}
.dashboard-nav-link:hover { background: var(--color-slate-50); color: var(--color-primary-light); }
.dashboard-nav-link.active {
  background: var(--color-primary-light); color: white;
  box-shadow: 0 2px 8px rgba(45,90,158,.25);
}
.dashboard-nav-link i { font-size: 14px; }

/* ═══════════════════════════════════════════════════════════════════
   БЛОК «ТРЕБУЕТ ВНИМАНИЯ»
   ═══════════════════════════════════════════════════════════════════ */
.attention-list { display: flex; flex-direction: column; }

.attention-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 16px; border-left: 3px solid transparent;
  transition: background-color var(--duration-fast) var(--ease-out);
  text-decoration: none; color: inherit;
  border-bottom: 1px solid var(--color-slate-50);
}
.attention-item:last-child { border-bottom: none; }
.attention-item:hover { background: var(--color-slate-50); }
.attention-item--danger  { border-left-color: #ef4444; }
.attention-item--warning { border-left-color: #f59e0b; }
.attention-item--info    { border-left-color: var(--color-accent); }
.attention-item:hover.attention-item--danger  { background: #fff5f5; }
.attention-item:hover.attention-item--warning { background: #fffbeb; }

.attention-icon { width: 32px; height: 32px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; margin-top: 1px; }
.attention-icon--danger  { background: #fee2e2; color: #dc2626; }
.attention-icon--warning { background: #fef3c7; color: #d97706; }
.attention-icon--info    { background: var(--color-accent-50); color: var(--color-accent); }

.attention-title    { font-size: 13px; font-weight: 600; color: var(--color-slate-800); line-height: 1.3; margin-bottom: 2px; }
.attention-subtitle { font-size: 11px; color: var(--color-slate-500); line-height: 1.3; }
.attention-number   { font-size: 10px; color: var(--color-slate-400); font-weight: 500; }
.attention-meta     { display: flex; align-items: center; gap: 8px; margin-top: 3px; flex-wrap: wrap; }
.attention-amount   { font-size: 12px; font-weight: 700; color: var(--color-slate-700); margin-left: auto; flex-shrink: 0; }

/* ═══════════════════════════════════════════════════════════════════
   ВОРОНКА ПРОДАЖ
   ═══════════════════════════════════════════════════════════════════ */
.sales-funnel { display: flex; align-items: stretch; gap: 0; overflow-x: auto; scrollbar-width: none; }
.sales-funnel::-webkit-scrollbar { display: none; }

.sales-funnel-step { flex: 1; min-width: 80px; position: relative; display: flex; flex-direction: column; }

.sales-funnel-body {
  display: flex; flex-direction: column; align-items: center;
  padding: 16px 8px 12px; text-align: center;
  border-radius: var(--radius-sm); margin: 0 2px;
  transition:
    transform  var(--duration-normal) var(--ease-out),
    box-shadow var(--duration-normal) var(--ease-out);
  cursor: default; flex: 1;
}
.sales-funnel-body:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.sales-funnel-count { font-size: 28px; font-weight: 800; line-height: 1; margin-bottom: 4px; letter-spacing: -.5px; }
.sales-funnel-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; line-height: 1.3; opacity: .85; }

.sales-funnel-arrow { position: absolute; right: -12px; top: 50%; transform: translateY(-50%); z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 1px; }
.sales-funnel-arrow-icon { font-size: 12px; color: var(--color-slate-300); line-height: 1; }
.sales-funnel-drop { font-size: 9px; font-weight: 700; line-height: 1; padding: 1px 4px; border-radius: var(--radius-full); white-space: nowrap; }
.sales-funnel-drop--low    { background: #dcfce7; color: #15803d; }
.sales-funnel-drop--medium { background: #fef9c3; color: #a16207; }
.sales-funnel-drop--high   { background: #fee2e2; color: #b91c1c; }

.funnel-found       { background: #f1f5f9; color: var(--color-found); }
.funnel-analysis    { background: #e0f2fe; color: #0369a1; }
.funnel-preparation { background: #fef9c3; color: #a16207; }
.funnel-submitted   { background: #dbeafe; color: #1e40af; }
.funnel-trading     { background: #ede9fe; color: #5b21b6; }
.funnel-won         { background: #dcfce7; color: #15803d; }

/* ═══════════════════════════════════════════════════════════════════
   CHART — пустые состояния + скелетон
   ═══════════════════════════════════════════════════════════════════ */
.chart-empty {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 40px 20px; text-align: center; min-height: 160px;
}
.chart-empty-icon {
  width: 56px; height: 56px; border-radius: var(--radius-lg);
  background: var(--color-slate-100); display: flex;
  align-items: center; justify-content: center;
  font-size: 24px; color: var(--color-slate-300); margin-bottom: 12px;
}
.chart-empty-title { font-size: 14px; font-weight: 600; color: var(--color-slate-500); margin-bottom: 4px; }
.chart-empty-text  { font-size: 12px; color: var(--color-slate-400); max-width: 220px; line-height: 1.5; }

.chart-skeleton {
  background: linear-gradient(90deg, var(--color-slate-100) 25%, var(--color-slate-50) 50%, var(--color-slate-100) 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

/* ═══════════════════════════════════════════════════════════════════
   АНАЛИТИЧЕСКИЕ СЕКЦИИ
   ═══════════════════════════════════════════════════════════════════ */
.analytics-section { background: white; border-radius: var(--radius); box-shadow: var(--shadow-sm); border: 1px solid rgba(0,0,0,.04); overflow: hidden; margin-bottom: 20px; }
.analytics-section-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 12px; border-bottom: 1px solid var(--color-slate-100); }
.analytics-section-title { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--color-slate-800); margin: 0; }
.analytics-section-title i { font-size: 16px; }
.analytics-section-body { padding: 16px 20px; }
.analytics-section-body--no-pad { padding: 0; }

/* ═══════════════════════════════════════════════════════════════════
   РЕЙТИНГ МЕНЕДЖЕРОВ
   ═══════════════════════════════════════════════════════════════════ */
.manager-rating-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  border-bottom: 1px solid var(--color-slate-50);
  transition: background-color var(--duration-fast) var(--ease-out);
}
.manager-rating-row:last-child { border-bottom: none; }
.manager-rating-row:hover { background: var(--color-slate-50); }

.manager-rank { width: 28px; height: 28px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; flex-shrink: 0; background: var(--color-slate-100); color: var(--color-slate-500); }
.manager-rank--gold   { background: #fef9c3; color: #b45309; }
.manager-rank--silver { background: #f1f5f9; color: #475569; }
.manager-rank--bronze { background: #ffedd5; color: #c2410c; }

.manager-info  { flex: 1; min-width: 0; }
.manager-name  { font-size: 13px; font-weight: 600; color: var(--color-slate-800); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.manager-meta  { font-size: 11px; color: var(--color-slate-500); margin-top: 1px; }
.manager-stats { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.manager-kpi   { text-align: right; }
.manager-kpi-v { font-size: 13px; font-weight: 700; color: var(--color-slate-800); line-height: 1.2; }
.manager-kpi-l { font-size: 10px; color: var(--color-slate-400); }

.win-rate-bar  { height: 6px; border-radius: var(--radius-full); background: var(--color-slate-100); overflow: hidden; min-width: 60px; }
.win-rate-fill { height: 100%; border-radius: var(--radius-full); transition: width var(--duration-slow) var(--ease-out); }
.win-rate-fill--high   { background: #16a34a; }
.win-rate-fill--medium { background: #f59e0b; }
.win-rate-fill--low    { background: #ef4444; }

.le-stat-row {
  padding: 10px 16px; border-bottom: 1px solid var(--color-slate-50);
  transition: background-color var(--duration-fast) var(--ease-out);
}
.le-stat-row:last-child { border-bottom: none; }
.le-stat-row:hover { background: var(--color-slate-50); }

/* ═══════════════════════════════════════════════════════════════════
   ЗАСТРЯВШИЕ ЗАКУПКИ
   ═══════════════════════════════════════════════════════════════════ */
.stale-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 16px;
  border-bottom: 1px solid var(--color-slate-50);
  text-decoration: none; color: inherit;
  transition: background-color var(--duration-fast) var(--ease-out);
}
.stale-item:last-child { border-bottom: none; }
.stale-item:hover { background: var(--color-slate-50); }

.stale-days     { min-width: 40px; text-align: center; flex-shrink: 0; }
.stale-days-num { font-size: 18px; font-weight: 800; line-height: 1; }
.stale-days-lbl { font-size: 9px; text-transform: uppercase; letter-spacing: .5px; }
.stale-days--critical .stale-days-num { color: #dc2626; }
.stale-days--warning  .stale-days-num { color: #d97706; }
.stale-days--normal   .stale-days-num { color: var(--color-slate-500); }

/* ═══════════════════════════════════════════════════════════════════
   WORKFLOW PANEL
   ═══════════════════════════════════════════════════════════════════ */
.wf-col { min-height: 320px; font-size: 13px; line-height: 1.35; color: var(--color-slate-800); }
.wf-col-title    { font-size: 13px; line-height: 1.25; color: var(--color-slate-900); }
.wf-col-subtitle { font-size: 11px; line-height: 1.25; color: var(--color-slate-500); }
.wf-col-subtitle--danger { color: #b91c1c; font-weight: 600; }
.wf-col-border { border-right: 1px solid var(--color-slate-200); }
@media (max-width: 1199.98px) { .wf-col-border { border-right: none; border-bottom: 1px solid var(--color-slate-200); } }
.wf-col-icon { width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0; }

.wf-section-inline-icon  { font-size: 12px; }
.wf-section-inline-title { font-size: 12px; line-height: 1.2; color: var(--color-slate-900); }
.wf-mini-badge { font-size: 9px; line-height: 1; }

.wf-summary-bar { display: flex; align-items: center; gap: 16px; padding: 14px 20px; flex-wrap: nowrap; overflow-x: auto; overflow-y: visible; border-bottom: 1px solid var(--color-slate-200); background: white; scrollbar-width: thin; }
.wf-summary-bar::-webkit-scrollbar { height: 4px; }
.wf-summary-bar::-webkit-scrollbar-thumb { background: var(--color-slate-300); border-radius: var(--radius-full); }

.wf-summary-item  { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; white-space: nowrap; }
.wf-summary-label { font-size: 12px; color: var(--color-slate-500); font-weight: 500; }
.wf-summary-sep   { width: 1px; height: 20px; background: var(--color-slate-200); flex-shrink: 0; }
.wf-summary-action { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--color-slate-500); flex-shrink: 0; padding-left: 12px; }
.wf-summary-action i { color: var(--color-primary-light); font-size: 14px; }

.wf-badge { display: inline-flex; align-items: center; font-size: 11px; font-weight: 600; line-height: 1; padding: 4px 9px; border-radius: var(--radius-full); white-space: nowrap; letter-spacing: .1px; transition: background-color var(--duration-fast) var(--ease-out); }

.wf-badge--status-found       { background: #f1f5f9; color: var(--color-found); border: 1px solid #e2e8f0; }
.wf-badge--status-analysis    { background: #e0f2fe; color: #0369a1; }
.wf-badge--status-preparation { background: #fef9c3; color: #a16207; }
.wf-badge--status-submitted   { background: #dbeafe; color: #1e40af; }
.wf-badge--status-trading     { background: #ede9fe; color: #5b21b6; }
.wf-badge--status-won         { background: #cffafe; color: #0e7490; }
.wf-badge--status-contract    { background: #dbeafe; color: #1d4ed8; }
.wf-badge--status-execution   { background: #ffedd5; color: #c2410c; }
.wf-badge--status-closed      { background: #dcfce7; color: #15803d; }
.wf-badge--status-lost        { background: #fee2e2; color: #b91c1c; }
.wf-badge--status-declined    { background: #f1f5f9; color: #475569; }

.wf-badge--exec-not_started        { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }
.wf-badge--exec-supplier_order     { background: #e0f2fe; color: #0369a1; }
.wf-badge--exec-supplier_delivery  { background: #fef9c3; color: #a16207; }
.wf-badge--exec-ready_for_delivery { background: #dbeafe; color: #1e40af; }
.wf-badge--exec-customer_delivery  { background: #ffedd5; color: #c2410c; }
.wf-badge--exec-pnr                { background: #ede9fe; color: #5b21b6; }
.wf-badge--exec-acceptance         { background: #ccfbf1; color: #0f766e; }
.wf-badge--exec-completed          { background: #dcfce7; color: #15803d; }

.wf-badge--sup-not_required { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }
.wf-badge--sup-not_paid     { background: #fee2e2; color: #b91c1c; }
.wf-badge--sup-partial_paid { background: #fef9c3; color: #a16207; }
.wf-badge--sup-fully_paid   { background: #dcfce7; color: #15803d; }
.wf-badge--sup-overdue      { background: #fee2e2; color: #b91c1c; }

.wf-badge--cust-not_required     { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }
.wf-badge--cust-waiting_payment  { background: #fef9c3; color: #a16207; }
.wf-badge--cust-partial_received { background: #fef9c3; color: #a16207; }
.wf-badge--cust-fully_received   { background: #dcfce7; color: #15803d; }
.wf-badge--cust-overdue          { background: #fee2e2; color: #b91c1c; }

.wf-badge--danger { background: #fee2e2 !important; color: #b91c1c !important; animation: pulseGlow 2s ease-in-out infinite; }
.wf-badge--warn   { background: #fef9c3 !important; color: #a16207 !important; }

.wf-steps-scroll {
  display: flex; align-items: center; gap: 4px;
  overflow-x: auto; overflow-y: visible;
  padding: 4px 2px 8px; scrollbar-width: thin;
  scrollbar-color: var(--color-slate-300) transparent; background: white;
}
.wf-steps-scroll::-webkit-scrollbar { height: 4px; }
.wf-steps-scroll::-webkit-scrollbar-thumb { background: var(--color-slate-300); border-radius: 2px; }

.wf-step-card {
  display: inline-flex; align-items: center; gap: 5px; flex: 0 0 auto;
  min-width: 0; padding: 5px 10px; border-radius: var(--radius-full);
  font-size: 11px; font-weight: 500; white-space: nowrap; cursor: default;
  transition:
    background-color var(--duration-fast) var(--ease-out),
    color            var(--duration-fast) var(--ease-out);
  border: 1px solid transparent;
}
.wf-step-card__icon  { display: inline-flex; align-items: center; justify-content: center; font-size: 10px; line-height: 1; flex-shrink: 0; }
.wf-step-card__label { font-size: 11px; line-height: 1.2; max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.wf-step-card__sep   { color: var(--color-slate-300); font-size: 13px; flex-shrink: 0; line-height: 1; user-select: none; }

.wf-step-card--done         { background: #dcfce7; color: #15803d; border-color: #bbf7d0; }
.wf-step-card--current      { background: var(--color-primary-light); color: white; font-weight: 600; box-shadow: 0 2px 8px rgba(45,90,158,.25); }
.wf-step-card--exec-current { background: var(--color-accent); color: white; font-weight: 600; box-shadow: 0 2px 8px rgba(14,165,233,.25); }
.wf-step-card--upcoming     { background: var(--color-slate-50); color: var(--color-slate-400); border-color: var(--color-slate-200); }
.wf-step-card--fail         { background: #fee2e2; color: #b91c1c; border-color: #fecaca; font-weight: 600; }

.wf-matrix { display: flex; flex-direction: column; background: white; border: 1px solid var(--color-slate-200); border-radius: var(--radius-sm); overflow: hidden; }
.wf-matrix-head,
.wf-matrix-row  { display: grid; align-items: center; gap: 8px; padding: 8px 10px; }
.wf-matrix-head { font-size: 10px; text-transform: uppercase; letter-spacing: .5px; color: var(--color-slate-400); border-bottom: 1px solid var(--color-slate-100); background: white; }
.wf-matrix-head--simple    { grid-template-columns: minmax(0,1fr) 140px 24px; }
.wf-matrix-head--logistics { grid-template-columns: minmax(0,1fr) 96px 96px 24px; }
.wf-matrix-head__label,
.wf-matrix-head__col  { font-size: 10px; font-weight: 700; color: var(--color-slate-400); white-space: nowrap; line-height: 1; }
.wf-matrix-head__col  { text-align: right; }

.wf-matrix-row {
  transition: background-color var(--duration-fast) var(--ease-out);
  border-top: 1px solid var(--color-slate-100);
}
.wf-matrix-row:first-of-type { border-top: none; }
.wf-matrix-row:hover { background: var(--color-slate-50); }
.wf-matrix-row--focus,
.wf-matrix-row--payment   { grid-template-columns: minmax(0,1fr) minmax(120px,max-content) 24px; }
.wf-matrix-row--logistics { grid-template-columns: minmax(0,1fr) 96px 96px 24px; }

.wf-matrix-row__label  { font-size: 12px; color: var(--color-slate-700); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.wf-matrix-row__value  { font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; justify-self: end; color: var(--color-slate-800); line-height: 1.2; }
.wf-matrix-row__value--success { color: #15803d; font-weight: 600; }
.wf-matrix-row__value--warn    { color: #a16207; font-weight: 600; }
.wf-matrix-row__value--danger  { color: #b91c1c; font-weight: 600; }
.wf-matrix-row__value--empty   { color: var(--color-slate-300); font-weight: 400; }
.wf-matrix-row__action { width: 24px; display: flex; align-items: center; justify-content: flex-end; }

.wf-edit-btn {
  width: 22px; height: 22px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid transparent;
  border-radius: var(--radius-sm); color: var(--color-slate-400);
  cursor: pointer; padding: 0;
  transition:
    background-color var(--duration-fast) var(--ease-out),
    border-color     var(--duration-fast) var(--ease-out),
    color            var(--duration-fast) var(--ease-out),
    transform        var(--duration-fast) var(--ease-spring);
}
.wf-edit-btn:hover  { background: var(--color-primary-50); border-color: var(--color-primary-100); color: var(--color-primary-light); }
.wf-edit-btn:active { transform: scale(.92); }
.wf-edit-btn i      { font-size: 11px; }

.wf-focus        { background: var(--color-slate-50); border-radius: var(--radius-sm); padding: 8px 10px; }
.wf-section-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--color-slate-500); }
.wf-inline-btn {
  display: inline-flex; align-items: center; gap: 3px; font-size: 10px; font-weight: 600;
  color: var(--color-primary-light); background: var(--color-primary-50);
  border: 1px solid var(--color-primary-100); border-radius: var(--radius-full);
  padding: 2px 8px; cursor: pointer;
  transition:
    background-color var(--duration-fast) var(--ease-out),
    border-color     var(--duration-fast) var(--ease-out);
  white-space: nowrap; flex-shrink: 0;
}
.wf-inline-btn:hover { background: var(--color-primary-100); border-color: var(--color-primary-light); }

.wf-details-btn {
  display: flex; align-items: center; width: 100%; padding: 5px 10px;
  font-size: 11px; font-weight: 500; border-radius: var(--radius-sm);
  cursor: pointer; border: 1px solid; list-style: none; background: white;
  transition: background-color var(--duration-fast) var(--ease-out);
}
.wf-details-btn::-webkit-details-marker { display: none; }
.wf-details-btn--warning { color: #a16207; border-color: #fde68a; }
.wf-details-btn--warning:hover { background: #fef9c3; }
.wf-details-btn--success { color: #15803d; border-color: #bbf7d0; }
.wf-details-btn--success:hover { background: #f0fdf4; }

/* ═══════════════════════════════════════════════════════════════════
   VIEWS SWITCHER
   ═══════════════════════════════════════════════════════════════════ */
.views-switcher-wrap {
  border-bottom: 1px solid var(--color-slate-200);
  background: white; border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: var(--shadow-sm); padding: 0 4px;
}

.views-switcher {
  display: flex; align-items: stretch; gap: 0;
  overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none;
}
.views-switcher::-webkit-scrollbar { display: none; }

.views-switcher--pill {
  background: var(--color-slate-100);
  border-radius: var(--radius-sm);
  padding: 3px;
  align-items: center;
  gap: 2px;
}

.view-tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 12px 16px; font-size: 13px; font-weight: 500;
  color: var(--color-slate-500); text-decoration: none;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition:
    color            var(--duration-fast) var(--ease-out),
    background-color var(--duration-fast) var(--ease-out);
  position: relative; cursor: pointer;
}
.view-tab:hover  { color: var(--color-primary-light); background: var(--color-primary-50); }
.view-tab.active {
  color: var(--color-primary-light); border-bottom-color: var(--color-primary-light);
  font-weight: 600; background: transparent;
}

.views-switcher--pill .view-tab {
  padding: 5px 12px; border-radius: var(--radius-sm);
  border-bottom: 2px solid transparent; font-size: 13px;
}
.views-switcher--pill .view-tab:hover  { background: white; color: var(--color-primary); }
.views-switcher--pill .view-tab.active {
  background: white; color: var(--color-primary-light);
  border-bottom-color: transparent; font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.view-tab-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: var(--radius-full); font-size: 11px; font-weight: 700;
  background: var(--color-slate-100); color: var(--color-slate-600);
  transition:
    background-color var(--duration-fast) var(--ease-out),
    color            var(--duration-fast) var(--ease-out);
  line-height: 1;
}
.view-tab.active .view-tab-count { background: var(--color-primary-100); color: var(--color-primary-light); }
.view-tab-count-success { background: #dcfce7 !important; color: #15803d !important; }

.view-tab-urgent { color: var(--color-lost); }
.view-tab-urgent:hover  { color: var(--color-lost); background: #fff1f2; }
.view-tab-urgent.active { color: var(--color-lost); border-bottom-color: var(--color-lost); }
.view-tab-urgent .view-tab-count        { background: #fee2e2; color: var(--color-lost); }
.view-tab-urgent.active .view-tab-count { background: #fee2e2; color: var(--color-lost); }

/* ═══════════════════════════════════════════════════════════════════
   ТАБЛИЦА ЗАКУПОК — STICKY
   ═══════════════════════════════════════════════════════════════════ */
.procurement-table-wrap {
  position: relative; max-width: 100%;
  overflow-x: auto; overflow-y: visible;
  background: white; isolation: isolate;
  scrollbar-gutter: stable;
  border-radius: 0 0 var(--radius) var(--radius);
  contain: layout style;
}
.procurement-table { font-size: 13px; border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; }

.procurement-table thead th {
  position: sticky; top: 0; z-index: 60;
  background: linear-gradient(180deg, #ffffff 0%, var(--color-slate-50) 100%);
  color: var(--color-slate-600); font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .6px; white-space: nowrap;
  border-bottom: 1px solid var(--color-slate-200);
  background-clip: padding-box;
  box-shadow: 0 1px 0 rgba(15,23,42,.04), 0 2px 10px rgba(15,23,42,.04);
}
.procurement-table thead th[data-col-key] { padding: 0; }
.procurement-table thead th.col-sticky    { z-index: 80; }
.procurement-table tbody td { padding: 10px 12px; vertical-align: middle; border-bottom: 1px solid var(--color-slate-100); transition: background-color var(--duration-fast) var(--ease-out); }
.procurement-table tbody tr { transition: background-color var(--duration-fast) var(--ease-out); }
.procurement-table tbody tr:hover td { background: var(--color-primary-50) !important; }

.col-sticky { position: sticky; background: white; z-index: 30; background-clip: padding-box; }
thead .col-sticky { z-index: 80; background: linear-gradient(180deg, #ffffff 0%, var(--color-slate-50) 100%); }
tbody .col-sticky { box-shadow: 4px 0 12px -10px rgba(15,23,42,.3); }
.procurement-table tbody tr:hover .col-sticky { background: var(--color-primary-50) !important; }

.procurement-row.row-urgent:hover   .col-sticky { background: #fff5f5 !important; }
.procurement-row.row-critical:hover .col-sticky { background: #fffbeb !important; }
.procurement-row.row-urgent   td:first-child::before,
.procurement-row.row-critical td:first-child::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; border-radius: 0 2px 2px 0; }
.procurement-row.row-urgent   td:first-child::before { background: #ef4444; }
.procurement-row.row-critical td:first-child::before { background: #f59e0b; }
.procurement-row.row-urgent:hover   td { background: #fff5f5 !important; }
.procurement-row.row-critical:hover td { background: #fffbeb !important; }

.sort-th .th-cell,
thead th[data-col-key] .th-cell { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 44px; width: 100%; padding: 10px 12px; }
.sort-link {
  display: flex; align-items: center; gap: 4px; flex: 1 1 auto; min-width: 0; padding: 0;
  color: var(--color-slate-600); text-decoration: none; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .6px; white-space: nowrap;
  transition: color var(--duration-fast) var(--ease-out);
}
.sort-link:hover  { color: var(--color-primary-light); }
.sort-icon-idle   { color: var(--color-slate-300); font-size: 12px; flex-shrink: 0; }
.sort-icon-active { color: var(--color-primary-light); font-size: 12px; flex-shrink: 0; }

.sticky-pin-btn {
  width: 24px; height: 24px; flex: 0 0 24px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px; border: 1px solid var(--color-slate-200);
  background: white; color: var(--color-slate-400); padding: 0;
  transition:
    background-color var(--duration-fast) var(--ease-out),
    border-color     var(--duration-fast) var(--ease-out),
    color            var(--duration-fast) var(--ease-out),
    box-shadow       var(--duration-normal) var(--ease-out);
}
.sticky-pin-btn:hover  { background: var(--color-primary-50); border-color: var(--color-primary-100); color: var(--color-primary-light); }
.sticky-pin-btn.active { background: var(--color-primary-light); border-color: var(--color-primary-light); color: white; box-shadow: 0 2px 8px rgba(45,90,158,.2); }

.table-loading-overlay { position: absolute; inset: 0; background: rgba(255,255,255,.65); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); display: flex; align-items: center; justify-content: center; z-index: 120; opacity: 0; pointer-events: none; transition: opacity var(--duration-fast); border-radius: 0 0 var(--radius) var(--radius); }
.htmx-request .table-loading-overlay { opacity: 1; pointer-events: all; }
.table-loading-spinner { display: flex; flex-direction: column; align-items: center; gap: 10px; background: white; border-radius: var(--radius); padding: 20px 28px; box-shadow: var(--shadow-lg); border: 1px solid var(--color-slate-200); }
.table-loading-spinner span { font-size: 12px; font-weight: 500; color: var(--color-slate-500); }
.htmx-indicator { display: none !important; }

/* ═══════════════════════════════════════════════════════════════════
   СТАТУС В ТАБЛИЦЕ
   ═══════════════════════════════════════════════════════════════════ */
.proc-status-block { display: flex; flex-direction: column; gap: 4px; }
.proc-status-row   { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.proc-status-chip  { font-size: 10px !important; padding: 2px 7px !important; }

/* ═══════════════════════════════════════════════════════════════════
   EMPTY STATE
   ═══════════════════════════════════════════════════════════════════ */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 64px 24px; text-align: center; }
.empty-state-icon  { width: 72px; height: 72px; background: var(--color-slate-100); border-radius: var(--radius-xl); display: flex; align-items: center; justify-content: center; font-size: 32px; color: var(--color-slate-400); margin-bottom: 16px; }
.empty-state-title { font-size: 16px; font-weight: 600; color: var(--color-slate-700); margin-bottom: 6px; }
.empty-state-text  { font-size: 13px; color: var(--color-slate-400); max-width: 320px; line-height: 1.5; }

/* ═══════════════════════════════════════════════════════════════════
   ROW ACTIONS
   ═══════════════════════════════════════════════════════════════════ */
.row-actions-cell { opacity: 0; transition: opacity var(--duration-fast); }
.procurement-row:hover .row-actions-cell { opacity: 1; }
@media (hover: none) { .row-actions-cell { opacity: 1; } }
.row-actions-btn {
  width: 28px; height: 28px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--color-slate-400);
  transition:
    background-color var(--duration-fast) var(--ease-out),
    color            var(--duration-fast) var(--ease-out);
}
.row-actions-btn:hover { background: var(--color-slate-100); color: var(--color-slate-700); }

/* ═══════════════════════════════════════════════════════════════════
   АВАТАРЫ — базовые
   ═══════════════════════════════════════════════════════════════════ */
.employee-avatar-sm, .employee-avatar-lg, .employee-avatar-xl,
.user-avatar-sm, .user-avatar-lg, .user-avatar-xl {
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  color: white; font-weight: 700; flex-shrink: 0;
  transition:
    transform  var(--duration-normal) var(--ease-spring),
    box-shadow var(--duration-normal) var(--ease-out);
  box-shadow: 0 2px 8px rgba(30,58,95,.2);
}
.employee-avatar-sm, .user-avatar-sm { width: 32px; height: 32px; font-size: 12px; }
.employee-avatar-lg, .user-avatar-lg { width: 56px; height: 56px; font-size: 20px; }
.employee-avatar-xl, .user-avatar-xl { width: 80px; height: 80px; font-size: 28px; }

/* ═══════════════════════════════════════════════════════════════════
   КАРТОЧКИ СОТРУДНИКОВ v2
   ═══════════════════════════════════════════════════════════════════ */
.emp-card-v2 {
  position: relative; overflow: hidden;
  border: 1px solid var(--color-slate-200);
  border-radius: var(--radius-lg);
  background: white;
  display: flex; flex-direction: column; align-items: center;
  padding: 0 20px 20px;
  transition:
    transform    var(--duration-normal) var(--ease-spring),
    box-shadow   var(--duration-normal) var(--ease-out),
    border-color var(--duration-normal) var(--ease-out);
}
.emp-card-v2:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg) !important;
  border-color: transparent !important;
}
.emp-card-v2--inactive         { opacity: .7; }
.emp-card-v2--inactive:hover   { opacity: 1; }

/* Stretched link */
.emp-card-v2__link { position: absolute; inset: 0; z-index: 1; }

/* Цветная полоса по уровню доступа */
.emp-card-v2__strip { height: 3px; width: 100%; background: var(--color-slate-200); }
.emp-strip-admin    { background: linear-gradient(90deg, #7c3aed, #a78bfa); }
.emp-strip-employee { background: linear-gradient(90deg, #0284c7, #38bdf8); }
.emp-strip-observer { background: linear-gradient(90deg, #94a3b8, #cbd5e1); }

/* Аватар */
.emp-card-v2__avatar-wrap { position: relative; margin-top: 24px; margin-bottom: 12px; }
.emp-card-v2__avatar {
  width: 64px; height: 64px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  color: white;
  box-shadow: 0 4px 12px rgba(30,58,95,.2);
}
.emp-avatar-admin {
  background: linear-gradient(135deg, #7c3aed, #a78bfa);
  box-shadow: 0 4px 12px rgba(124,58,237,.3);
}
.emp-avatar-employee {
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  box-shadow: 0 4px 12px rgba(2,132,199,.3);
}
.emp-avatar-observer {
  background: linear-gradient(135deg, #94a3b8, #64748b);
  box-shadow: 0 4px 12px rgba(100,116,139,.2);
}

/* Имя */
.emp-card-v2__name {
  font-size: 14px; font-weight: 700; color: var(--color-slate-900);
  text-align: center; margin: 0 0 8px; line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}

/* Бейдж уровня */
.emp-card-v2__role-wrap {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  justify-content: center; margin-bottom: 12px;
}
.emp-role-admin    { background: #ede9fe; color: #7c3aed; border: 1px solid #ddd6fe; font-size:11px; font-weight:600; padding:3px 9px; border-radius:20px; display:inline-block; }
.emp-role-employee { background: #dbeafe; color: #0284c7; border: 1px solid #bfdbfe; font-size:11px; font-weight:600; padding:3px 9px; border-radius:20px; display:inline-block; }
.emp-role-observer { background: #f1f5f9; color: #64748b; border: 1px solid #e2e8f0; font-size:11px; font-weight:600; padding:3px 9px; border-radius:20px; display:inline-block; }

.emp-card-v2__inactive-pill {
  font-size: 10px; font-weight: 600;
  background: var(--color-slate-100); color: var(--color-slate-500);
  border: 1px solid var(--color-slate-200);
  padding: 2px 8px; border-radius: 20px;
}

/* Иконка финансового доступа */
.emp-card-v2__financials-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%;
  background: #dcfce7; color: #15803d;
  font-size: 10px; margin-left: 4px; flex-shrink: 0;
  vertical-align: middle;
}

/* Инфо блок */
.emp-card-v2__info {
  width: 100%; display: flex; flex-direction: column; gap: 4px;
  margin-bottom: 12px; min-height: 40px;
}
.emp-card-v2__info-row {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--color-slate-500);
}
.emp-card-v2__info-row i { font-size: 11px; flex-shrink: 0; opacity: .6; }

/* Бейдж нагрузки */
.emp-card-v2__workload {
  min-height: 28px; display: flex; align-items: center;
  justify-content: center; width: 100%;
}
.emp-card-v2__workload-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600;
  background: var(--color-primary-50); color: var(--color-primary-light);
  border: 1px solid var(--color-primary-100);
  padding: 3px 10px; border-radius: 20px;
  position: relative; z-index: 2;
}

/* Футер — контакты */
.emp-card-v2__footer {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  justify-content: center; padding-top: 12px;
  border-top: 1px solid var(--color-slate-100); width: 100%;
  margin-top: auto; position: relative; z-index: 2;
}
.emp-card-v2__footer-empty { font-size: 11px; color: var(--color-slate-400); }
.emp-card-v2__contact {
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  background: var(--color-slate-50); border: 1px solid var(--color-slate-200);
  color: var(--color-slate-500); font-size: 14px; text-decoration: none;
  transition:
    background-color var(--duration-fast) var(--ease-out),
    border-color     var(--duration-fast) var(--ease-out),
    color            var(--duration-fast) var(--ease-out),
    transform        var(--duration-fast) var(--ease-spring);
}
.emp-card-v2__contact:hover  { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.emp-contact-phone:hover     { background: #dcfce7; border-color: #86efac; color: #15803d; }
.emp-contact-whatsapp:hover  { background: #dcfce7; border-color: #86efac; color: #15803d; }
.emp-contact-email:hover     { background: #dbeafe; border-color: #93c5fd; color: #1d4ed8; }

/* ═══════════════════════════════════════════════════════════════════
   EMPLOYEE HERO — шапка детальной карточки + профиля
   ═══════════════════════════════════════════════════════════════════ */
.employee-hero {
  position: relative;
  border-radius: var(--radius-lg);
  padding: 28px 28px 24px;
  margin-bottom: 20px;
  color: white;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
}
.employee-hero::before {
  content: ''; position: absolute;
  top: -60%; right: -10%; width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(255,255,255,.12) 0%, transparent 70%);
  pointer-events: none;
}
.employee-hero::after {
  content: ''; position: absolute;
  bottom: -40%; left: -10%; width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(255,255,255,.06) 0%, transparent 70%);
  pointer-events: none;
}

/* Hero по уровню доступа */
.employee-hero--admin    { background: linear-gradient(135deg, #5b21b6 0%, #7c3aed 50%, #a78bfa 100%); }
.employee-hero--employee { background: linear-gradient(135deg, #0c4a6e 0%, #0284c7 50%, #38bdf8 100%); }
.employee-hero--observer { background: linear-gradient(135deg, #334155 0%, #475569 50%, #94a3b8 100%); }

.employee-hero__inner {
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: 24px;
  flex-wrap: wrap;
}

.employee-hero__avatar {
  width: 96px; height: 96px;
  border-radius: 50%;
  background: rgba(255,255,255,.2);
  border: 3px solid rgba(255,255,255,.3);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; font-weight: 700;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 8px 24px rgba(0,0,0,.15);
}

.employee-hero__info { flex: 1; min-width: 240px; }

.employee-hero__name {
  font-size: 26px; font-weight: 800; line-height: 1.2;
  margin: 0 0 8px; color: white;
  letter-spacing: -.4px;
  text-shadow: 0 1px 2px rgba(0,0,0,.1);
}
.employee-hero__position {
  font-size: 14px; color: rgba(255,255,255,.85);
  margin-bottom: 12px; font-weight: 500;
}

.employee-hero__meta {
  display: flex; flex-wrap: wrap; gap: 8px;
  align-items: center;
}
.employee-hero__meta-item {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: rgba(255,255,255,.85);
  padding: 4px 10px;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: var(--radius-full);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.employee-hero__meta-item i { font-size: 11px; opacity: .9; }
.employee-hero__meta-item--inactive {
  background: rgba(239,68,68,.25);
  border-color: rgba(239,68,68,.4);
}

.employee-hero__actions {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-left: auto;
}
@media (max-width: 767.98px) {
  .employee-hero { padding: 22px 20px 20px; }
  .employee-hero__inner { gap: 16px; }
  .employee-hero__avatar { width: 72px; height: 72px; font-size: 28px; }
  .employee-hero__name { font-size: 20px; }
  .employee-hero__actions { margin-left: 0; width: 100%; }
}

.employee-hero__action {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: var(--radius-sm);
  color: white; font-size: 12.5px; font-weight: 500;
  text-decoration: none; cursor: pointer;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition:
    background-color var(--duration-fast) var(--ease-out),
    border-color     var(--duration-fast) var(--ease-out),
    transform        var(--duration-fast) var(--ease-spring);
}
.employee-hero__action:hover {
  background: rgba(255,255,255,.28);
  border-color: rgba(255,255,255,.4);
  color: white;
  transform: translateY(-1px);
}
.employee-hero__action--danger {
  background: rgba(239,68,68,.25);
  border-color: rgba(239,68,68,.4);
}
.employee-hero__action--danger:hover {
  background: rgba(239,68,68,.4);
  border-color: rgba(239,68,68,.6);
}

/* ═══════════════════════════════════════════════════════════════════
   CONTACT ACTIONS
   ═══════════════════════════════════════════════════════════════════ */
.contact-action {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  background: var(--color-slate-50);
  border: 1px solid var(--color-slate-200);
  color: var(--color-slate-500);
  text-decoration: none;
  font-size: 15px;
  transition:
    background-color var(--duration-fast) var(--ease-out),
    border-color     var(--duration-fast) var(--ease-out),
    color            var(--duration-fast) var(--ease-out),
    transform        var(--duration-fast) var(--ease-spring);
}
.contact-action:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.contact-action--phone:hover    { background: #dcfce7; border-color: #86efac; color: #15803d; }
.contact-action--email:hover    { background: #dbeafe; border-color: #93c5fd; color: #1d4ed8; }
.contact-action--telegram:hover { background: #e0f2fe; border-color: #7dd3fc; color: #0369a1; }
.contact-action--whatsapp:hover { background: #dcfce7; border-color: #86efac; color: #15803d; }

.contact-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.contact-row .contact-action { width: 30px; height: 30px; font-size: 13px; }

/* ═══════════════════════════════════════════════════════════════════
   INFO PANEL
   ═══════════════════════════════════════════════════════════════════ */
.info-panel {
  background: white;
  border: 1px solid var(--color-slate-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 16px;
}
.info-panel__header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 14px 18px;
  border-bottom: 1px solid var(--color-slate-100);
  background: var(--color-slate-50);
}
.info-panel__title {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700;
  color: var(--color-slate-700);
  text-transform: uppercase;
  letter-spacing: .4px;
  margin: 0;
}
.info-panel__title i { font-size: 14px; color: var(--color-primary-light); }
.info-panel__counter {
  font-size: 12px; font-weight: 600;
  color: var(--color-slate-500);
  background: white;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-slate-200);
}
.info-panel__body { padding: 16px 18px; }
.info-panel__body--no-pad { padding: 0; }
.info-panel__footer {
  padding: 10px 18px;
  border-top: 1px solid var(--color-slate-100);
  background: var(--color-slate-50);
  font-size: 12px;
  text-align: center;
}

/* Список метаданных */
.meta-list { display: flex; flex-direction: column; gap: 4px; }
.meta-list__item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--color-slate-50);
}
.meta-list__item:last-child { border-bottom: none; }
.meta-list__icon {
  width: 28px; height: 28px;
  border-radius: var(--radius-sm);
  background: var(--color-slate-50);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: var(--color-slate-500);
  font-size: 13px;
}
.meta-list__label {
  font-size: 11px;
  color: var(--color-slate-400);
  text-transform: uppercase;
  letter-spacing: .3px;
  margin-bottom: 1px;
}
.meta-list__value {
  font-size: 13px;
  color: var(--color-slate-800);
  font-weight: 500;
  word-break: break-word;
}
.meta-list__value a { color: var(--color-primary-light); text-decoration: none; }
.meta-list__value a:hover { text-decoration: underline; }
.meta-list__body { flex: 1; min-width: 0; }

/* Юрлицо в info-panel */
.le-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: var(--color-slate-50);
  border: 1px solid var(--color-slate-200);
  border-radius: var(--radius-sm);
  transition: background-color var(--duration-fast) var(--ease-out);
}
.le-chip:hover { background: var(--color-primary-50); border-color: var(--color-primary-100); }
.le-chip__icon {
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  background: white;
  border: 1px solid var(--color-slate-200);
  display: flex; align-items: center; justify-content: center;
  color: var(--color-primary-light);
  flex-shrink: 0;
}
.le-chip__body { min-width: 0; flex: 1; }
.le-chip__name {
  font-size: 13px; font-weight: 600;
  color: var(--color-slate-800);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.le-chip__inn {
  font-size: 11px;
  color: var(--color-slate-400);
  font-family: 'JetBrains Mono', 'Courier New', monospace;
}

/* ═══════════════════════════════════════════════════════════════════
   ACTIVE PROCUREMENTS LIST
   ═══════════════════════════════════════════════════════════════════ */
.active-proc-list { display: flex; flex-direction: column; }

.active-proc-item {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--color-slate-50);
  text-decoration: none;
  color: inherit;
  position: relative;
  transition: background-color var(--duration-fast) var(--ease-out);
}
.active-proc-item:last-child { border-bottom: none; }
.active-proc-item:hover { background: var(--color-primary-50); }
.active-proc-item::before {
  content: ''; position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--color-slate-200);
  transition: background-color var(--duration-fast) var(--ease-out);
}
.active-proc-item:hover::before { background: var(--color-primary-light); }
.active-proc-item--urgent::before  { background: #ef4444; }
.active-proc-item--warning::before { background: #f59e0b; }

.active-proc-item__main { flex: 1; min-width: 0; }
.active-proc-item__title {
  font-size: 13.5px; font-weight: 600;
  color: var(--color-slate-800);
  line-height: 1.35;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.active-proc-item__meta {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--color-slate-500);
}
.active-proc-item__number {
  font-family: 'JetBrains Mono', monospace;
  background: var(--color-slate-100);
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10.5px;
  color: var(--color-slate-600);
}

.active-proc-item__right {
  display: flex; flex-direction: column; align-items: flex-end;
  gap: 4px;
  text-align: right;
  flex-shrink: 0;
}
.active-proc-item__price {
  font-size: 13px; font-weight: 700;
  color: var(--color-primary-light);
  font-variant-numeric: tabular-nums;
}
.active-proc-item__deadline {
  font-size: 11px;
  color: var(--color-slate-500);
  display: inline-flex; align-items: center; gap: 4px;
}
.active-proc-item__deadline--urgent  { color: #b91c1c; font-weight: 600; }
.active-proc-item__deadline--warning { color: #a16207; font-weight: 600; }

@media (max-width: 575.98px) {
  .active-proc-item { padding: 12px 14px; gap: 10px; }
  .active-proc-item__right { display: none; }
}

/* ═══════════════════════════════════════════════════════════════════
   БЕЙДЖИ СТАТУСОВ
   ═══════════════════════════════════════════════════════════════════ */
.status-badge {
  display: inline-flex; align-items: center;
  font-size: 11px !important; font-weight: 600 !important;
  padding: 4px 10px !important; border-radius: var(--radius-full) !important;
  white-space: nowrap; letter-spacing: .2px;
  transition: background-color var(--duration-fast) var(--ease-out);
}

.badge-found       { background: #f1f5f9 !important; color: var(--color-found) !important;       border: 1px solid #e2e8f0 !important; }
.badge-analysis    { background: #e0f2fe !important; color: #0369a1 !important; }
.badge-preparation { background: #fef9c3 !important; color: #a16207 !important; }
.badge-submitted   { background: #dbeafe !important; color: #1e40af !important; }
.badge-trading     { background: #ede9fe !important; color: #5b21b6 !important; }
.badge-won         { background: #cffafe !important; color: #0e7490 !important; }
.badge-contract    { background: #dbeafe !important; color: #1d4ed8 !important; }
.badge-execution   { background: #ffedd5 !important; color: #c2410c !important; }
.badge-closed      { background: #dcfce7 !important; color: #15803d !important; }
.badge-danger      { background: #fee2e2 !important; color: #b91c1c !important; }
.badge-secondary   { background: #f1f5f9 !important; color: #475569 !important; }
.badge-dark        { background: #1e293b !important; color: white !important; }
.badge-info        { background: #e0f2fe !important; color: #0369a1 !important; }
.badge-warning     { background: #fef9c3 !important; color: #a16207 !important; }
.badge-primary     { background: #dbeafe !important; color: #1e40af !important; }
.badge-success     { background: #dcfce7 !important; color: #15803d !important; }
.badge-delivery    { background: #ffedd5 !important; color: #c2410c !important; }
.badge-acceptance  { background: #ccfbf1 !important; color: #0f766e !important; }
.badge-payment     { background: #fef9c3 !important; color: #a16207 !important; }

/* Законы */
.badge-law-44-fz  { background: #1d4ed8; color: white; font-size: 10px !important; }
.badge-law-223-fz { background: #0f766e; color: white; font-size: 10px !important; }
.badge-law-615-pp { background: #6d28d9; color: white; font-size: 10px !important; }

/* ═══════════════════════════════════════════════════════════════════
   ДЕТАЛЬНАЯ КАРТОЧКА — ТАБЫ
   ═══════════════════════════════════════════════════════════════════ */
.detail-tabs .nav-link {
  color: var(--color-slate-500); border: none;
  border-bottom: 2px solid transparent; padding: 10px 16px;
  font-weight: 500; font-size: 13px; border-radius: 0;
  transition:
    color               var(--duration-fast) var(--ease-out),
    border-bottom-color var(--duration-fast) var(--ease-out);
}
.detail-tabs .nav-link:hover  { color: var(--color-primary-light); border-bottom-color: var(--color-primary-100); background: transparent; }
.detail-tabs .nav-link.active { color: var(--color-primary-light); border-bottom: 2px solid var(--color-primary-light); background: transparent; font-weight: 600; }
.detail-table td { padding: 8px 0 !important; }
.detail-table tr { border-bottom: 1px solid var(--color-slate-50); }
.detail-table tr:last-child { border-bottom: none; }

/* ═══════════════════════════════════════════════════════════════════
   ЧЕКЛИСТ / TIMELINE / ДЕДЛАЙНЫ
   ═══════════════════════════════════════════════════════════════════ */
.checklist-item {
  transition: background-color var(--duration-fast) var(--ease-out);
  cursor: pointer; border-radius: var(--radius-sm);
}
.checklist-item:hover { background: var(--color-slate-50); }
.checklist-done    { background: #f0fdf4; }
.checklist-pending { background: white; }
.checklist-done:hover { background: #dcfce7; }

.timeline::before { content: ''; position: absolute; left: 11px; top: 8px; bottom: 8px; width: 2px; background: var(--color-slate-200); border-radius: 2px; }
.timeline-dot { width: 24px; height: 24px; border-radius: 50%; border: 3px solid white; box-shadow: 0 0 0 2px var(--color-slate-200); position: relative; z-index: 1; }

.deadline-item     { border-radius: var(--radius-sm) !important; transition: background-color var(--duration-fast) var(--ease-out); }
.deadline-urgent   { border-left: 3px solid var(--color-lost) !important; background: #fff1f2; }
.deadline-critical { border-left: 3px solid var(--color-preparation) !important; background: #fffbeb; }
.deadline-urgent:hover   { background: #fee2e2 !important; }
.deadline-critical:hover { background: #fef3c7 !important; }

/* ═══════════════════════════════════════════════════════════════════
   КАРТОЧКИ (общие переопределения Bootstrap)
   ═══════════════════════════════════════════════════════════════════ */
.card { border-radius: var(--radius) !important; box-shadow: var(--shadow-sm); border: 1px solid rgba(0,0,0,.04) !important; transition: box-shadow var(--duration-normal) var(--ease-out); }
.card-header { background: transparent !important; border-bottom: 1px solid var(--color-slate-100) !important; }

/* ═══════════════════════════════════════════════════════════════════
   ФОРМЫ
   ═══════════════════════════════════════════════════════════════════ */
.form-control, .form-select {
  font-size: 13.5px; border-color: var(--color-slate-200);
  border-radius: var(--radius-sm) !important;
  transition:
    border-color var(--duration-fast) var(--ease-out),
    box-shadow   var(--duration-fast) var(--ease-out);
  padding: 8px 12px;
}
.form-control:focus, .form-select:focus { border-color: var(--color-primary-light); box-shadow: 0 0 0 3px rgba(45,90,158,.1), 0 1px 2px rgba(0,0,0,.06); }
.form-control::placeholder { color: var(--color-slate-400); font-weight: 400; }
.form-label { color: var(--color-slate-700); font-size: 12.5px; font-weight: 500; margin-bottom: 4px; }
.form-check-input:checked { background-color: var(--color-primary-light); border-color: var(--color-primary-light); }
.sticky-bottom { position: sticky; bottom: 0; z-index: 10; border-radius: 0 0 var(--radius) var(--radius); background: white; border-top: 1px solid var(--color-slate-200); box-shadow: 0 -4px 12px rgba(0,0,0,.06); }

.is-invalid-field .form-control,
.is-invalid-field .form-select {
  border-color: #dc3545;
  padding-right: calc(1.5em + .75rem);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c%2fsvg%3e");
  background-repeat: no-repeat;
  background-position: right calc(.375em + .1875rem) center;
  background-size: calc(.75em + .375rem) calc(.75em + .375rem);
}
.is-invalid-field .form-control:focus,
.is-invalid-field .form-select:focus {
  border-color: #dc3545;
  box-shadow: 0 0 0 .25rem rgba(220,53,69,.25);
}

/* ═══════════════════════════════════════════════════════════════════
   ФОРМА СОТРУДНИКА — секции
   ═══════════════════════════════════════════════════════════════════ */
.form-section {
  background: white;
  border: 1px solid var(--color-slate-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 16px;
}
.form-section__header {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--color-slate-100);
  background: var(--color-slate-50);
}
.form-section__header i { font-size: 16px; color: var(--color-primary-light); }
.form-section__title {
  font-size: 13px; font-weight: 700;
  color: var(--color-slate-700);
  text-transform: uppercase; letter-spacing: .4px;
  margin: 0;
}
.form-section__body { padding: 20px; }

.form-actions {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 16px 0 0;
}

/* ═══════════════════════════════════════════════════════════════════
   ФОРМА СОТРУДНИКА — выбор уровня доступа (RadioSelect)
   ═══════════════════════════════════════════════════════════════════ */
.access-level-options { display: flex; flex-direction: column; gap: 8px; }

.access-level-option {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border: 2px solid var(--color-slate-200);
  border-radius: var(--radius-sm);
  background: white; cursor: pointer;
  transition:
    border-color     var(--duration-fast) var(--ease-out),
    background-color var(--duration-fast) var(--ease-out);
}
.access-level-option input[type="radio"] { flex-shrink: 0; }
.access-level-option:hover      { border-color: var(--color-primary-100); background: var(--color-primary-50); }
.access-level-option.is-selected { border-color: var(--color-primary-light); background: var(--color-primary-50); }
.access-level-option__icon   { font-size: 18px; flex-shrink: 0; width: 24px; text-align: center; }
.access-level-option__body   { display: flex; flex-direction: column; gap: 2px; }
.access-level-option__name   { font-size: 13px; font-weight: 600; color: var(--color-slate-800); }
.access-level-option__desc   { font-size: 11px; color: var(--color-slate-500); line-height: 1.35; }

/* ═══════════════════════════════════════════════════════════════════
   ФОРМА СОТРУДНИКА — выбор юрлиц (CheckboxSelectMultiple)
   ═══════════════════════════════════════════════════════════════════ */
.le-option {
  position: relative; display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--color-slate-200); border-radius: var(--radius-sm);
  background: white; cursor: pointer; min-height: 56px;
  transition:
    border-color     var(--duration-fast) var(--ease-out),
    background-color var(--duration-fast) var(--ease-out);
}
.le-option input[type="checkbox"] { flex-shrink: 0; margin-top: 4px; }
.le-option__check  { display: none; }
.le-option__body   { flex: 1; min-width: 0; }
.le-option__name   {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--color-slate-800); line-height: 1.3; word-break: break-word;
}
.le-option__inn    {
  display: block; font-size: 11px; color: var(--color-slate-400);
  font-family: monospace; margin-top: 2px;
}
.le-option.is-checked { border-color: var(--color-primary-light); background: var(--color-primary-50); }
.le-option.is-checked .le-option__name { color: var(--color-primary-light); }

/* ═══════════════════════════════════════════════════════════════════
   КАРТОЧКИ ЮРЛИЦ v2
   ═══════════════════════════════════════════════════════════════════ */
.le-card-v2 {
  background: white;
  border: 1px solid var(--color-slate-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition:
    transform  var(--duration-normal) var(--ease-spring),
    box-shadow var(--duration-normal) var(--ease-out);
}
.le-card-v2:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg) !important; }
.le-card-v2--archived { opacity: .75; }

.le-card-v2__strip          { height: 3px; width: 100%; }
.le-card-v2__strip--active   { background: linear-gradient(90deg, #0284c7, #38bdf8); }
.le-card-v2__strip--archived { background: var(--color-slate-300); }

.le-card-v2__icon-wrap { padding: 20px 20px 0; }
.le-card-v2__icon {
  width: 44px; height: 44px; border-radius: var(--radius);
  background: var(--color-primary-50); color: var(--color-primary-light);
  display: flex; align-items: center; justify-content: center; font-size: 20px;
}
.le-card-v2__name {
  font-size: 14px; font-weight: 700; color: var(--color-slate-900);
  padding: 12px 20px 0; margin: 0; line-height: 1.35;
}
.le-card-v2__inn {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
  font-size: 12px; color: var(--color-slate-500);
  font-family: 'JetBrains Mono', monospace;
  padding: 4px 20px 0; margin-top: 0;
}
.le-card-v2__inn-label { color: var(--color-slate-400); font-size: 11px; }
.le-card-v2__inn-value { color: var(--color-slate-600); font-weight: 500; }
.le-card-v2__inn-sep   { color: var(--color-slate-300); }
.le-card-v2__badge-wrap { padding: 8px 20px 0; }
.le-card-v2__badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 20px;
}
.le-card-v2__badge--active   { background: #dcfce7; color: #15803d; }
.le-card-v2__badge--archived { background: #f1f5f9; color: #475569; }
.le-card-v2__footer {
  margin-top: auto; padding: 16px 20px 20px;
  border-top: 1px solid var(--color-slate-100);
  display: flex; flex-direction: column; gap: 12px;
}
.le-card-v2__stats { display: flex; gap: 20px; }
.le-card-v2__stat  { display: flex; flex-direction: column; gap: 2px; }
.le-card-v2__stat-value         { font-size: 20px; font-weight: 800; color: var(--color-slate-900); line-height: 1; }
.le-card-v2__stat-value--active { color: var(--color-primary-light); }
.le-card-v2__stat-label         { font-size: 11px; color: var(--color-slate-400); }
.le-card-v2__actions { display: flex; gap: 8px; }

/* ═══════════════════════════════════════════════════════════════════
   ПАРОЛЬ — индикатор силы и совпадения
   ═══════════════════════════════════════════════════════════════════ */
.pwd-strength { margin-top: 8px; }
.pwd-strength__bar {
  height: 4px; border-radius: var(--radius-full);
  background: var(--color-slate-100); overflow: hidden; margin-bottom: 4px;
}
.pwd-strength__bar-fill {
  height: 100%; border-radius: var(--radius-full);
  transition:
    width            var(--duration-normal) var(--ease-out),
    background-color var(--duration-normal) var(--ease-out);
}
.pwd-strength__meta {
  display: flex; justify-content: space-between;
  font-size: 11px; font-weight: 600;
}
.pwd-match-hint { font-size: 11px; font-weight: 600; margin-top: 4px; }

/* Блок сгенерированного пароля */
.generated-pwd-box {
  display: none; align-items: center; gap: 8px;
  margin-top: 10px; padding: 10px 12px;
  background: #f0fdf4; border: 1px solid #bbf7d0;
  border-radius: var(--radius-sm);
}
.generated-pwd-box.is-visible { display: flex; }
.generated-pwd-box__label { font-size: 11px; font-weight: 600; color: #15803d; white-space: nowrap; }
.generated-pwd-box__input {
  flex: 1; border: none; background: transparent;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px; color: var(--color-slate-800);
  outline: none; min-width: 0;
}

/* ═══════════════════════════════════════════════════════════════════
   СТРАНИЦА ВХОДА
   ═══════════════════════════════════════════════════════════════════ */
.login-page { background: linear-gradient(135deg, #1e3a5f 0%, #2d5a9e 50%, #0ea5e9 100%); min-height: 100vh; }
.login-card { border-radius: var(--radius-lg) !important; box-shadow: var(--shadow-xl), 0 0 40px rgba(0,0,0,.12) !important; border: 1px solid rgba(255,255,255,.08) !important; }
.login-logo {
  width: 64px; height: 64px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  border-radius: 16px; display: flex; align-items: center; justify-content: center;
  font-size: 28px; color: white; box-shadow: 0 4px 16px rgba(14,165,233,.3);
  transition: transform var(--duration-normal) var(--ease-spring);
}
.login-logo:hover { transform: scale(1.05) rotate(-3deg); }
.login-bg-decor { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.decor-circle { position: absolute; border-radius: 50%; background: rgba(255,255,255,.05); }
.decor-circle-1 { width: 500px; height: 500px; top: -150px; right: -150px; animation: floatSlow 20s ease-in-out infinite; }
.decor-circle-2 { width: 350px; height: 350px; bottom: -80px; left: -100px; animation: floatSlow 25s ease-in-out infinite reverse; }
.decor-circle-3 { width: 200px; height: 200px; top: 40%; left: 25%; animation: floatSlow 18s ease-in-out infinite 5s; }
.login-wrapper  { position: relative; z-index: 1; padding: 20px; }

/* ═══════════════════════════════════════════════════════════════════
   КНОПКИ
   ═══════════════════════════════════════════════════════════════════ */
.btn {
  border-radius: var(--radius-sm) !important; font-weight: 500;
  transition:
    color            var(--duration-fast)   var(--ease-out),
    background-color var(--duration-fast)   var(--ease-out),
    border-color     var(--duration-fast)   var(--ease-out),
    box-shadow       var(--duration-normal) var(--ease-out),
    transform        var(--duration-normal) var(--ease-spring) !important;
  letter-spacing: .1px;
}
.btn:active { transform: scale(.97); }
.btn-primary          { background: var(--color-primary-light) !important; border-color: var(--color-primary-light) !important; box-shadow: 0 1px 3px rgba(45,90,158,.2); }
.btn-primary:hover    { background: var(--color-primary) !important; border-color: var(--color-primary) !important; box-shadow: 0 4px 12px rgba(45,90,158,.25); transform: translateY(-1px); }
.btn-outline-primary:hover  { box-shadow: 0 2px 8px rgba(45,90,158,.15); transform: translateY(-1px); }
.btn-outline-secondary:hover { box-shadow: 0 2px 8px rgba(100,116,139,.15); transform: translateY(-1px); }
.btn-outline-danger:hover   { box-shadow: 0 2px 8px rgba(239,68,68,.15); }
.btn-outline-success:hover  { box-shadow: 0 2px 8px rgba(34,197,94,.15); }
.btn-outline-warning:hover  { box-shadow: 0 2px 8px rgba(245,158,11,.15); }

/* ═══════════════════════════════════════════════════════════════════
   ПРОГРЕСС, ДРОПДАУН, ТОСТЫ, МОДАЛ
   ═══════════════════════════════════════════════════════════════════ */
.progress { border-radius: var(--radius-full); background: var(--color-slate-100); overflow: hidden; }
.progress-bar { border-radius: var(--radius-full); transition: width var(--duration-slow) var(--ease-out); }

.dropdown-menu { border-radius: var(--radius) !important; box-shadow: var(--shadow-lg) !important; border: 1px solid var(--color-slate-200) !important; padding: 4px; animation: fadeInUp var(--duration-fast) var(--ease-out); }
.dropdown-item { border-radius: var(--radius-sm); transition: background-color var(--duration-fast) var(--ease-out); padding: 6px 12px; }
.dropdown-item:hover { background: var(--color-slate-50); }

.toast {
  border-radius: var(--radius) !important; box-shadow: var(--shadow-lg) !important;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  animation: fadeInUp var(--duration-normal) var(--ease-out);
}
.modal-content { border-radius: var(--radius-lg) !important; }

.min-width-0    { min-width: 0; }
.font-monospace { font-family: 'JetBrains Mono', 'Courier New', Courier, monospace; }
.opacity-60     { opacity: .6; }
.badge          { font-weight: 600; }
[x-cloak]       { display: none !important; }

/* ═══════════════════════════════════════════════════════════════════
   МАРЖИНАЛЬНОСТЬ
   ═══════════════════════════════════════════════════════════════════ */
.margin-display   { font-size: 3rem; line-height: 1; }
.margin-excellent { color: #198754; }
.margin-good      { color: #0dcaf0; }
.margin-warning   { color: #ffc107; }
.margin-bad       { color: #dc3545; }

/* ═══════════════════════════════════════════════════════════════════
   TOOLTIP
   ═══════════════════════════════════════════════════════════════════ */
.tooltip .tooltip-inner { background: var(--color-slate-900); color: white; font-size: 12px; font-family: 'Inter', system-ui, sans-serif; padding: 6px 10px; border-radius: var(--radius-sm); max-width: 280px; text-align: left; line-height: 1.5; box-shadow: var(--shadow-lg); }
.tooltip.bs-tooltip-top    .tooltip-arrow::before { border-top-color:    var(--color-slate-900); }
.tooltip.bs-tooltip-bottom .tooltip-arrow::before { border-bottom-color: var(--color-slate-900); }
.tooltip.bs-tooltip-start  .tooltip-arrow::before { border-left-color:   var(--color-slate-900); }
.tooltip.bs-tooltip-end    .tooltip-arrow::before { border-right-color:  var(--color-slate-900); }

/* ═══════════════════════════════════════════════════════════════════
   МОНИТОРИНГ — карточки находок
   ═══════════════════════════════════════════════════════════════════ */
.monitoring-card {
  transition:
    transform  var(--duration-normal) var(--ease-out),
    box-shadow var(--duration-normal) var(--ease-out);
  contain: layout style paint;
}
.monitoring-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md) !important;
}

.monitoring-product-name {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 13.5px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.source-badge-z360 {
  background: #dbeafe; color: #1d4ed8; border: 1px solid #bfdbfe;
  font-size: 9px; padding: 2px 6px; border-radius: var(--radius-full);
  font-weight: 700; letter-spacing: .3px;
  display: inline-flex; align-items: center; gap: 3px;
}

.monitored-row--critical td:first-child  { border-left: 3px solid #ef4444; }
.monitored-row--critical                 { background: linear-gradient(90deg, #fff5f5 0%, transparent 120px) !important; }
.monitored-row--critical:hover td        { background: #fee2e2 !important; }

.monitored-row--urgent td:first-child  { border-left: 3px solid #f59e0b; }
.monitored-row--urgent                 { background: linear-gradient(90deg, #fffbeb 0%, transparent 120px) !important; }
.monitored-row--urgent:hover td        { background: #fef3c7 !important; }

.monitored-row--expired { opacity: .65; }
.monitored-row--expired:hover { opacity: 1; }

.nmck-large  { color: var(--color-primary-light); font-weight: 700; }
.nmck-medium { color: var(--color-slate-800); font-weight: 600; }

@keyframes rowFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.monitored-row--new { animation: rowFadeIn .25s var(--ease-out) forwards; }

tr[x-show] { transition: opacity .3s ease, transform .3s ease; }

/* ═══════════════════════════════════════════════════════════════════
   МОНИТОРИНГ — критерии
   ═══════════════════════════════════════════════════════════════════ */
.criteria-card {
  transition:
    transform    var(--duration-normal) var(--ease-out),
    box-shadow   var(--duration-normal) var(--ease-out),
    border-color var(--duration-fast)   var(--ease-out);
  border-left: 3px solid transparent !important;
}
.criteria-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md) !important;
  border-left-color: var(--color-primary-light) !important;
}

.criteria-status-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.criteria-status-dot--active { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.2); animation: onlinePulse 3s ease-in-out infinite; }
.criteria-status-dot--paused { background: var(--color-slate-300); }

.btn-run-locked { opacity: .55; cursor: not-allowed; pointer-events: none; }

#kw-counter, #exc-counter { font-size: 11px; font-weight: 600; transition: color var(--duration-fast); min-width: 60px; text-align: right; }

/* ═══════════════════════════════════════════════════════════════════
   КАЛЕНДАРЬ
   ═══════════════════════════════════════════════════════════════════ */
.calendar-hero { background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%); border: 1px solid rgba(15,23,42,.06); border-radius: 18px; box-shadow: 0 4px 12px rgba(15,23,42,.04); }
.calendar-hero__eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: .7px; font-weight: 700; color: var(--color-slate-400); }
.calendar-hero__title   { font-size: 26px; font-weight: 800; line-height: 1.1; color: var(--color-slate-900); margin: 0; }
.calendar-hero__text    { font-size: 13px; color: var(--color-slate-500); margin: 6px 0 0; max-width: 62ch; }

.calendar-summary-card { border: 1px solid rgba(15,23,42,.06); border-radius: 16px; box-shadow: 0 2px 8px rgba(15,23,42,.04); overflow: hidden; background: #fff; }
.calendar-summary-card__body   { padding: 14px 16px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; min-height: 84px; }
.calendar-summary-card__label  { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; font-weight: 700; color: var(--color-slate-400); margin-bottom: 6px; }
.calendar-summary-card__value  { font-size: 28px; font-weight: 800; line-height: 1; color: var(--color-slate-900); margin: 0; }
.calendar-summary-card__hint   { font-size: 11px; color: var(--color-slate-500); margin-top: 6px; }
.calendar-summary-card__icon   { width: 42px; height: 42px; flex: 0 0 42px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-size: 18px; }
.calendar-summary-card--danger  .calendar-summary-card__icon { background: #fee2e2; color: #dc2626; }
.calendar-summary-card--warning .calendar-summary-card__icon { background: #fef3c7; color: #d97706; }
.calendar-summary-card--success .calendar-summary-card__icon { background: #dcfce7; color: #15803d; }
.calendar-summary-card--neutral .calendar-summary-card__icon { background: #e2e8f0; color: #475569; }
.calendar-summary-card--total   .calendar-summary-card__icon { background: #dbeafe; color: #1d4ed8; }

.calendar-legend      { display: flex; flex-wrap: wrap; gap: 8px; }
.calendar-legend__item { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--color-slate-600); border: 1px solid var(--color-slate-200); background: white; border-radius: 9999px; padding: 6px 10px; white-space: nowrap; }
.calendar-legend__dot  { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 10px; }
.calendar-legend__dot--danger  { background: #ef4444; }
.calendar-legend__dot--warning { background: #f59e0b; }
.calendar-legend__dot--success { background: #16a34a; }
.calendar-legend__dot--neutral { background: #94a3b8; }

.calendar-grid-wrap { overflow: auto; background: white; border: 1px solid rgba(15,23,42,.06); border-radius: 18px; box-shadow: 0 2px 8px rgba(15,23,42,.04); }
.calendar-grid { width: max-content; min-width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 13px; }
.calendar-grid thead th { position: sticky; top: 0; z-index: 2; background: linear-gradient(180deg, #fff 0%, #f8fafc 100%); border-bottom: 1px solid #e2e8f0; color: var(--color-slate-500); font-size: 11px; text-transform: uppercase; letter-spacing: .6px; font-weight: 700; padding: 11px 10px; text-align: center; white-space: nowrap; }

.calendar-day-cell { position: relative; height: 112px; vertical-align: top; padding: 0 !important; background: #fff; border: 1px solid #e2e8f0; }
.calendar-day-btn  { position: relative; width: 100%; height: 100%; border: 0; background: transparent; padding: 10px 10px 9px; text-align: left; display: flex; flex-direction: column; gap: 8px; overflow: hidden; cursor: pointer; transition: background-color .15s ease; }
.calendar-day-btn:hover { background: linear-gradient(180deg, rgba(59,130,246,.05) 0%, rgba(59,130,246,.02) 100%); }

.calendar-day-strip           { position: absolute; top: 0; left: 0; right: 0; height: 4px; }
.calendar-day-strip--danger   { background: #ef4444; }
.calendar-day-strip--warning  { background: #f59e0b; }
.calendar-day-strip--success  { background: #16a34a; }
.calendar-day-strip--neutral  { background: #94a3b8; }

.calendar-day-head          { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; min-height: 24px; }
.calendar-day-number        { font-size: 15px; line-height: 1; font-weight: 800; color: var(--color-slate-800); }
.calendar-day-number--today { color: var(--color-primary-light); }
.calendar-day-total { min-width: 24px; height: 22px; border-radius: 9999px; padding: 0 8px; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; line-height: 1; color: white; flex: 0 0 auto; }
.calendar-day-total--danger  { background: #ef4444; }
.calendar-day-total--warning { background: #f59e0b; }
.calendar-day-total--success { background: #16a34a; }
.calendar-day-total--neutral { background: #94a3b8; }

.calendar-day-meta     { display: flex; flex-wrap: wrap; gap: 4px; margin-top: auto; }
.calendar-count-pill   { min-width: 18px; height: 18px; border-radius: 9999px; padding: 0 6px; display: inline-flex; align-items: center; justify-content: center; font-size: 10px; line-height: 1; font-weight: 800; border: 1px solid transparent; }
.calendar-count-pill i { font-size: 9px; line-height: 1; }
.calendar-count-pill--danger  { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }
.calendar-count-pill--warning { background: #fef3c7; color: #a16207; border-color: #fde68a; }
.calendar-count-pill--success { background: #dcfce7; color: #15803d; border-color: #bbf7d0; }
.calendar-count-pill--neutral { background: #f1f5f9; color: #64748b; border-color: #e2e8f0; }

.calendar-day-empty   { font-size: 11px; color: var(--color-slate-400); margin-top: auto; }
.calendar-day-muted .calendar-day-btn { opacity: .52; background: linear-gradient(180deg, rgba(148,163,184,.06) 0%, rgba(148,163,184,.02) 100%); }
.calendar-day-today  { box-shadow: inset 0 0 0 2px rgba(59,130,246,.35); background: linear-gradient(180deg, rgba(59,130,246,.06) 0%, rgba(59,130,246,.02) 100%); }

.calendar-event-card { border: 1px solid rgba(15,23,42,.08); border-left-width: 4px; border-radius: 16px; background: white; box-shadow: 0 2px 8px rgba(15,23,42,.04); }
.calendar-event-card--danger  { border-left-color: #ef4444; }
.calendar-event-card--warning { border-left-color: #f59e0b; }
.calendar-event-card--success { border-left-color: #16a34a; }
.calendar-event-card--neutral { border-left-color: #94a3b8; }

.calendar-event-icon          { width: 34px; height: 34px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 34px; font-size: 16px; }
.calendar-event-icon--danger  { background: #fee2e2; color: #dc2626; }
.calendar-event-icon--warning { background: #fef3c7; color: #d97706; }
.calendar-event-icon--success { background: #dcfce7; color: #15803d; }
.calendar-event-icon--neutral { background: #e2e8f0; color: #475569; }
.calendar-event-meta { font-size: 11px; color: var(--color-slate-500); line-height: 1.35; }
.calendar-event-note { font-size: 12px; color: var(--color-slate-600); line-height: 1.45; }

@media (max-width: 991.98px) { .calendar-day-cell { height: 98px; } .calendar-hero__title { font-size: 22px; } }
@media (max-width: 575.98px) {
  .calendar-day-cell { height: 82px; }
  .calendar-day-btn  { padding: 8px; gap: 6px; }
  .calendar-day-number { font-size: 14px; }
  .calendar-day-total  { min-width: 21px; height: 20px; padding: 0 6px; font-size: 10px; }
  .calendar-count-pill { min-width: 16px; height: 16px; font-size: 9px; padding: 0 5px; }
  .calendar-summary-card__body  { min-height: 76px; padding: 12px 14px; }
  .calendar-summary-card__value { font-size: 22px; }
}

/* ═══════════════════════════════════════════════════════════════════
   АНИМАЦИИ
   ═══════════════════════════════════════════════════════════════════ */
@keyframes blink         { 0%,100% { opacity: 1; } 50% { opacity: .3; } }
@keyframes fadeIn        { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp      { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes floatSlow     { 0%,100% { transform: translate(0,0); } 25% { transform: translate(15px,-20px); } 50% { transform: translate(-10px,15px); } 75% { transform: translate(20px,10px); } }
@keyframes pulseGlow     { 0%,100% { box-shadow: 0 0 0 0   rgba(239,68,68,.3); } 50% { box-shadow: 0 0 0 6px rgba(239,68,68,0); } }
@keyframes onlinePulse   { 0%,100% { box-shadow: 0 0 0 0   rgba(34,197,94,.4); } 50% { box-shadow: 0 0 0 3px rgba(34,197,94,0); } }
@keyframes pulseHighlight{ 0% { box-shadow: 0 0 0 0   rgba(14,165,233,.5); } 100% { box-shadow: 0 0 0 12px rgba(14,165,233,0); } }
@keyframes skeletonShimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.blink           { animation: blink 1.2s ease-in-out infinite; }
.fade-in-up      { animation: fadeInUp .3s var(--ease-out) forwards; }
.pulse-danger    { animation: pulseGlow 2s ease-in-out infinite; }
.pulse-highlight { animation: pulseHighlight 1.5s ease; }

/* ═══════════════════════════════════════════════════════════════════
   АДАПТИВНОСТЬ
   ═══════════════════════════════════════════════════════════════════ */
@media (max-width: 575.98px) {
  .page-title  { font-size: 17px; }
  .kpi-value   { font-size: 22px; }
  .app-main    { padding: 12px; }
  .detail-tabs .nav-link { padding: 6px 10px; font-size: 12px; }
  .views-switcher-wrap { border-radius: 0; }
  .view-tab    { padding: 10px 12px; font-size: 12px; }
  .sales-funnel-step { min-width: 60px; }
  .sales-funnel-label { display: none; }
  .sales-funnel-count { font-size: 20px; }
  .sales-funnel-arrow { display: none; }
  .empty-state { padding: 40px 16px; }
  .empty-state-icon { width: 56px; height: 56px; font-size: 24px; }
  .sidebar-link { min-height: 44px; }
  .btn-sm { min-height: 36px; padding: 6px 12px; }
  .col-sticky { position: static !important; z-index: auto !important; box-shadow: none !important; left: auto !important; width: auto !important; }
  .sticky-pin-btn { display: none !important; }
  .manager-stats { display: none; }
  .attention-amount { display: none; }
  .dashboard-nav { gap: 2px; padding: 3px; }
  .dashboard-nav-link { padding: 7px 12px; font-size: 12px; }
  .monitoring-table .col-region,
  .monitoring-table .col-etp { display: none; }
  .monitoring-product-name { -webkit-line-clamp: 3; }
}

@media (min-width: 768px) and (max-width: 991.98px) { .app-main { padding: 20px; } }
@media (min-width: 1400px) { .app-main { padding: 28px 36px; } }

@media (max-width: 767.98px) {
  .criteria-card .row > div + div {
    border-top: 1px solid var(--color-slate-100);
    padding-top: 10px; margin-top: 6px;
  }
  .wf-summary-bar { padding: 12px 14px; gap: 12px; }
  .wf-steps-scroll { padding-bottom: 6px; }
  .wf-step-card { padding: 5px 8px; }
  .wf-step-card__label { font-size: 10px; }
  .wf-matrix-head--simple    { grid-template-columns: minmax(0,1fr) 120px 24px; }
  .wf-matrix-row--focus,
  .wf-matrix-row--payment    { grid-template-columns: minmax(0,1fr) minmax(96px,max-content) 24px; }
  .wf-matrix-row--logistics  { grid-template-columns: minmax(0,1fr) 82px 82px 24px; }
  .wf-matrix-head--logistics { grid-template-columns: minmax(0,1fr) 82px 82px 24px; }
}

/* ═══════════════════════════════════════════════════════════════════
   ПЕЧАТЬ
   ═══════════════════════════════════════════════════════════════════ */
@media print {
  .app-navbar, .app-sidebar, .page-actions,
  .views-switcher-wrap, .btn, .toast-container,
  .workflow-panel form, .dashboard-nav { display: none !important; }
  .app-main { margin-left: 0 !important; padding: 0 !important; }
  .card     { box-shadow: none !important; border: 1px solid #ddd !important; }
  .col-sticky { position: static !important; }
  .employee-hero { background: white !important; color: black !important; box-shadow: none !important; border: 1px solid #ddd; }
  .employee-hero__name, .employee-hero__position, .employee-hero__meta-item { color: black !important; }
}

/* ═══════════════════════════════════════════════════════════════════
   ДОСТУПНОСТЬ — prefers-reduced-motion
   ═══════════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration:        0.01ms !important;
    animation-iteration-count: 1      !important;
    transition-duration:       0.01ms !important;
  }

  .navbar-online-dot           { animation: none; box-shadow: 0 0 0 2px rgba(34,197,94,.4); }
  .criteria-status-dot--active { animation: none; box-shadow: 0 0 0 3px rgba(34,197,94,.2); }
  .activity-dot--online        { animation: none; }
  .blink                       { animation: none; opacity: 1; }
  .pulse-danger                { animation: none; }
  .wf-badge--danger            { animation: none; }
  .view-tab-urgent .view-tab-count { animation: none; }

  .decor-circle-1,
  .decor-circle-2,
  .decor-circle-3 { animation: none; }
}

/* ═══════════════════════════════════════════════════════════════════
   ТАБЛИЦА ЗАКУПОК — кнопка действий (современный стиль)
   ═══════════════════════════════════════════════════════════════════ */

/* Кнопка три точки — минималистичная */
.proc-action-btn {
    width: 30px; height: 30px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--color-slate-400);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 14px; cursor: pointer; padding: 0;
    transition:
        background-color var(--duration-fast) var(--ease-out),
        color            var(--duration-fast) var(--ease-out);
}
.proc-action-btn:hover {
    background: var(--color-slate-100);
    color: var(--color-slate-700);
}
.proc-action-btn:active {
    background: var(--color-slate-200);
    transform: scale(.93);
}

/* Дропдаун меню */
.proc-action-menu {
    border-radius: var(--radius) !important;
    box-shadow: 0 8px 24px rgba(15,23,42,.12), 0 2px 8px rgba(15,23,42,.06) !important;
    border: 1px solid var(--color-slate-100) !important;
    padding: 6px !important;
    min-width: 188px !important;
    animation: fadeInUp var(--duration-fast) var(--ease-out);
}

/* Пункт меню */
.proc-action-item {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 7px 10px !important;
    border-radius: var(--radius-sm) !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    color: var(--color-slate-700) !important;
    transition: background-color var(--duration-fast) var(--ease-out) !important;
    cursor: pointer;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
}
.proc-action-item:hover {
    background: var(--color-slate-50) !important;
    color: var(--color-slate-900) !important;
}

/* Иконка пункта — цветной квадратик */
.proc-action-item__icon {
    width: 26px; height: 26px; border-radius: 6px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 12px; flex-shrink: 0;
}
.proc-action-item__icon--blue  { background: #dbeafe; color: #1d4ed8; }
.proc-action-item__icon--slate { background: var(--color-slate-100); color: var(--color-slate-600); }
.proc-action-item__icon--yellow { background: #fef9c3; color: #a16207; }
.proc-action-item__icon--teal  { background: #ccfbf1; color: #0f766e; }
.proc-action-item__icon--red   { background: #fee2e2; color: #b91c1c; }

.proc-action-item__text { flex: 1; }

/* Разделитель в меню */
.proc-action-menu .dropdown-divider {
    margin: 4px 0 !important;
    border-color: var(--color-slate-100) !important;
    }

    /* ── Фильтры реестра — убрать обрезание текста ──────────────────── */
/* select показывает выбранное значение полностью */
.form-select.form-select-sm {
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

/* Статусный бейдж в таблице — не обрезать, переносить на новую строку */
.proc-status-block .wf-badge,
.proc-status-block .badge {
    white-space: normal !important;
    word-break: break-word;
    max-width: 200px;
    text-align: left;
    line-height: 1.3;
}

/* Строка статусов — переносить если не влезает */
.proc-status-row {
    flex-wrap: wrap;
    gap: 4px;
}