/* global.css */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
  --bg-gradient: radial-gradient(circle at top left, #fbfcfd 0%, #f1f3f7 40%, #e7ecf2 100%);
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-bg-hover: rgba(255, 255, 255, 0.85);
  --glass-border: 1px solid rgba(255, 255, 255, 0.6);
  --glass-border-dark: 1px solid rgba(228, 232, 240, 0.8);
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --primary-color: #E4002B; /* KFC Red */
  --primary-glow: rgba(228, 0, 43, 0.15);
  --primary-hover: #b80022;
  --accent-green: #10b981;
  --accent-yellow: #f59e0b;
  --accent-red: #ef4444;
  --font-body: 'Inter', sans-serif;
  --font-heading: 'Outfit', sans-serif;
  --border-radius: 16px;
  --transition-speed: 0.3s;
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

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

body {
  font-family: var(--font-body);
  background: var(--bg-gradient);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  color: #0f172a;
}

/* Glassmorphism Containers */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: var(--glass-border);
  border-radius: var(--border-radius);
  padding: 24px;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-speed) ease;
}

.glass-panel:hover {
  background: var(--glass-bg-hover);
  box-shadow: var(--shadow-lg);
}

/* App Layout */
.app-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Top Navigation Header */
header.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  position: relative;
  z-index: 1050;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-section h1 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--primary-color) 0%, #ff4b6b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: var(--primary-color);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 20px;
  box-shadow: 0 4px 10px var(--primary-glow);
}

.nav-links {
  display: flex;
  gap: 8px;
  background: rgba(255, 255, 255, 0.4);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.nav-btn {
  text-decoration: none;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: 8px;
  transition: all 0.2s ease;
  border: none;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.nav-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.6);
}

.nav-btn.active {
  color: white;
  background: var(--primary-color);
  box-shadow: 0 4px 10px var(--primary-glow);
}

.user-profile-menu {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Search and Filters Bar */
.filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.search-input-wrapper {
  position: relative;
  flex-grow: 1;
  max-width: 400px;
}

.search-input {
  width: 100%;
  padding: 12px 16px 12px 40px;
  border-radius: 12px;
  border: var(--glass-border-dark);
  background: rgba(255, 255, 255, 0.5);
  font-family: var(--font-body);
  font-size: 14px;
  transition: all 0.2s ease;
  outline: none;
}

.search-input:focus {
  background: white;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  pointer-events: none;
}

.dept-select {
  padding: 12px 20px;
  border-radius: 12px;
  border: var(--glass-border-dark);
  background: rgba(255, 255, 255, 0.5);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  cursor: pointer;
}

.dept-select:focus {
  background: white;
  border-color: var(--primary-color);
}

/* Dashboard Columns Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: 380px 1fr 420px;
  gap: 24px;
  align-items: start;
}

@media (max-width: 1200px) {
  .dashboard-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

/* Left Column: Блок 1 (Профиль) & Блок 2 (Опыт) */
/* Раздел руководителя подразделения */
.manager-section {
  display: grid;
  grid-template-columns: 320px 1fr 300px;
  gap: 24px;
  align-items: center;
  margin-bottom: 8px;
  padding: 16px 24px;
}

@media (max-width: 1024px) {
  .manager-section {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

.section-title-sm {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-weight: 700;
}

.manager-profile-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(255, 255, 255, 0.4);
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.manager-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid white;
  box-shadow: var(--shadow-sm);
}

.manager-details h4 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 2px;
}

.manager-details p {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Вкладки выбора преемников */
.manager-successors-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.mgr-successor-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 13px;
  font-weight: 500;
  position: relative;
}

.mgr-successor-tab:hover {
  background: rgba(255, 255, 255, 0.85);
  transform: translateY(-1px);
}

.mgr-successor-tab.active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  box-shadow: 0 4px 10px var(--primary-glow);
}

.mgr-successor-tab-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid white;
}

.mgr-successor-tab-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  border: none;
  outline: none;
  cursor: pointer;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  font-family: var(--font-body);
  transition: all 0.2s ease;
}

select.mgr-successor-tab-badge option {
  background-color: #ffffff;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  text-transform: none;
}

.mgr-successor-tab.active .mgr-successor-tab-badge {
  background: rgba(255, 255, 255, 0.25) !important;
  color: white !important;
}

.mgr-successor-tab:not(.active) .mgr-successor-tab-badge.badge-emergency {
  background: rgba(239, 68, 68, 0.1);
  color: var(--accent-red);
}

.mgr-successor-tab:not(.active) .mgr-successor-tab-badge.badge-short {
  background: rgba(245, 158, 11, 0.1);
  color: var(--accent-yellow);
}

.mgr-successor-tab:not(.active) .mgr-successor-tab-badge.badge-long {
  background: rgba(16, 185, 129, 0.1);
  color: var(--accent-green);
}

.left-column {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.employee-card {
  text-align: center;
  position: relative;
}

.employee-avatar-wrapper {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 16px;
}

.employee-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid white;
  box-shadow: var(--shadow-md);
}

.employee-name {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
}

.employee-pos {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 16px;
}

.employee-details-list {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  padding-top: 16px;
}

.detail-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  min-height: 38px;
}

.detail-label {
  color: var(--text-secondary);
  font-weight: 500;
}

.detail-val {
  font-weight: 600;
  color: var(--text-primary);
  text-align: right;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.detail-val select, .detail-val input {
  font-family: var(--font-body);
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: rgba(255, 255, 255, 0.55);
  outline: none;
  width: 180px;
  box-sizing: border-box;
  transition: all 0.2s ease;
}

.detail-val select:focus, .detail-val input:focus {
  background: white;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Timeline Experience */
.experience-timeline {
  position: relative;
  padding-left: 20px;
  margin-top: 16px;
  max-height: 300px;
  overflow-y: auto;
}

.experience-timeline::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: #cbd5e1;
}

.timeline-item {
  position: relative;
  margin-bottom: 20px;
}

.timeline-dot {
  position: absolute;
  left: -20px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary-color);
  border: 2px solid white;
}

.timeline-years {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary-color);
}

.timeline-content {
  font-size: 13px;
  font-weight: 500;
}

.timeline-type {
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.timeline-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.text-btn {
  font-size: 11px;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
}

.text-btn:hover {
  color: var(--primary-color);
}

/* Middle Column */
.middle-column {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Qualitative Assessment Block */
.assessment-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.assessment-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.assessment-field label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.assessment-textarea {
  width: 100%;
  height: 90px;
  padding: 12px;
  border-radius: 10px;
  border: var(--glass-border-dark);
  background: rgba(255, 255, 255, 0.4);
  font-family: var(--font-body);
  font-size: 13px;
  outline: none;
  resize: none;
  transition: all 0.2s ease;
}

.assessment-textarea:focus {
  background: white;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Readiness Radio buttons */
.readiness-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.readiness-label {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.2s ease;
}

.readiness-label:hover {
  background: rgba(255, 255, 255, 0.6);
}

.readiness-label input {
  accent-color: var(--primary-color);
}

.readiness-label.selected {
  background: rgba(228, 0, 43, 0.05);
  border-color: rgba(228, 0, 43, 0.2);
}

/* Block 5: 9 Box Matrix */
.matrix-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.matrix-grid-wrapper {
  position: relative;
  display: grid;
  grid-template-columns: 30px 1fr;
  grid-template-rows: 1fr 30px;
  gap: 8px;
}

.y-axis-label {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  text-align: center;
  font-weight: 700;
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.x-axis-label {
  grid-column: 2;
  text-align: center;
  font-weight: 700;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.matrix-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 8px;
  height: 380px;
}

.matrix-cell {
  border-radius: 8px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 110px;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.matrix-cell:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  z-index: 1010 !important; /* Помещаем ячейку поверх остальных при наведении, чтобы аватары не перекрывали подсказку */
}

/* Стили для красивых подсказок в матрице 9 Box Grid */
.matrix-tooltip {
  position: absolute;
  bottom: 105%;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  width: 250px;
  padding: 12px;
  background: rgba(15, 23, 42, 0.95); /* Темный фон для контрастности */
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.matrix-cell:hover .matrix-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.matrix-tooltip::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -10px;
  transform: translateX(-50%);
  border-width: 5px;
  border-style: solid;
  border-color: rgba(15, 23, 42, 0.95) transparent transparent transparent;
}

/* Для верхнего ряда (high potential) показываем подсказку снизу, чтобы не обрезалась */
.matrix-cell[data-potential="high"] .matrix-tooltip {
  bottom: auto;
  top: 105%;
  transform: translateX(-50%) translateY(-8px);
}

.matrix-cell[data-potential="high"]:hover .matrix-tooltip {
  transform: translateX(-50%) translateY(0);
}

.matrix-cell[data-potential="high"] .matrix-tooltip::after {
  bottom: auto;
  top: -10px;
  border-color: transparent transparent rgba(15, 23, 42, 0.95) transparent;
}

.tooltip-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 13px;
  color: #ffffff;
  margin-bottom: 6px;
  text-align: left;
}

.tooltip-desc {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 11px;
  color: #cbd5e1;
  line-height: 1.4;
  text-align: left;
}

/* Zone colors */
.zone-red {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #991b1b;
}
.zone-grey {
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: #475569;
}
.zone-yellow {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.2);
  color: #92400e;
}
.zone-green {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: #065f46;
}

.cell-title {
  font-size: 10px;
  opacity: 0.8;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* Avatars inside cells (overlapping avatar stack) */
.cell-avatars {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
  padding: 4px 0;
}

.matrix-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: var(--shadow-sm);
  cursor: grab;
  position: relative;
  transition: all 0.15s ease;
  margin: 2px -5px; /* horizontal overlap */
}

.matrix-avatar:active {
  cursor: grabbing;
}

.matrix-avatar:hover {
  transform: scale(1.3);
  z-index: 12 !important;
  box-shadow: var(--shadow-md);
}

.matrix-avatar-extra {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(226, 232, 240, 0.95); /* slate-200 with high opacity */
  backdrop-filter: blur(4px);
  border: 2px solid white;
  color: #475569; /* slate-600 */
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  margin: 2px -5px;
  position: relative;
  z-index: 2;
  cursor: pointer;
  transition: all 0.15s ease;
}

.matrix-avatar-extra:hover {
  transform: scale(1.2);
  background: #cbd5e1; /* slate-300 */
  color: #1e293b;
  z-index: 10 !important;
  box-shadow: var(--shadow-md);
}

/* Dragging state overlay */
.drag-over {
  border: 2px dashed var(--primary-color) !important;
  background: rgba(228, 0, 43, 0.05) !important;
}

/* Successors Block */
.successors-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.successor-search-box {
  position: relative;
}

.successor-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(0, 0, 0, 0.1);
  z-index: 50;
  max-height: 200px;
  overflow-y: auto;
  display: none;
}

.successor-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  cursor: pointer;
  transition: background 0.15s;
}

.successor-result-item:hover {
  background: #f1f5f9;
}

.successor-result-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.successor-result-name {
  font-size: 13px;
  font-weight: 500;
}

.successor-result-pos {
  font-size: 11px;
  color: var(--text-secondary);
}

.successors-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.successor-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 12px;
  padding: 10px 14px;
  cursor: grab;
  transition: all 0.2s ease;
}

.successor-card:active {
  cursor: grabbing;
  opacity: 0.6;
}

.successor-card-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.successor-card-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid white;
  box-shadow: var(--shadow-sm);
}

.successor-card-info h4 {
  font-size: 13px;
  font-weight: 600;
}

.successor-card-info p {
  font-size: 11px;
  color: var(--text-secondary);
}

.successor-card-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.readiness-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 20px;
  text-transform: uppercase;
}

.badge-emergency {
  background: rgba(239, 68, 68, 0.1);
  color: var(--accent-red);
}

.badge-short {
  background: rgba(245, 158, 11, 0.1);
  color: var(--accent-yellow);
}

.badge-long {
  background: rgba(16, 185, 129, 0.1);
  color: var(--accent-green);
}

/* Common Components */
.kfc-btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  padding: 10px 20px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.kfc-btn-primary {
  background: var(--primary-color);
  color: white;
  box-shadow: 0 4px 10px var(--primary-glow);
}

.kfc-btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 6px 14px var(--primary-glow);
  transform: translateY(-1px);
}

.kfc-btn-secondary {
  background: rgba(255, 255, 255, 0.5);
  border: var(--glass-border-dark);
  color: var(--text-primary);
}

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

.kfc-btn-danger {
  background: rgba(239, 68, 68, 0.1);
  color: var(--accent-red);
}

.kfc-btn-danger:hover {
  background: var(--accent-red);
  color: white;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-content {
  background: white;
  border-radius: var(--border-radius);
  max-width: 500px;
  width: 90%;
  padding: 24px;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.8);
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: modalSlide 0.3s ease;
}

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

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-secondary);
}

.modal-close:hover {
  color: var(--text-primary);
}

/* Info Banner Notification */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 200;
}

.toast {
  background: white;
  border-left: 4px solid var(--primary-color);
  padding: 12px 20px;
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  font-weight: 500;
  animation: toastSlide 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes toastSlide {
  from {
    transform: translateX(100%) scale(0.9);
    opacity: 0;
  }
  to {
    transform: translateX(0) scale(1);
    opacity: 1;
  }
}

/* History Logs */
.audit-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 250px;
  overflow-y: auto;
  margin-top: 12px;
}

.audit-item {
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(0, 0, 0, 0.05);
  font-size: 12px;
}

.audit-meta {
  display: flex;
  justify-content: space-between;
  color: var(--text-secondary);
  font-size: 11px;
  margin-bottom: 4px;
  font-weight: 500;
}

/* Header User Details */
.header-user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.header-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.header-user-name {
  font-size: 13px;
  font-weight: 600;
}

/* Notifications Box */
.notification-bell-btn {
  position: relative;
  background: transparent;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  transition: background 0.2s;
}

.notification-bell-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-primary);
}

.bell-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  background: var(--primary-color);
  border-radius: 50%;
  border: 2px solid white;
}

.notifications-popup {
  position: absolute;
  top: 50px;
  right: 0;
  width: 320px;
  background: white;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(0, 0, 0, 0.1);
  display: none;
  flex-direction: column;
  z-index: 100;
  padding: 12px;
  gap: 10px;
}

.notifications-popup-header {
  font-weight: 700;
  font-size: 14px;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 8px;
  margin-bottom: 4px;
}

.notifications-list {
  max-height: 250px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.notification-popup-item {
  font-size: 12px;
  padding: 8px;
  border-radius: 6px;
  background: #f8fafc;
  border-left: 3px solid var(--primary-color);
  cursor: pointer;
  transition: opacity 0.15s;
}

.notification-popup-item.read {
  opacity: 0.6;
  border-left-color: #cbd5e1;
}

.notification-popup-time {
  font-size: 10px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Auto saving status indicator */
.autosave-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.autosave-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-green);
}

.autosave-dot.saving {
  background: var(--accent-yellow);
  animation: savePulse 1s infinite alternate;
}

@keyframes savePulse {
  from { opacity: 0.4; }
  to { opacity: 1; }
}

/* CSS Grid layout for Analytics */
.analytics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

@media (max-width: 1024px) {
  .analytics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .analytics-grid {
    grid-template-columns: 1fr;
  }
}

.metric-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 120px;
}

.metric-num {
  font-size: 32px;
  font-weight: 800;
  font-family: var(--font-heading);
  color: var(--primary-color);
}

.analytics-charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 768px) {
  .analytics-charts-grid {
    grid-template-columns: 1fr;
  }
}

.risk-table {
  width: 100%;
  border-collapse: collapse;
}

.risk-table th, .risk-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  font-size: 13px;
}

.risk-table th {
  font-weight: 600;
  color: var(--text-secondary);
}

.risk-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
  text-transform: uppercase;
}

.risk-high {
  background: rgba(239, 68, 68, 0.1);
  color: var(--accent-red);
}

.risk-medium {
  background: rgba(245, 158, 11, 0.1);
  color: var(--accent-yellow);
}

.risk-low {
  background: rgba(16, 185, 129, 0.1);
  color: var(--accent-green);
}

/* Стили для печати (Экспорт в PDF) */
@media print {
  body {
    background: white !important;
    color: black !important;
  }
  .app-header, .filter-bar, .autosave-indicator, #addExpBtn, .successor-search-box, .toast-container, .text-btn, .modal-overlay, #showLogsBtn, #addEmployeeBtn, .nav-links, #logoutBtn, #bellBtn, .header-user-card svg, .successor-card-right button, .matrix-tooltip {
    display: none !important;
  }
  .app-container {
    padding: 0 !important;
    margin: 0 !important;
    max-width: 100% !important;
  }
  .dashboard-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 16px !important;
  }
  .glass-panel {
    background: white !important;
    backdrop-filter: none !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: none !important;
    page-break-inside: avoid;
  }
  input, select, textarea {
    border: none !important;
    background: transparent !important;
    appearance: none !important;
    color: black !important;
    pointer-events: none !important;
  }
  .readiness-label {
    background: transparent !important;
    border: 1px solid #cbd5e1 !important;
    pointer-events: none !important;
  }
  .readiness-label.selected {
    background: #f1f5f9 !important;
    border-color: black !important;
  }
  .matrix-cell {
    box-shadow: none !important;
    border: 1px solid #cbd5e1 !important;
  }
  .matrix-cell.zone-green { background: #f0fdf4 !important; }
  .matrix-cell.zone-yellow { background: #fffbeb !important; }
  .matrix-cell.zone-grey { background: #f1f5f9 !important; }
  .matrix-cell.zone-red { background: #fef2f2 !important; }
  
  .successor-card {
    background: white !important;
    border: 1px solid #cbd5e1 !important;
    cursor: default !important;
  }
}

/* Также применяем эти стили к body.printing-mode для совместимости при экспорте */
body.printing-mode {
  background: white !important;
  color: black !important;
}
body.printing-mode .app-header, 
body.printing-mode .filter-bar, 
body.printing-mode .autosave-indicator, 
body.printing-mode #addExpBtn, 
body.printing-mode .successor-search-box, 
body.printing-mode .toast-container, 
body.printing-mode .text-btn, 
body.printing-mode .modal-overlay, 
body.printing-mode #showLogsBtn, 
body.printing-mode #addEmployeeBtn, 
body.printing-mode .nav-links, 
body.printing-mode #logoutBtn, 
body.printing-mode #bellBtn, 
body.printing-mode .header-user-card svg, 
body.printing-mode .successor-card-right button, 
body.printing-mode .matrix-tooltip {
  display: none !important;
}
body.printing-mode .app-container {
  padding: 0 !important;
  margin: 0 !important;
  max-width: 100% !important;
}
body.printing-mode .dashboard-grid {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 16px !important;
}
body.printing-mode .glass-panel {
  background: white !important;
  backdrop-filter: none !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: none !important;
  page-break-inside: avoid;
}
body.printing-mode input, 
body.printing-mode select, 
body.printing-mode textarea {
  border: none !important;
  background: transparent !important;
  appearance: none !important;
  color: black !important;
  pointer-events: none !important;
}
body.printing-mode .readiness-label {
  background: transparent !important;
  border: 1px solid #cbd5e1 !important;
  pointer-events: none !important;
}
body.printing-mode .readiness-label.selected {
  background: #f1f5f9 !important;
  border-color: black !important;
}
body.printing-mode .matrix-cell {
  box-shadow: none !important;
  border: 1px solid #cbd5e1 !important;
}
body.printing-mode .matrix-cell.zone-green { background: #f0fdf4 !important; }
body.printing-mode .matrix-cell.zone-yellow { background: #fffbeb !important; }
body.printing-mode .matrix-cell.zone-grey { background: #f1f5f9 !important; }
body.printing-mode .matrix-cell.zone-red { background: #fef2f2 !important; }
body.printing-mode .successor-card {
  background: white !important;
  border: 1px solid #cbd5e1 !important;
  cursor: default !important;
}

