:root {
  /* ТЕМНАЯ ТЕМА */
  --bg-canvas: radial-gradient(130% 120% at 50% 0%, #1c273c 0%, #0d1422 60%, #080c14 100%);
  --bg-sidebar: #0e1626;
  --bg-topbar: rgba(14, 22, 38, 0.94);
  --bg-card: #151e30;
  --bg-card-subtle: #1a253c;
  --border-glass: rgba(255, 255, 255, 0.1);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-blue: #2563eb;
}

[data-theme="light"] {
  /* СВЕТЛАЯ ТЕМА */
  --bg-canvas: radial-gradient(130% 120% at 50% 0%, #ffffff 0%, #f5efe6 50%, #eae2d3 100%);
  --bg-sidebar: #e5ded2;
  --bg-topbar: rgba(250, 248, 244, 0.96);
  --bg-card: rgba(255, 255, 255, 0.92);
  --bg-card-subtle: #f8f6f0;
  --border-glass: rgba(120, 100, 80, 0.16);
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --accent-blue: #2563eb;
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
  letter-spacing: -0.014em;
  background: var(--bg-canvas) !important;
  background-attachment: fixed !important;
  color: var(--text-primary) !important;
  -webkit-font-smoothing: antialiased;
}

/* САЙДБАР: НА ВСЮ ВЫСОТУ 100VH + ПЛАВНЫЙ БУРГЕР */
#mount-sidebar,
#appSidebar {
  height: 100vh !important;
  min-height: 100vh !important;
  display: flex !important;
  flex-direction: column !important;
}

#appSidebar {
  background: var(--bg-sidebar) !important;
  border-right: 1px solid var(--border-glass) !important;
  transition: width 0.22s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

/* СВОРАЧИВАНИЕ САЙДБАРА ДО 72PX БЕЗ НАЛОЖЕНИЯ НА ЛОГОТИП */
#appSidebar.w-20 {
  width: 72px !important;
}
#appSidebar.w-20 .sidebar-text {
  display: none !important;
}
#appSidebar.w-20 .sidebar-header-box {
  flex-direction: column !important;
  gap: 12px !important;
  padding: 10px 0 !important;
  align-items: center !important;
}
#appSidebar.w-20 .sidebar-item {
  justify-content: center !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

#appSidebar .sidebar-item {
  color: var(--text-secondary) !important;
  border-radius: 14px !important;
  font-weight: 600 !important;
  transition: all 0.15s ease !important;
}

#appSidebar .sidebar-item svg {
  opacity: 0.85 !important;
  flex-shrink: 0;
}

#appSidebar .sidebar-item:hover {
  background: rgba(0, 0, 0, 0.05) !important;
  color: var(--text-primary) !important;
}

[data-theme="dark"] #appSidebar .sidebar-item:hover {
  background: rgba(255, 255, 255, 0.08) !important;
}

/* АКТИВНЫЙ ПУНКТ: СИНЯЯ КАПСУЛА */
#appSidebar .sidebar-item.active,
#appSidebar .sidebar-item.active-nav {
  background: #2563eb !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3) !important;
}

#appSidebar .sidebar-item.active svg,
#appSidebar .sidebar-item.active-nav svg {
  color: #ffffff !important;
  opacity: 1 !important;
}

/* ШАПКА */
header {
  background: var(--bg-topbar) !important;
  backdrop-filter: blur(20px) !important;
  border-bottom: 1px solid var(--border-glass) !important;
  position: relative !important;
  z-index: 50 !important;
}

/* ПЛАШКИ В СВЕТЛОЙ ТЕМЕ: ПОЛНОЕ УДАЛЕНИЕ СЕРОЙ БУНКЕРНОСТИ */
[data-theme="light"] div[class*="rounded-3xl"],
[data-theme="light"] div[class*="rounded-2xl"],
[data-theme="light"] .bg-\[\#141d2e\],
[data-theme="light"] .bg-\[\#141d2e\]\/80,
[data-theme="light"] .dark\:bg-\[\#141d2e\]\/80,
[data-theme="light"] .bg-slate-900,
[data-theme="light"] .bg-slate-950,
[data-theme="light"] .bg-\[\#111726\] {
  background-color: rgba(255, 255, 255, 0.94) !important;
  border: 1px solid rgba(120, 100, 80, 0.15) !important;
  color: #0f172a !important;
  box-shadow: 0 8px 24px -4px rgba(100, 80, 60, 0.08) !important;
}

[data-theme="light"] table thead {
  background: rgba(0, 0, 0, 0.04) !important;
  color: #64748b !important;
}

[data-theme="light"] input,
[data-theme="light"] select,
[data-theme="light"] textarea {
  background: #ffffff !important;
  border: 1px solid #d5cbbe !important;
  color: #0f172a !important;
}

/* ИСПРАВЛЕНИЕ ЗАГОЛОВКА МОДАЛКИ ПРОФИЛЯ В СВЕТЛОЙ ТЕМЕ (СКРИНШОТЫ 5 И 6) */
[data-theme="light"] #profileEditModalBackdrop > div {
  background: #ffffff !important;
  border: 1px solid #d5cbbe !important;
  color: #0f172a !important;
}
[data-theme="light"] #profileEditModalBackdrop h3 {
  color: #0f172a !important;
}
[data-theme="light"] #profileEditModalBackdrop label {
  color: #475569 !important;
}

input, select, textarea {
  font-family: inherit;
  border-radius: 12px !important;
  background: var(--bg-card-subtle) !important;
  border: 1px solid var(--border-glass) !important;
  color: var(--text-primary) !important;
  padding: 10px 14px !important;
  font-size: 13px !important;
}

input:focus, select:focus, textarea:focus {
  outline: none !important;
  border-color: var(--accent-blue) !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2) !important;
}

.responsible-avatar-badge {
  background-color: #2563eb !important;
  color: #ffffff !important;
}

#notifPopover, #profileDropdown {
  position: fixed !important;
  top: 60px !important;
  right: 24px !important;
  background: var(--bg-card) !important;
  backdrop-filter: blur(28px) !important;
  border: 1px solid var(--border-glass) !important;
  border-radius: 20px !important;
  box-shadow: 0 25px 50px -10px rgba(0, 0, 0, 0.35) !important;
  z-index: 99999 !important;
  overflow: hidden !important;
}
/* ДОБАВИТЬ В КОНЕЦ public/css/common.css: */

.sidebar-badge {
  background-color: #ef4444;
  color: #ffffff !important;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 800;
  padding: 1.5px 6.5px;
  border-radius: 9999px;
  margin-left: auto;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
  line-height: 1.2;
}

#appSidebar.w-20 .sidebar-badge {
  position: absolute;
  top: 6px;
  right: 10px;
  padding: 1px 4.5px;
  font-size: 9px;
}