/* ==========================================================================
   АСПЕКТ | MODERN LEGAL INTELLIGENCE & RISK OS
   Дизайн-система: Obsidian & Warm Gold Bento (Linear / Vercel LegalTech Style)
   ========================================================================== */

:root {
  --bg-main: #0e1014;
  --bg-workspace: #1c1f26;
  --bg-sidebar: #252830;
  --bg-canvas: #1c1f26;
  --bg-card: #2b2f38;
  --bg-card-hover: #333842;
  --bg-summary: #252831;
  --bg-input: #20242e;
  --border-window: #2e333d;
  --border-card: #363b46;
  --border-subtle: #2d323d;
  --border-focus: #c8a265;

  --accent-gold: #c8a265;
  --accent-gold-light: #e5cb8b;
  --accent-gold-glow: rgba(200, 162, 101, 0.2);

  --accent-indigo: #c8a265;
  --accent-indigo-hover: #b89255;

  --accent-emerald: #10b981;
  --accent-emerald-light: #86efac;

  --accent-rose: #ef4444;
  --accent-rose-light: #fca5a5;

  --accent-amber: #f59e0b;
  --accent-amber-light: #fde68a;

  --zone-red-bg: #442930;
  --zone-red-text: #f0c2c8;
  --zone-red-border: rgba(239, 68, 68, 0.3);

  --zone-yellow-bg: #453c2a;
  --zone-yellow-text: #f1e4bc;
  --zone-yellow-border: rgba(245, 158, 11, 0.3);

  --zone-green-bg: #26372f;
  --zone-green-text: #bae8cc;
  --zone-green-border: rgba(16, 185, 129, 0.3);

  --text-primary: #ffffff;
  --text-secondary: #8c929f;
  --text-muted: #676d7b;

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Playfair Display', Georgia, serif;
  --font-mono: 'JetBrains Mono', monospace;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.6);
  --shadow-gold: 0 0 20px rgba(200, 162, 101, 0.15);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(212, 175, 55, 0.06), transparent 70%),
    radial-gradient(ellipse 60% 40% at 50% 110%, rgba(79, 70, 229, 0.06), transparent 70%);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14.5px;
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   ТОСТ-УВЕДОМЛЕНИЯ
   ========================================================================== */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 320px;
  max-width: 460px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  background: #1e293b;
  color: #fff;
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 12px;
  animation: toastSlideIn 0.25s ease-out;
  transition: all 0.2s ease;
}

.toast-success {
  border-left: 4px solid var(--accent-emerald);
}

.toast-warning {
  border-left: 4px solid var(--accent-amber);
}

.toast-error {
  border-left: 4px solid var(--accent-rose);
}

.toast-info {
  border-left: 4px solid var(--accent-indigo);
}

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ==========================================================================
   ВЕРХНЯЯ ШАПКА (HEADER)
   ========================================================================== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(9, 13, 22, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* ==========================================================================
   БРЕНД И ЛОГОТИП С ПЛАВНЫМ ПОЯВЛЕНИЕМ ПРИ ЗАГРУЗКЕ
   ========================================================================== */
@keyframes brandEntrance {
  0% {
    opacity: 0;
    transform: translateY(-8px) scale(0.94);
    filter: blur(4px) drop-shadow(0 0 0 rgba(212, 175, 55, 0));
  }
  60% {
    opacity: 0.95;
    transform: translateY(1px) scale(1.02);
    filter: blur(0) drop-shadow(0 0 16px rgba(212, 175, 55, 0.45));
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0) drop-shadow(0 2px 10px rgba(212, 175, 55, 0.25));
  }
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  user-select: none;
  animation: brandEntrance 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  will-change: opacity, transform, filter;
  transition: transform 0.25s ease;
}

.header-brand:hover {
  transform: translateY(-1px);
}

.brand-logo-container {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: radial-gradient(circle at center, rgba(212, 175, 55, 0.2) 0%, rgba(16, 22, 38, 0.75) 85%);
  border: 1px solid rgba(212, 175, 55, 0.35);
  box-shadow: 0 0 18px rgba(212, 175, 55, 0.18), inset 0 0 10px rgba(212, 175, 55, 0.1);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
}

.header-brand:hover .brand-logo-container {
  border-color: rgba(212, 175, 55, 0.75);
  box-shadow: 0 0 26px rgba(212, 175, 55, 0.35), inset 0 0 14px rgba(212, 175, 55, 0.25);
  transform: scale(1.05);
}

.brand-logo-img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.6));
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.header-brand:hover .brand-logo-img {
  transform: scale(1.08);
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 2px;
  background: linear-gradient(135deg, #ffffff 0%, #fef3c7 45%, #d4af37 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  transition: all 0.3s ease;
}

.header-brand:hover .brand-title {
  filter: drop-shadow(0 0 12px rgba(212, 175, 55, 0.4));
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.engine-status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--accent-emerald-light);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 20px;
}

.status-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-emerald);
  box-shadow: 0 0 10px var(--accent-emerald);
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0% { transform: scale(0.95); opacity: 0.7; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.7; }
}

.quick-demo-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.demo-btn {
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

.demo-btn-danger {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: var(--accent-rose-light);
}

.demo-btn-danger:hover {
  background: rgba(239, 68, 68, 0.22);
  border-color: var(--accent-rose);
  transform: translateY(-1px);
}

.demo-btn-success {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: var(--accent-emerald-light);
}

.demo-btn-success:hover {
  background: rgba(16, 185, 129, 0.22);
  border-color: var(--accent-emerald);
  transform: translateY(-1px);
}

.demo-btn-ghost {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

.demo-btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-card);
  transform: translateY(-1px);
}

/* ==========================================================================
   АТМОСФЕРНЫЕ ТЕМАТИЧЕСКИЕ ФОТО-ПАНЕЛИ ПО БОКАМ (LEGAL AMBIENCE)
   ========================================================================== */
.legal-ambient-backdrop {
  position: fixed;
  top: 0;
  bottom: 0;
  z-index: 0;
  pointer-events: none;
  background-size: cover;
  background-repeat: no-repeat;
  transition: opacity 0.6s ease;
  will-change: opacity;
}

.legal-backdrop-left {
  left: 0;
  width: max(450px, calc((100vw - 1280px) / 2 + 180px));
  background-image: 
    linear-gradient(to right, rgba(9, 13, 22, 0.05) 0%, rgba(9, 13, 22, 0.45) 45%, rgba(9, 13, 22, 0.94) 86%, #090d16 100%),
    linear-gradient(to bottom, rgba(9, 13, 22, 0.85) 0%, rgba(9, 13, 22, 0.08) 12%, rgba(9, 13, 22, 0.08) 85%, rgba(9, 13, 22, 0.95) 100%),
    url('/legal-bg-left.jpg?v=2');
  background-position: left top;
  opacity: 0.68;
  filter: saturate(0.95) contrast(1.08) brightness(0.92);
}

.legal-backdrop-right {
  right: 0;
  width: max(450px, calc((100vw - 1280px) / 2 + 180px));
  background-image: 
    linear-gradient(to left, rgba(9, 13, 22, 0.05) 0%, rgba(9, 13, 22, 0.45) 45%, rgba(9, 13, 22, 0.94) 86%, #090d16 100%),
    linear-gradient(to bottom, rgba(9, 13, 22, 0.85) 0%, rgba(9, 13, 22, 0.08) 12%, rgba(9, 13, 22, 0.08) 85%, rgba(9, 13, 22, 0.95) 100%),
    url('/legal-bg-right.jpg');
  background-position: right top;
  opacity: 0.68;
  filter: saturate(0.95) contrast(1.08) brightness(0.92);
}

@media (max-width: 1280px) {
  .legal-backdrop-left, .legal-backdrop-right {
    opacity: 0.35;
    width: 280px;
  }
}

@media (max-width: 840px) {
  .legal-ambient-backdrop {
    display: none;
  }
}

/* ==========================================================================
   ПРЕДСТАВИТЕЛЬСКАЯ ДИЗАЙН-СИСТЕМА (EXECUTIVE WORKSPACE WINDOW)
   ========================================================================== */
.executive-workspace-window {
  max-width: 1360px;
  width: 95%;
  margin: 24px auto 60px auto;
  background: #1c1f26;
  border: 1px solid #2e333d;
  border-radius: 14px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.7);
  display: grid;
  grid-template-columns: 290px 1fr;
  overflow: hidden;
  position: relative;
  z-index: 2;
  padding: 0;
  min-height: 84vh;
}

/* ЛЕВАЯ БОКОВАЯ ПАНЕЛЬ (SIDEBAR) */
.executive-sidebar {
  background: #252830;
  border-right: 1px solid #2e333d;
  padding: 24px 18px 24px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
}

/* Представительский брендинг: крупный и четкий официальный логотип АСПЕКТ (Бронзовая сова) */
.sidebar-brand-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4px 6px 18px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 16px;
  cursor: pointer;
  user-select: none;
  transition: all 0.25s ease;
  text-align: center;
}

.sidebar-brand-block:hover {
  transform: translateY(-2px);
}

.sidebar-brand-block:hover .sidebar-brand-logo-img {
  filter: drop-shadow(0 8px 24px rgba(200, 162, 101, 0.45));
}

@keyframes logoFadeIn {
  0% {
    opacity: 0;
    transform: translateY(-8px) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.sidebar-brand-logo-img {
  max-width: 190px;
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.65));
  animation: logoFadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: filter 0.25s ease, transform 0.25s ease;
}

/* Меню разделов в сайдбаре */
.sidebar-nav-menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid transparent;
  color: #9aa0ad;
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: all 0.2s ease;
}

.sidebar-nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #ffffff;
}

.sidebar-nav-item.active {
  background: #343842;
  color: #ffffff;
  border-left: 3px solid #c8a265;
  border-radius: 6px;
}

.sidebar-nav-item.nav-item-red {
  background: #442930;
  color: #f0c2c8;
  border: 1px solid rgba(239, 68, 68, 0.25);
  margin-top: 14px;
}

.sidebar-nav-item.nav-item-red:hover {
  background: #503038;
}

.sidebar-nav-item.nav-item-yellow {
  background: #453c2a;
  color: #f1e4bc;
  border: 1px solid rgba(245, 158, 11, 0.25);
  margin-top: 8px;
}

.sidebar-nav-item.nav-item-yellow:hover {
  background: #524732;
}

.sidebar-nav-item.nav-item-green {
  background: #26372f;
  color: #bae8cc;
  border: 1px solid rgba(16, 185, 129, 0.25);
  margin-top: 8px;
}

.sidebar-nav-item.nav-item-green:hover {
  background: #2e4339;
}

.nav-item-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  flex-shrink: 0;
}

.nav-item-text {
  flex: 1;
  white-space: normal;
  line-height: 1.35;
}

.nav-zone-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.nav-zone-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 9999px;
  background: rgba(0, 0, 0, 0.3);
  margin-left: auto;
}

/* Действия внизу сайдбара */
.sidebar-footer-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-action-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 600;
  background: #2e333f;
  border: 1px solid #3c424f;
  color: #cbd5e1;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
}

.sidebar-action-btn:hover {
  background: #363c49;
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
}

.sidebar-action-btn.action-primary {
  background: rgba(200, 162, 101, 0.15);
  border-color: rgba(200, 162, 101, 0.4);
  color: #e5cb8b;
}

.sidebar-action-btn.action-primary:hover {
  background: rgba(200, 162, 101, 0.25);
  border-color: #c8a265;
}

/* ПРАВОЕ РАБОЧЕЕ ПОЛОТНО (MAIN CANVAS) */
.executive-main-canvas {
  background: #1c1f26;
  padding: 32px 38px 48px 38px;
  overflow-y: auto;
  max-height: calc(100vh - 48px);
}

.canvas-top-bar {
  display: none !important;
}

/* Мобильная шапка скрывается на мониторах */
@media (min-width: 1024px) {
  .mobile-only-header {
    display: none !important;
  }
}

@media (max-width: 1023px) {
  .executive-workspace-window {
    grid-template-columns: 1fr;
    width: 100%;
    margin: 0;
    border-radius: 0;
    border: none;
  }

  .executive-sidebar {
    display: none;
  }

  .mobile-only-header {
    display: flex;
  }

  .executive-main-canvas {
    padding: 16px 14px;
    max-height: none;
  }
}

.main-container {
  position: relative;
  z-index: 2;
}

/* ==========================================================================
   КАРТОЧКА ВВОДА ДОГОВОРА (HERO / INPUT CARD)
   ========================================================================== */
.audit-input-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  padding: 28px;
  box-shadow: var(--shadow-md);
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
}

.audit-input-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-gold), var(--accent-indigo), transparent);
}

.input-card-header {
  margin-bottom: 20px;
}

.main-headline {
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}

.main-subheadline {
  font-size: 14.5px;
  color: var(--text-secondary);
  max-width: 820px;
  line-height: 1.6;
}

.input-mode-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 12px;
}

.mode-tab-btn {
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.mode-tab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
}

.mode-tab-btn.active {
  background: rgba(79, 70, 229, 0.15);
  border-color: rgba(79, 70, 229, 0.4);
  color: #fff;
}

/* Drag & Drop зона */
.drop-zone {
  background: var(--bg-input);
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  padding: 38px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
  margin-bottom: 20px;
}

.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--accent-gold);
  background: rgba(212, 175, 55, 0.04);
  transform: translateY(-2px);
}

.drop-icon {
  font-size: 42px;
  margin-bottom: 10px;
}

.drop-title {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.drop-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
}

.file-input-hidden {
  display: none;
}

.selected-file-badge {
  display: inline-block;
  margin-top: 12px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid var(--accent-emerald);
  color: var(--accent-emerald-light);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}

/* Текстовая зона */
.text-input-container {
  margin-bottom: 20px;
}

.text-input-container textarea {
  width: 100%;
  height: 180px;
  background: var(--bg-input);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  padding: 16px;
  resize: vertical;
  transition: border-color 0.2s ease;
}

.text-input-container textarea:focus {
  outline: none;
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.2);
}

/* Тулбар ввода */
.input-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.role-selector-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toolbar-label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 600;
}

.playbook-select {
  background: var(--bg-input);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  padding: 9px 14px;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.playbook-select:focus {
  outline: none;
  border-color: var(--accent-gold);
}

.preset-chips {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chip-btn {
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 7px 13px;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chip-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.chip-btn-muted {
  color: var(--text-muted);
}

.btn-primary-analyze {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 800;
  background: linear-gradient(135deg, #d4af37 0%, #b89628 100%);
  color: #0b0f19;
  border: none;
  border-radius: var(--radius-md);
  padding: 12px 28px;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(212, 175, 55, 0.35);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary-analyze:hover {
  background: linear-gradient(135deg, #e6ca65 0%, #d4af37 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(212, 175, 55, 0.5);
}

.btn-primary-analyze:active {
  transform: translateY(0);
}

/* ==========================================================================
   ИНДИКАТОР ЗАГРУЗКИ (LOADING)
   ========================================================================== */
.loading-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  padding: 42px 24px;
  text-align: center;
  margin-bottom: 32px;
  box-shadow: var(--shadow-md);
}

.spinner-glow {
  width: 52px;
  height: 52px;
  margin: 0 auto 18px auto;
  border: 4px solid rgba(212, 175, 55, 0.15);
  border-top-color: var(--accent-gold);
  border-radius: 50%;
  animation: spin 0.85s linear infinite;
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.25);
}

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

.loading-title {
  font-family: var(--font-heading);
  font-size: 19px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 8px;
}

.loading-steps {
  font-size: 13.5px;
  color: var(--accent-gold-light);
  max-width: 680px;
  margin: 0 auto;
}

/* ==========================================================================
   СЕКЦИЯ РЕЗУЛЬТАТОВ (RESULTS SECTION)
   ========================================================================== */
.results-section {
  animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   👔 КАРТОЧКА ДИРЕКТОРА (CHIEF ANALYST REPORT) — ЦЕНТРАЛЬНЫЙ ЭЛЕМЕНТ
   ========================================================================== */
.director-report-card {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  margin-bottom: 24px;
  position: relative;
}

.director-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding-bottom: 0;
  border-bottom: none;
  margin-bottom: 20px;
}

.director-badge-kicker {
  display: none;
}

.director-headline {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #ffffff;
  background: none;
  -webkit-text-fill-color: initial;
  margin-bottom: 12px;
  line-height: 1.35;
}

.director-digest {
  display: none;
}

.director-header-right {
  display: none !important;
}

.director-verdict-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  border-radius: var(--radius-lg);
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.3px;
}

.verdict-rose {
  background: rgba(239, 68, 68, 0.16);
  border: 2px solid var(--accent-rose);
  color: #fca5a5;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.25);
}

.verdict-gold {
  background: rgba(245, 158, 11, 0.16);
  border: 2px solid var(--accent-amber);
  color: #fde68a;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.25);
}

.verdict-emerald {
  background: rgba(16, 185, 129, 0.16);
  border: 2px solid var(--accent-emerald);
  color: #86efac;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.25);
}

.director-action-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-director-copy {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.45);
  color: var(--accent-gold-light);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-director-copy:hover {
  background: rgba(212, 175, 55, 0.22);
  border-color: var(--accent-gold);
  transform: translateY(-1px);
}

.btn-director-word {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 800;
  background: var(--accent-gold);
  color: #0b0f19;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 10px rgba(212, 175, 55, 0.3);
}

.btn-director-word:hover {
  background: #e6ca65;
  transform: translateY(-1px);
}

.btn-director-full-doc {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-card);
  color: var(--text-primary);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-director-full-doc:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* 3 Главные цифры (Bento Grid) */
.director-numbers-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.director-number-box {
  background: #2b2f38;
  border: 1px solid #363b46;
  border-radius: 8px;
  padding: 16px 20px;
  position: relative;
}

.d-num-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #8c929f;
  text-transform: uppercase;
  display: block;
  margin-bottom: 8px;
}

.d-num-val {
  font-family: var(--font-sans);
  font-size: 32px;
  font-weight: 700;
  color: #ffffff !important;
  line-height: 1.15;
  margin: 0;
}

.d-num-sub {
  display: none;
}

.box-danger {
  border-color: #363b46;
  background: #2b2f38;
}

.val-danger {
  color: #ffffff !important;
}

.box-score {
  border-color: #363b46;
  background: #2b2f38;
}

/* Правовые щиты сделки */
.director-shields-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.director-shield-item {
  background: transparent;
  border: none;
  padding: 0;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.shield-icon {
  color: #c8a265;
  font-size: 20px;
  line-height: 1.2;
  flex-shrink: 0;
}

.shield-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 4px;
  line-height: 1.3;
}

.shield-status {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 4px;
}

.shield-desc {
  font-size: 12px;
  color: #8c929f;
  line-height: 1.45;
}

/* КНОПКИ ЗОН РИСКА (Красная / Желтая / Зеленая) В СТИЛЕ РЕФЕРЕНСА */
.executive-zone-buttons-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.executive-zone-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.zone-btn-red {
  background: #442930;
  border-color: rgba(239, 68, 68, 0.25);
  color: #f0c2c8;
}

.zone-btn-red:hover {
  background: #503038;
}

.zone-btn-yellow {
  background: #453c2a;
  border-color: rgba(245, 158, 11, 0.25);
  color: #f1e4bc;
}

.zone-btn-yellow:hover {
  background: #524732;
}

.zone-btn-green {
  background: #26372f;
  border-color: rgba(16, 185, 129, 0.25);
  color: #bae8cc;
}

.zone-btn-green:hover {
  background: #2e4339;
}

.zone-btn-dot,
.zone-btn-count {
  display: none;
}

/* Резюме человеческим языком */
.director-summary-box {
  background: #242831;
  border: 1px solid #303542;
  border-radius: 8px;
  padding: 18px 22px;
  margin-bottom: 28px;
}

.summary-box-title {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: #c8a265;
  margin-bottom: 8px;
}

.summary-box-text {
  font-size: 13.5px;
  line-height: 1.6;
  color: #b8bec9;
}

/* Топ-3 капкана договора */
.director-traps-section {
  margin-bottom: 28px;
}

.traps-header {
  margin-bottom: 16px;
}

.traps-title {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 800;
  color: #f87171;
  display: block;
  margin-bottom: 4px;
  letter-spacing: 0.3px;
}

.traps-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
}

.director-traps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.director-trap-card {
  background: rgba(239, 68, 68, 0.04);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.trap-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.trap-num-pill {
  font-size: 11px;
  font-weight: 800;
  background: #ef4444;
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
}

.trap-cat-pill {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--accent-amber-light);
  background: rgba(245, 158, 11, 0.15);
  padding: 2px 8px;
  border-radius: 4px;
}

.trap-title {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  line-height: 1.35;
}

.trap-quote {
  font-family: var(--font-mono);
  font-size: 12.5px;
  background: rgba(0, 0, 0, 0.35);
  border-left: 3px solid var(--accent-gold);
  padding: 8px 12px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: #cbd5e1;
  font-style: italic;
}

.trap-danger-box {
  background: rgba(239, 68, 68, 0.08);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.trap-danger-title {
  font-size: 12px;
  font-weight: 700;
  color: #fca5a5;
  margin-bottom: 3px;
}

.trap-danger-text {
  font-size: 13px;
  color: #f1f5f9;
  line-height: 1.45;
}

.trap-fix-box {
  background: rgba(16, 185, 129, 0.08);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.trap-fix-title {
  font-size: 12px;
  font-weight: 700;
  color: #86efac;
  margin-bottom: 3px;
}

.trap-fix-text {
  font-size: 13px;
  color: #f1f5f9;
  line-height: 1.45;
}

/* 3 Шага для переговоров */
.director-steps-section {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
}

.steps-title {
  font-family: var(--font-heading);
  font-size: 13.5px;
  font-weight: 800;
  color: var(--accent-gold);
  margin-bottom: 14px;
  letter-spacing: 0.5px;
}

.director-steps-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.director-step-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
  color: #e2e8f0;
  line-height: 1.5;
}

.step-num-circle {
  width: 24px;
  height: 24px;
  min-width: 24px;
  border-radius: 50%;
  background: var(--accent-gold);
  color: #0b0f19;
  font-weight: 800;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

/* ==========================================================================
   КНОПКА РАЗВОРАЧИВАНИЯ ДЕТАЛЬНОГО АУДИТА ЮРИСТА
   ========================================================================== */
.expert-details-divider {
  text-align: center;
  margin: 32px 0 24px 0;
}

.btn-toggle-expert-details {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-card);
  color: var(--text-primary);
  padding: 12px 28px;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.btn-toggle-expert-details:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: var(--accent-gold);
  color: var(--accent-gold-light);
  transform: translateY(-2px);
}

/* ==========================================================================
   ОБЕРТКА ЭКСПЕРТНЫХ ДЕТАЛЕЙ (KPI, TABS, CLAIMS)
   ========================================================================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.score-card {
  display: flex;
  align-items: center;
  gap: 18px;
}

.score-circle-wrapper {
  position: relative;
  width: 72px;
  height: 72px;
  min-width: 72px;
}

.score-svg-gauge {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.gauge-bg-circle {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 8;
}

.gauge-progress-circle {
  fill: none;
  stroke: var(--accent-emerald);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 251.2;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.8s ease;
}

.score-circle-number {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 800;
  color: #fff;
}

.score-meta h3 {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}

.score-summary {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.kpi-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.kpi-val {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 8px;
}

.kpi-val.danger {
  color: #f87171;
}

.deal-karma-meter, .worst-case-meter, .litigant-meter {
  background: rgba(255, 255, 255, 0.06);
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 6px;
}

.karma-fill, .worst-case-fill, .litigant-fill {
  height: 100%;
  background: var(--accent-gold);
  border-radius: 4px;
  transition: width 0.6s ease;
}

.worst-case-fill {
  background: var(--accent-rose);
}

.karma-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
}

.kpi-sub {
  font-size: 12px;
  color: var(--text-muted);
}

/* Радар рисков */
.risk-breakdown-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-bottom: 24px;
}

.risk-breakdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.bento-tag {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--accent-gold);
}

.risk-radar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.risk-radar-meta {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

.risk-radar-bar-bg {
  background: rgba(255, 255, 255, 0.06);
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 4px;
}

.risk-radar-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease;
}

.risk-radar-sub {
  font-size: 11px;
  color: var(--text-muted);
}

/* Ролевой селектор */
.role-selector-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-bottom: 28px;
}

.role-selector-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.role-button-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.role-btn {
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 7px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.role-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.role-btn.active {
  background: rgba(212, 175, 55, 0.18);
  border-color: var(--accent-gold);
  color: var(--accent-gold-light);
}

.role-report-content {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  font-size: 14px;
  line-height: 1.6;
  color: #e2e8f0;
}

/* 7 Вкладок аудита */
.tabs-container {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 20px;
  margin-bottom: 36px;
}

@media (max-width: 860px) {
  .tabs-container {
    grid-template-columns: 1fr;
  }
}

.tabs-nav-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  height: fit-content;
}

.tabs-nav-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.tabs-nav-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.tabs-nav-count {
  font-size: 11px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  padding: 2px 6px;
  border-radius: 10px;
}

.tabs-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tab-btn {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  padding: 10px 14px;
  cursor: pointer;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
}

.tab-btn.active {
  background: rgba(79, 70, 229, 0.15);
  border-color: rgba(79, 70, 229, 0.4);
  color: #fff;
}

.tab-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
  animation: fadeIn 0.25s ease;
}

.detailed-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-bottom: 20px;
}

.detailed-box:empty {
  display: none !important;
}

.risk-filters-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.risk-filter-btn {
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: 16px;
  cursor: pointer;
}

.risk-filter-btn.active {
  background: rgba(212, 175, 55, 0.15);
  border-color: var(--accent-gold);
  color: var(--accent-gold-light);
}

/* Экспорт и сброс */
.export-bar {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 36px;
  flex-wrap: wrap;
}

.btn {
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-card);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn-primary {
  background: var(--accent-indigo);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-indigo-hover);
}

/* ==========================================================================
   МОДАЛЬНОЕ ОКНО ПАКЕТНОГО АУДИТА
   ========================================================================== */
.batch-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.batch-modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  max-width: 960px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 30px;
  box-shadow: var(--shadow-lg);
  animation: modalPop 0.25s ease-out;
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.btn-close-modal {
  background: transparent;
  border: none;
  font-size: 28px;
  color: var(--text-secondary);
  cursor: pointer;
  line-height: 1;
}

.btn-close-modal:hover {
  color: #fff;
}

/* ==========================================================================
   МОДАЛЬНОЕ ОКНО ПРОВЕРКИ НОВОГО ДОГОВОРА
   ========================================================================== */
.new-contract-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.new-contract-modal-overlay.hidden {
  display: none !important;
}

.new-contract-modal-content {
  background: #1c1f26;
  border: 1px solid #363b46;
  border-radius: 14px;
  max-width: 860px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px;
  position: relative;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.85);
  animation: modalPop 0.25s ease-out;
}

.modal-close-icon {
  position: absolute;
  top: 16px;
  right: 20px;
  background: transparent;
  border: none;
  font-size: 32px;
  line-height: 1;
  color: #8c929f;
  cursor: pointer;
  transition: color 0.2s ease;
  z-index: 10;
}

.modal-close-icon:hover {
  color: #ffffff;
}

/* ==========================================================================
   АДАПТИВНОСТЬ ДЛЯ СМАРТФОНОВ И ПЛАНШЕТОВ
   ========================================================================== */
@media (max-width: 768px) {
  .app-header {
    padding: 12px 16px;
    flex-direction: column;
    align-items: flex-start;
  }

  .main-container {
    padding: 16px 12px;
  }

  .audit-input-card {
    padding: 18px 14px;
  }

  .main-headline {
    font-size: 20px;
  }

  .director-report-card {
    padding: 20px 14px;
  }

  .director-header-right {
    align-items: flex-start;
    width: 100%;
  }

  .director-action-buttons {
    width: 100%;
  }

  .btn-director-copy, .btn-director-word, .btn-director-full-doc {
    flex: 1;
    text-align: center;
  }
}

/* ==========================================================================
   CUSTOMER-FIRST & BUSINESS MODE STYLES + SVG ICONS
   ========================================================================== */
.svg-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  flex-shrink: 0;
}
.svg-icon svg {
  display: block;
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Переключатель роли на стартовом экране */
.customer-role-toggle-bar {
  margin-bottom: 20px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
}
.role-toggle-title {
  font-size: 13.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.role-toggle-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}
.role-toggle-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-card);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  color: var(--text-primary);
}
.role-toggle-btn:hover {
  border-color: rgba(217, 119, 6, 0.4);
  background: rgba(255, 255, 255, 0.04);
}
.role-toggle-btn.active {
  background: rgba(217, 119, 6, 0.1);
  border-color: var(--accent-gold);
  box-shadow: 0 0 16px rgba(217, 119, 6, 0.15);
}
.role-toggle-btn.active .role-toggle-icon {
  background: var(--accent-gold);
  color: #000;
}
.role-toggle-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-gold);
  flex-shrink: 0;
  transition: all 0.2s;
}
.role-toggle-text strong {
  display: block;
  font-size: 15.5px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 3px;
}
.role-toggle-text small {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.35;
}

/* Карточка быстрого ответа контрагенту (WhatsApp / Telegram / E-mail) */
.messenger-action-card {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(30, 41, 59, 0.6) 100%);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 24px;
}
.messenger-action-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 14px;
}
.messenger-action-btns {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.messenger-text-preview {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 14.5px;
  line-height: 1.65;
  color: #e2e8f0;
  white-space: pre-wrap;
  font-family: var(--font-sans);
}

/* Светофор рисков (3 понятные полки) */
.traffic-light-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.traffic-card {
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
}
.traffic-card.red-zone {
  border-left: 4px solid var(--accent-rose);
  background: rgba(244, 63, 94, 0.04);
}
.traffic-card.yellow-zone {
  border-left: 4px solid var(--accent-amber);
  background: rgba(245, 158, 11, 0.04);
}
.traffic-card.green-zone {
  border-left: 4px solid var(--accent-emerald);
  background: rgba(16, 185, 129, 0.04);
}
.traffic-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.traffic-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.traffic-dot.red { background: var(--accent-rose); box-shadow: 0 0 8px var(--accent-rose); }
.traffic-dot.yellow { background: var(--accent-amber); box-shadow: 0 0 8px var(--accent-amber); }
.traffic-dot.green { background: var(--accent-emerald); box-shadow: 0 0 8px var(--accent-emerald); }
.traffic-header strong {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  flex: 1;
}
.traffic-count {
  font-size: 13px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
}
.traffic-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 12px 0;
}
.traffic-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}
.traffic-list li {
  padding: 6px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

/* Интерактивный ползунок задержки и потерь */
.interactive-loss-slider-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  margin-bottom: 24px;
}
.slider-days-badge {
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent-cyan);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 13.5px;
}
.loss-slider {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.12);
  outline: none;
  margin: 18px 0;
  cursor: pointer;
  accent-color: var(--accent-gold);
}
.slider-financial-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

/* Финальный чек-лист за 60 секунд */
.checklist-60s-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  margin-bottom: 24px;
}
.checklist-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}
.checklist-items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 10px;
}
.checklist-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  padding: 10px 14px;
  border-radius: 8px;
}
.checklist-check-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
}
.checklist-check-icon.ok {
  background: rgba(16, 185, 129, 0.2);
  color: var(--accent-emerald);
}
.checklist-check-icon.warn {
  background: rgba(244, 63, 94, 0.2);
  color: var(--accent-rose);
}
.checklist-text {
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--text-primary);
}

@media (max-width: 900px) {
  .director-numbers-row,
  .director-shields-row,
  .executive-zone-buttons-row {
    grid-template-columns: 1fr;
  }
}
