/* ═══════════════════════════════════════════════════════════════
   crm-common.css — CRM Наследие
   ТОЧНАЯ КОПИЯ дизайна сайта nasledie-med.ru
   Источник: nasledie-globals.css + nasledie-design-spec.md
   ═══════════════════════════════════════════════════════════════ */

/* ─── LOCAL FONTS (из globals.css сайта) ─── */
@font-face {
  font-family: 'Montserrat';
  src: url('/nasledie/fonts/montserrat/montserrat-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Montserrat';
  src: url('/nasledie/fonts/montserrat/montserrat-600.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Montserrat';
  src: url('/nasledie/fonts/montserrat/montserrat-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Carlito';
  src: url('/nasledie/fonts/carlito/carlito-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Carlito';
  src: url('/nasledie/fonts/carlito/carlito-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ─── CSS Variables (точная копия из globals.css :root) ─── */
:root {
  /* Brand Colors — Nasledie Clinic */
  --color-primary: #396DB3;
  --color-primary-light: #4A7EC4;
  --color-primary-dark: #285CA2;
  --color-accent: #ED1E24;
  --color-accent-light: #FF2F35;
  --color-text: #1A1A1A;
  --color-text-secondary: #727271;
  --color-background: #FFFFFF;
  --color-background-alt: #FFFFFF;

  /* shadcn/ui HSL variables (из globals.css) */
  --background: 0 0% 100%;
  --foreground: 222.2 84% 4.9%;
  --card: 0 0% 100%;
  --card-foreground: 222.2 84% 4.9%;
  --primary: 213 68% 46%;
  --primary-foreground: 0 0% 100%;
  --secondary: 210 40% 96.1%;
  --secondary-foreground: 222.2 47.4% 11.2%;
  --muted: 210 40% 96.1%;
  --muted-foreground: 215.4 16.3% 46.9%;
  --accent: 0 84% 56%;
  --accent-foreground: 0 0% 100%;
  --destructive: 0 84% 60%;
  --destructive-foreground: 0 0% 100%;
  --border: 214.3 31.8% 91.4%;
  --input: 214.3 31.8% 91.4%;
  --ring: 213 68% 46%;
  --radius: 0.75rem;

  /* CRM-специфичные (поверх цветов сайта) */
  --color-bg: #FFFFFF;
  --color-surface: #FFFFFF;
  --color-border: rgba(57, 109, 179, 0.08);
  --font-main: 'Montserrat', sans-serif;
  --font-brand: 'Montserrat', sans-serif;
  --font-heading: 'Candara', 'Carlito', sans-serif;
  --transition: all 0.3s ease;

  /* Aliases для совместимости со старыми inline-стилями */
  --color-blue: #396DB3;
  --color-blue-light: rgba(57, 109, 179, 0.1);
  --color-blue-dark: #285CA2;
  --color-red: #ED1E24;
  --color-red-light: rgba(237, 30, 36, 0.1);
  --color-green: #10b981;
  --color-green-light: #d1fae5;
  --color-amber: #f59e0b;
  --color-amber-light: #fef3c7;
  --color-purple: #8b5cf6;
  --color-purple-light: #f3e8ff;
  --color-white: #ffffff;
  --color-muted: #9ca3af;
  --shadow: 0 8px 32px rgba(57, 109, 179, 0.15);
  --shadow-lg: 0 8px 32px rgba(57, 109, 179, 0.15);
  --shadow-hover: 0 12px 32px rgba(57, 109, 179, 0.12), 0 0 16px rgba(57, 109, 179, 0.05);
}

/* ─── Reset & Base ─── */
* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-family: 'Montserrat', sans-serif;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  background: #FFFFFF;
  color: #1A1A1A;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Заголовки — как на сайте (Candara/Carlito, #396DB3) */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Candara', 'Carlito', sans-serif;
  font-weight: 700;
  color: #396DB3;
}

a { color: inherit; text-decoration: inherit; }

/* ═══════════════════════════════════════════════════════════════
   GLASSMORPHISM (точная копия из globals.css)
   ═══════════════════════════════════════════════════════════════ */
.glass {
  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(6px) saturate(180%);
  -webkit-backdrop-filter: blur(6px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.glass-dark {
  background: rgba(57, 109, 179, 0.75);
  backdrop-filter: blur(8px) saturate(180%);
  -webkit-backdrop-filter: blur(8px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.glass-light {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(6px) saturate(180%);
  -webkit-backdrop-filter: blur(6px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.glass-popular {
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(8px) saturate(180%);
  -webkit-backdrop-filter: blur(8px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 8px 32px rgba(57, 109, 179, 0.2);
}

.glass-popular-dark {
  background: rgba(57, 109, 179, 0.75);
  backdrop-filter: blur(8px) saturate(180%);
  -webkit-backdrop-filter: blur(8px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 32px rgba(57, 109, 179, 0.3);
}

.glass-hover {
  transition: all 0.4s ease;
}
.glass-hover:hover {
  box-shadow: 0 12px 32px rgba(57, 109, 179, 0.12), 0 0 16px rgba(57, 109, 179, 0.05);
  transform: translateY(-4px);
}

/* Mobile fallbacks (из globals.css) */
@supports not (backdrop-filter: blur(6px)) {
  .glass { background: rgba(255, 255, 255, 0.75); }
  .glass-dark { background: rgba(57, 109, 179, 0.90); }
  .glass-light { background: rgba(255, 255, 255, 0.4); }
  .glass-popular { background: rgba(255, 255, 255, 0.85); }
  .glass-popular-dark { background: rgba(57, 109, 179, 0.90); }
}


/* ═══════════════════════════════════════════════════════════════
   HEADER — точная копия шапки ЛК (components/lk/header.tsx)
   Tailwind: fixed top-0 w-full z-50 glass border-b border-white/20
   ═══════════════════════════════════════════════════════════════ */
.crm-topbar {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 50;
  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(6px) saturate(180%);
  -webkit-backdrop-filter: blur(6px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

/* Tailwind: max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-3 min-h-[55px] */
/* flex items-center justify-between */
.crm-topbar-inner {
  max-width: 80rem;
  margin: 0 auto;
  padding: 12px 16px;
  min-height: 55px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

@media (min-width: 640px) {
  .crm-topbar-inner { padding: 12px 24px; }
}
@media (min-width: 1024px) {
  .crm-topbar-inner { padding: 12px 32px; }
}

/* Логотип — точная копия из ЛК:
   position: fixed; top: -65px; left: 20px; height: 184px; width: 260px; z-index: 100 */
.crm-brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  position: fixed;
  top: -130px;
  left: 20px;
  height: 368px;
  width: 520px;
  z-index: 100;
}

/* Spacer — точная копия из ЛК: width: 260px; margin-left: 60px */
.crm-header-spacer {
  width: 520px;
  margin-left: 60px;
  flex-shrink: 0;
}

/* Мобильные: логотип меньше (как в ЛК, но уменьшаем пропорционально) */
@media (max-width: 767px) {
  .crm-brand {
    top: -80px;
    left: 10px;
    height: 240px;
    width: 340px;
  }
  .crm-header-spacer {
    width: 340px;
    margin-left: 10px;
  }
}

@media (max-width: 480px) {
  .crm-brand {
    top: -60px;
    left: 8px;
    height: 180px;
    width: 256px;
  }
  .crm-header-spacer {
    width: 256px;
    margin-left: 8px;
  }
}

/* Logo image / animation container */
.crm-brand-logo-img {
  height: 368px;
  width: auto;
  display: block;
}

/* Desktop actions — hidden md:flex items-center space-x-3 */
.crm-topbar-actions {
  display: none;
  align-items: center;
  gap: 12px;
}

@media (min-width: 768px) {
  .crm-topbar-actions {
    display: flex;
  }
}

.crm-topbar-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #396DB3;
  text-decoration: none;
  padding: 8px 12px;
  border: 2px solid #396DB3;
  border-radius: 6px;
  background: transparent;
  transition: all 0.3s ease;
  gap: 6px;
}

.crm-topbar-actions a:hover {
  background: #396DB3;
  color: #FFFFFF;
}

/* ═══════════════════════════════════════════════════════════════
   BURGER — точная копия из ЛК: flex md:hidden items-center space-x-2
   В ЛК бургер справа (после desktop actions, виден только на mobile)
   ═══════════════════════════════════════════════════════════════ */
.crm-burger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: background 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}

.crm-burger:hover {
  background: rgba(57, 109, 179, 0.08);
}

.crm-burger span {
  display: block;
  width: 24px;
  height: 3px;
  background: #396DB3;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.crm-burger.active span:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}
.crm-burger.active span:nth-child(2) {
  opacity: 0;
}
.crm-burger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* Бургер: только на mobile (flex md:hidden) */
@media (min-width: 768px) {
  .crm-burger {
    display: none;
  }
}

@media (max-width: 767px) {
  .crm-burger {
    display: flex;
  }
}

/* ═══════════════════════════════════════════════════════════════
   MOBILE NAV — выезжает справа (как Sheet в ЛК: side="right")
   ═══════════════════════════════════════════════════════════════ */
.crm-mobile-nav {
  display: none;
  position: fixed;
  top: 0;
  right: -160px;
  width: 150px;
  height: 100vh;
  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(6px) saturate(180%);
  -webkit-backdrop-filter: blur(6px) saturate(180%);
  border-left: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.15);
  z-index: 200;
  padding: 60px 0 24px;
  overflow-y: auto;
  transition: right 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.crm-mobile-nav.open {
  right: 0;
  transition: right 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.crm-mobile-nav:not(.open) {
  transition: right 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.crm-mobile-nav a {
  display: flex;
  align-items: center;
  font-family: Montserrat, sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: #1A1A1A;
  text-decoration: none;
  padding: 12px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  transition: background 0.2s ease, color 0.2s ease;
}

.crm-mobile-nav a:hover,
.crm-mobile-nav a.active {
  background: rgba(255, 255, 255, 0.1);
  color: #396DB3;
}

.crm-mobile-nav .mobile-nav-section {
  font-family: 'Montserrat', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 16px 12px 8px;
}

/* Overlay */
.crm-mobile-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 150;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.crm-mobile-overlay.show {
  display: block;
  opacity: 1;
}

.crm-mobile-nav-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s ease;
  z-index: 210;
  color: #1A1A1A;
}

.crm-mobile-nav-close:hover {
  opacity: 1;
}

.crm-mobile-nav-close svg {
  width: 16px;
  height: 16px;
}

@media (max-width: 767px) {
  .crm-mobile-nav {
    display: block;
  }
}

/* ═══════════════════════════════════════════════════════════════
   NAVIGATION (стиль меню как на сайте)
   color #1A1A1A, hover #396DB3, font-weight 600, 16px
   ═══════════════════════════════════════════════════════════════ */
.crm-nav {
  position: fixed;
  top: 56px;
  width: 100%;
  z-index: 40;
  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(6px) saturate(180%);
  -webkit-backdrop-filter: blur(6px) saturate(180%);
  border-bottom: 1px solid rgba(57, 109, 179, 0.08);
}

.crm-nav-inner {
  max-width: 80rem;
  margin: 0 auto;
  display: flex;
  gap: 24px;
  padding: 0 16px;
  overflow-x: auto;
}

@media (min-width: 640px) {
  .crm-nav-inner { padding: 0 24px; }
}
@media (min-width: 1024px) {
  .crm-nav-inner { padding: 0 32px; }
}

.crm-nav a {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Montserrat', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: #1A1A1A;
  text-decoration: none;
  padding: 12px 0;
  border-bottom: 2px solid transparent;
  transition: color 0.3s ease, border-color 0.3s ease;
  white-space: nowrap;
}

.crm-nav a:hover {
  color: #396DB3;
}

.crm-nav a.active {
  color: #396DB3;
  border-bottom-color: #396DB3;
}

.crm-nav a .nav-icon {
  font-size: 16px;
  line-height: 1;
}

/* ─── Nav dropdown group (Настройки) ─── */
.crm-nav .nav-group {
  position: relative;
}
.crm-nav details.nav-group > summary {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-brand);
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-decoration: none;
  padding: 12px 16px;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
  white-space: nowrap;
  cursor: pointer;
  list-style: none;
}
.crm-nav details.nav-group > summary::-webkit-details-marker {
  display: none;
}
.crm-nav details.nav-group > summary:hover {
  color: var(--color-primary);
  background: rgba(57, 109, 179, 0.04);
}
.crm-nav details.nav-group[open] > summary,
.crm-nav details.nav-group > summary:focus {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}
.crm-nav .nav-submenu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 220px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  flex-direction: column;
  padding: 6px;
  z-index: 100;
}
.crm-nav details.nav-group[open] .nav-submenu {
  display: flex;
}
.crm-nav .nav-submenu a {
  border-bottom: none;
  padding: 8px 12px;
  font-size: 13px;
  border-radius: calc(var(--radius) - 2px);
}


/* ═══════════════════════════════════════════════════════════════
   PAGE CONTAINER (как на сайте: max-w-7xl, px-4/6/8)
   ═══════════════════════════════════════════════════════════════ */
.crm-container {
  max-width: 80rem;
  margin: 0 auto;
  padding: 100px 16px 48px;
  flex: 1;
  width: 100%;
}

@media (min-width: 640px) {
  .crm-container { padding: 100px 24px 48px; }
}
@media (min-width: 1024px) {
  .crm-container { padding: 100px 32px 48px; }
}

.crm-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

@media (min-width: 768px) {
  .crm-page-header { margin-bottom: 48px; }
}

.crm-page-title {
  font-family: 'Candara', 'Carlito', sans-serif;
  font-weight: 700;
  font-size: 30px;
  color: #396DB3;
  letter-spacing: -0.01em;
  line-height: 2.25rem;
}

@media (min-width: 768px) {
  .crm-page-title { font-size: 36px; line-height: 2.5rem; }
}

.crm-page-subtitle {
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  color: #727271;
  font-weight: 500;
  margin-top: 4px;
}

/* ═══════════════════════════════════════════════════════════════
   CARDS (card-nasledie из globals.css — ТОЧНАЯ КОПИЯ)
   rounded-2xl (16px), border-top 4px #396DB3
   ═══════════════════════════════════════════════════════════════ */
.card {
  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(6px) saturate(180%);
  -webkit-backdrop-filter: blur(6px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid #396DB3;
  box-shadow: 0 8px 32px rgba(57, 109, 179, 0.15);
  border-radius: 16px;
  padding: 24px;
  transition: all 0.4s ease;
}

.card:hover {
  box-shadow: 0 12px 32px rgba(57, 109, 179, 0.12), 0 0 16px rgba(57, 109, 179, 0.05);
  transform: translateY(-4px);
}

@media (min-width: 768px) {
  .card { padding: 32px; }
}

.card-header {
  padding: 16px 24px;
  border-bottom: 1px solid rgba(57, 109, 179, 0.1);
  font-family: 'Candara', 'Carlito', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #396DB3;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-body { padding: 24px; }

/* Card with accent (красный бордер сверху) */
.card-accent {
  border-top: 4px solid #ED1E24;
  box-shadow: 0 8px 32px rgba(237, 30, 36, 0.12);
}

/* ═══════════════════════════════════════════════════════════════
   GRID (как на сайте: gap-4 md:gap-6)
   ═══════════════════════════════════════════════════════════════ */
.grid { display: grid; gap: 16px; }
@media (min-width: 768px) {
  .grid { gap: 24px; }
}
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* ═══════════════════════════════════════════════════════════════
   KPI (в стиле карточек сайта)
   ═══════════════════════════════════════════════════════════════ */
.kpi { display: flex; flex-direction: column; gap: 4px; }
.kpi-value {
  font-family: 'Montserrat', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: #396DB3;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.kpi-value.red { color: #ED1E24; }
.kpi-label {
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  color: #727271;
  font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════════
   BUTTONS (точная копия из globals.css)
   .btn-primary: bg #396DB3, rounded-lg (8px), shadow rgba(57,109,179,0.35)
   .btn-accent: bg rgba(237,30,36,0.75), rounded-lg (8px)
   .btn-outline: border-2 #396DB3, rounded-lg (8px)
   ═══════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: 14px;
  padding: 12px 24px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

/* Primary button (синяя) — из globals.css .btn-primary */
.btn-primary {
  background: #396DB3;
  color: #FFFFFF;
  box-shadow: 0 4px 15px rgba(57, 109, 179, 0.35);
}
.btn-primary:hover {
  background: #285CA2;
  box-shadow: 0 6px 24px rgba(57, 109, 179, 0.5);
  transform: translateY(-2px);
}
.btn-primary:disabled {
  background: #9ca3af;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Accent button (красная) — из globals.css .btn-accent */
.btn-accent {
  background: rgba(237, 30, 36, 0.75);
  color: #FFFFFF;
  border: 1px solid rgba(237, 30, 36, 0.3);
  box-shadow: 0 4px 15px rgba(237, 30, 36, 0.3);
}
.btn-accent:hover {
  background: rgba(237, 30, 36, 0.85);
  box-shadow: 0 6px 21px rgba(237, 30, 36, 0.41);
  transform: translateY(-2px);
}

/* Outline button — из globals.css .glass-outline / .btn-outline */
.btn-outline {
  background: transparent;
  border: 2px solid #396DB3;
  color: #396DB3;
}
.btn-outline:hover {
  background: #396DB3;
  color: #FFFFFF;
}

/* Button glow (из globals.css) */
.btn-glow {
  box-shadow: 0 3px 15px rgba(237, 30, 36, 0.225), 0 0 9px rgba(237, 30, 36, 0.1125);
}
.btn-glow-primary {
  box-shadow: 0 4px 20px rgba(57, 109, 179, 0.4), 0 0 12px rgba(57, 109, 179, 0.2);
}

.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 6px; }

.btn-copy {
  background: transparent;
  border: 1px solid rgba(57, 109, 179, 0.1);
  color: #396DB3;
  border-radius: 6px;
}
.btn-copy:hover {
  background: rgba(57, 109, 179, 0.1);
  border-color: #396DB3;
}
.btn-copy.copied {
  background: #22c55e;
  color: #fff;
  border-color: #22c55e;
}

/* ═══════════════════════════════════════════════════════════════
   TABLES (в стиле сайта)
   ═══════════════════════════════════════════════════════════════ */
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
}
thead th {
  text-align: left;
  padding: 12px 16px;
  color: #727271;
  font-weight: 600;
  border-bottom: 1px solid rgba(57, 109, 179, 0.1);
  white-space: nowrap;
}
tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(57, 109, 179, 0.08);
  color: #1A1A1A;
}
tbody tr:hover { background: rgba(57, 109, 179, 0.04); }
tbody tr:last-child td { border-bottom: none; }

/* ═══════════════════════════════════════════════════════════════
   FORMS (в стиле сайта: rounded-lg, border-primary)
   ═══════════════════════════════════════════════════════════════ */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #727271;
  margin-bottom: 6px;
}
.form-group label .req { color: #ED1E24; }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(57, 109, 179, 0.1);
  border-radius: 8px;
  background: #FFFFFF;
  color: #1A1A1A;
  font-size: 16px;
  font-family: 'Montserrat', sans-serif;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #396DB3;
  box-shadow: 0 0 0 3px rgba(57, 109, 179, 0.15);
}
.form-group input::placeholder { color: #9ca3af; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ═══════════════════════════════════════════════════════════════
   BADGES (badge-nasledie из globals.css)
   ═══════════════════════════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 9999px;
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(8px) saturate(180%);
  -webkit-backdrop-filter: blur(8px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 4px 16px rgba(57, 109, 179, 0.15);
  color: #1A1A1A;
}
.badge-active {
  background: rgba(34, 197, 94, 0.15);
  color: #16a34a;
  border-color: rgba(34, 197, 94, 0.3);
}
.badge-inactive {
  background: rgba(237, 30, 36, 0.15);
  color: #dc2626;
  border-color: rgba(237, 30, 36, 0.3);
}

/* ═══════════════════════════════════════════════════════════════
   EKG LINE (фирменный разделитель из globals.css)
   ═══════════════════════════════════════════════════════════════ */
.ekg-line {
  background: linear-gradient(90deg,
    transparent 0%,
    #396DB3 10%,
    #ED1E24 50%,
    #396DB3 90%,
    transparent 100%
  );
  height: 3px;
  width: 100%;
  border-radius: 2px;
}

/* ═══════════════════════════════════════════════════════════════
   TEXT EFFECTS (из globals.css)
   ═══════════════════════════════════════════════════════════════ */
.text-shadow { text-shadow: 0 2px 10px rgba(0, 0, 0, 0.15); }
.text-shadow-lg { text-shadow: 0 4px 20px rgba(0, 0, 0, 0.25); }
.text-glow-accent { text-shadow: 0 0 20px rgba(237, 30, 36, 0.4); }
.text-glow-primary { text-shadow: 0 0 20px rgba(57, 109, 179, 0.4); }

.text-gradient {
  background: linear-gradient(135deg, #396DB3 0%, #4A7EC4 50%, #285CA2 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Glow orb (из globals.css) */
.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.15;
  pointer-events: none;
}

/* Float animation (из globals.css) */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
.float { animation: float 6s ease-in-out infinite; }

/* ═══════════════════════════════════════════════════════════════
   LOADING / SPINNER
   ═══════════════════════════════════════════════════════════════ */
.loading {
  text-align: center;
  padding: 40px;
  color: #727271;
  font-family: 'Montserrat', sans-serif;
  font-size: 15px;
  font-weight: 500;
}
.spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid rgba(57, 109, 179, 0.1);
  border-top-color: #396DB3;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════════════════
   TOAST
   ═══════════════════════════════════════════════════════════════ */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 20px;
  background: #22c55e;
  color: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(57, 109, 179, 0.15);
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  font-weight: 600;
  z-index: 1000;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s, transform 0.3s;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: #ED1E24; }

/* ═══════════════════════════════════════════════════════════════
   FOOTER (точная копия с сайта nasledie-footer.html)
   bg #396DB3, py-12, text white, border-top white/20
   ═══════════════════════════════════════════════════════════════ */
.crm-footer {
  background: #396DB3;
  color: #FFFFFF;
  padding: 48px 16px;
}

.crm-footer-inner {
  max-width: 80rem;
  margin: 0 auto;
}

@media (min-width: 640px) {
  .crm-footer { padding: 48px 24px; }
}
@media (min-width: 1024px) {
  .crm-footer { padding: 48px 32px; }
}

.crm-footer h4 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 20px;
  color: #FFFFFF;
  margin-bottom: 16px;
}

.crm-footer p {
  font-family: 'Montserrat', sans-serif;
  font-size: 16px;
  color: #F0F0F0;
  font-weight: 500;
  line-height: 1.5;
}

.crm-footer-divider {
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  margin-top: 32px;
  padding-top: 32px;
  text-align: center;
}

.crm-footer-copy {
  font-family: 'Montserrat', sans-serif;
  font-size: 16px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
}

.crm-footer-brand {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: #FFFFFF;
}

.crm-footer-brand span { color: #ED1E24; }

.crm-footer-links {
  display: flex;
  gap: 16px;
  margin-top: 8px;
}

.crm-footer-links a {
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: color 0.3s ease;
}

.crm-footer-links a:hover {
  color: #FFFFFF;
}

/* ═══════════════════════════════════════════════════════════════
   STATS BAR
   ═══════════════════════════════════════════════════════════════ */
.stats-bar {
  display: flex;
  gap: 16px;
  padding: 12px 20px;
  background: rgba(57, 109, 179, 0.05);
  border-bottom: 1px solid rgba(57, 109, 179, 0.08);
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
}
.stat-item { display: flex; align-items: center; gap: 6px; }
.stat-item .label { color: #727271; font-weight: 500; }
.stat-item .value { font-weight: 600; color: #396DB3; }

/* ═══════════════════════════════════════════════════════════════
   EMPTY STATE
   ═══════════════════════════════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #727271;
  font-family: 'Montserrat', sans-serif;
}
.empty-state .icon-big {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.3;
}

/* ═══════════════════════════════════════════════════════════════
   UTILITY
   ═══════════════════════════════════════════════════════════════ */
.text-primary { color: #396DB3; }
.text-accent { color: #ED1E24; }
.text-secondary { color: #727271; }
.font-brand { font-family: 'Montserrat', sans-serif; }
.font-heading { font-family: 'Candara', 'Carlito', sans-serif; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-0 { margin-top: 0; }
.mt-4 { margin-top: 16px; }
.mt-8 { margin-top: 32px; }
.mb-0 { margin-bottom: 0; }
.mb-4 { margin-bottom: 16px; }
.mb-8 { margin-bottom: 32px; }
.gap-4 { gap: 16px; }
.gap-8 { gap: 32px; }
.hidden { display: none; }
.clicks-count { font-weight: 600; color: #396DB3; }
.short-url-cell {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 12px;
  color: #396DB3;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════════
   CUSTOM SCROLLBAR (из globals.css — ТОЧНАЯ КОПИЯ)
   ═══════════════════════════════════════════════════════════════ */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #FFFFFF; }
::-webkit-scrollbar-thumb { background: #396DB3; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #285CA2; }

/* Selection (из globals.css) */
::selection {
  background: rgba(57, 109, 179, 0.2);
  color: #1A1A1A;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .crm-nav-inner { padding: 0 12px; }
  .crm-nav a { padding: 10px 0; font-size: 14px; }
  .crm-container { padding: 90px 16px 32px; }
  .crm-page-title { font-size: 24px; }
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .crm-footer-links { flex-direction: column; gap: 8px; }
  /* Mobile glassmorphism fallbacks (из globals.css) */
  .glass-popular {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(4px) saturate(150%);
    -webkit-backdrop-filter: blur(4px) saturate(150%);
  }
  .glass-popular-dark {
    background: rgba(57, 109, 179, 0.85);
    backdrop-filter: blur(4px) saturate(150%);
    -webkit-backdrop-filter: blur(4px) saturate(150%);
  }
  .glow-orb { opacity: 0.08; filter: blur(60px); }
  .float { animation: float 8s ease-in-out infinite; }
  .text-shadow-lg { text-shadow: 0 2px 12px rgba(0, 0, 0, 0.2); }
}

@media (max-width: 767px) {
  .float { animation: none; }
}

@media (max-width: 480px) {
  .crm-nav a { font-size: 12px; padding: 8px 0; }
  .crm-nav a .nav-icon { display: none; }
}
/* Mobile: hide desktop nav, show mobile nav, adjust container */
@media (max-width: 767px) {
  .crm-nav { display: none; }
  .crm-mobile-nav { display: block; }
  .crm-container { padding-top: 70px; }
}

@media (max-width: 480px) {
  .crm-burger { width: 36px; height: 36px; }
  .crm-burger span { width: 20px; }
}

/* === FOOTER LOGO (копия с основной страницы) === */
.crm-footer-logo-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto 24px;
  height: 80px;
  width: 200px;
  overflow: hidden;
  position: relative;
}

.crm-footer-logo-wrap svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Адаптивность футер-логотипа для мобильных */
@media (max-width: 768px) {
  .crm-footer-logo-wrap {
    height: 64px;
    width: 160px;
  }
}

@media (max-width: 480px) {
  .crm-footer-logo-wrap {
    height: 56px;
    width: 140px;
  }
}

/* === LOGO IMAGE (replaces text logo) === */
.crm-brand-logo-img {
  height: 368px;
  width: auto;
  display: block;
}

/* === LOGIN LOGO IMAGE === */
.login-logo-img {
  height: 56px;
  width: auto;
  display: block;
  margin: 0 auto 4px;
}
