* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 20px 0;
}

.app {
  max-width: 1600px;
  margin: auto;
  padding: 16px 24px;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}

h1 {
  color: #fff;
  font-size: 36px;
  font-weight: 700;
  margin: 0 0 20px 0;
  text-shadow: 0 2px 10px rgba(0,0,0,0.1);
  grid-column: 1 / -1;
}

h3 {
  color: #2d3748;
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 10px 0;
  padding-bottom: 8px;
  border-bottom: 2px solid #e2e8f0;
}

section {
  background: #fff;
  padding: 16px 20px;
  border-radius: 12px;
  margin-bottom: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  transition: transform 0.2s, box-shadow 0.2s;
}

section:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

label {
  display: flex;
  align-items: center;
  margin: 4px 0;
  cursor: pointer;
  padding: 8px 10px;
  border-radius: 6px;
  transition: background 0.2s;
  font-size: 14px;
  line-height: 1.4;
  color: #2d3748;
}

label:hover {
  background: #f7fafc;
}

label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-right: 10px;
  cursor: pointer;
  accent-color: #667eea;
  flex-shrink: 0;
}

.critical {
  color: #e53e3e;
  font-size: 12px;
  margin-left: 8px;
  padding: 2px 8px;
  background: #fed7d7;
  border-radius: 12px;
  font-weight: 600;
}

.risk {
  color: #d69e2e;
  font-size: 12px;
  margin-left: 8px;
  padding: 2px 8px;
  background: #fefcbf;
  border-radius: 12px;
  font-weight: 600;
}

.result-zone {
  background: #fff;
  padding: 20px;
  border-radius: 16px;
  position: sticky;
  top: 16px;
  align-self: start;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.result-zone strong {
  display: block;
  font-size: 18px;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 12px;
}

#percent {
  font-size: 36px;
  font-weight: 700;
  color: #667eea;
  margin: 8px 0;
  text-align: center;
  transition: color 0.3s ease;
}

.bar {
  height: 16px;
  background: #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  margin: 16px 0;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.06);
  position: relative;
}

.bar span {
  display: block;
  height: 100%;
  width: 0%;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.bar span::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, 
    rgba(255,255,255,0.3) 0%, 
    rgba(255,255,255,0) 50%, 
    rgba(255,255,255,0.3) 100%);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.bar.progress-low span {
  background: linear-gradient(90deg, #fc8181 0%, #f56565 100%);
}

.bar.progress-medium span {
  background: linear-gradient(90deg, #f6ad55 0%, #ed8936 100%);
}

.bar.progress-high span {
  background: linear-gradient(90deg, #68d391 0%, #48bb78 100%);
}

.bar.progress-complete span {
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

#resultText {
  white-space: pre-line;
  line-height: 1.6;
  margin-top: 16px;
  padding: 16px;
  background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
  border-radius: 12px;
  font-size: 14px;
  color: #4a5568;
  border-left: 4px solid #667eea;
}

button {
  margin-top: 0;
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
  width: 100%;
}

.tech-menu button {
  margin-top: 0;
}

#finishBtn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

#finishBtn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
}

#myProjectsBtn {
  background: #edf2f7;
  color: #2d3748;
}

#myProjectsBtn:hover {
  background: #e2e8f0;
  transform: translateY(-1px);
}

.modern-open-btn {
  background: linear-gradient(90deg, #1976d2 0%, #1e90ff 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.18s cubic-bezier(.4,0,.2,1), box-shadow 0.18s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 2px 8px rgba(30,94,204,0.2);
  outline: none;
}

.modern-open-btn:hover, .modern-open-btn:focus {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 20px rgba(30,94,204,0.3);
  background: linear-gradient(90deg, #1e90ff 0%, #1976d2 100%);
}

/* Категории клиентов */
.category-container {
  margin-bottom: 16px;
}

.category-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  justify-content: flex-start;
}

.category-btn {
  padding: 10px 18px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  color: #4a5568;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}

.category-btn:hover {
  border-color: #cbd5e0;
  background: #f7fafc;
}

.category-btn.active {
  background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
  color: #fff;
  border-color: #48bb78;
  box-shadow: 0 2px 8px rgba(72, 187, 120, 0.3);
}

/* Вкладки направлений */
.tabs-container {
  margin-bottom: 20px;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
  align-items: flex-start;
}

.tab-btn {
  padding: 10px 12px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  color: #4a5568;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  text-align: center;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tab-btn:hover {
  border-color: #cbd5e0;
  background: #f7fafc;
}

.tab-btn.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border-color: #667eea;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

/* Выбор типа чек-листа */
.checklist-type-selector {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.type-btn {
  flex: 1;
  padding: 12px 20px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  color: #4a5568;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.type-btn:hover {
  border-color: #cbd5e0;
  background: #f7fafc;
}

.type-btn.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border-color: #667eea;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

select {
  padding: 14px 16px;
  width: 100%;
  margin-bottom: 24px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-size: 15px;
  background: #fff;
  color: #2d3748;
  cursor: pointer;
  transition: all 0.2s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23667eea' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
  display: none;
}

select:hover {
  border-color: #cbd5e0;
}

select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#projectsList {
  margin-top: 16px;
}

#projectsList > div {
  margin-bottom: 12px;
  padding: 16px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f7fafc;
  transition: all 0.2s;
}

#projectsList > div:hover {
  border-color: #cbd5e0;
  background: #edf2f7;
}

/* Прогресс по этапам */
#stagesProgress {
  margin-top: 16px;
  max-height: 300px;
  overflow-y: auto;
}

.stage-progress-item {
  margin-bottom: 8px;
  padding: 8px;
  background: #f7fafc;
  border-radius: 6px;
  border-left: 3px solid #e2e8f0;
}

.stage-progress-item.complete {
  border-left-color: #48bb78;
}

.stage-progress-item.partial {
  border-left-color: #ed8936;
}

.stage-progress-item h4 {
  font-size: 12px;
  font-weight: 600;
  color: #2d3748;
  margin: 0 0 4px 0;
  line-height: 1.3;
}

.stage-progress-bar {
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
  margin-top: 4px;
}

.stage-progress-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #48bb78 0%, #38a169 100%);
  transition: width 0.3s;
}

/* Скроллбар */
.result-zone::-webkit-scrollbar {
  width: 8px;
}

.result-zone::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.result-zone::-webkit-scrollbar-thumb {
  background: #cbd5e0;
  border-radius: 10px;
}

.result-zone::-webkit-scrollbar-thumb:hover {
  background: #a0aec0;
}

/* Стили для печати (PDF) */
@media print {
  body {
    background: #fff;
  }
  
  .app {
    max-width: 100%;
    grid-template-columns: 1fr;
    gap: 0;
    padding: 0;
  }
  
  .result-zone {
    position: static;
    max-height: none;
    page-break-inside: avoid;
  }
  
  button, .tabs-container, .checklist-type-selector {
    display: none;
  }
  
  section {
    page-break-inside: avoid;
    margin-bottom: 16px;
  }
  
  h1 {
    color: #000;
    text-shadow: none;
  }
}