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

html {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: #2d3748;
  background: #f7fafc;
}

body {
  min-height: 100vh;
}

.nav {
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 32px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  font-size: 18px;
  font-weight: 600;
  color: #8b7fc7;
}

.nav-links {
  display: flex;
  gap: 8px;
}

.nav-link {
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  border: none;
  background: transparent;
  color: #64748b;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.nav-link:hover {
  background: #f1f5f9;
  color: #475569;
}

.nav-link.active {
  background: #8b7fc7;
  color: white;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 24px;
}

.view-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.view-header h1 {
  font-size: 28px;
  font-weight: 600;
  color: #1a202c;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
}

.stat-label {
  font-size: 13px;
  color: #64748b;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 32px;
  font-weight: 600;
  color: #1a202c;
}

.stat-trend {
  font-size: 12px;
  color: #10b981;
  margin-top: 4px;
}

.card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.card-title {
  font-size: 18px;
  font-weight: 600;
  color: #1a202c;
}

.btn {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary {
  background: #8b7fc7;
  color: white;
}

.btn-primary:hover {
  background: #7a6fb5;
}

.btn-secondary {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  color: #2d3748;
}

.btn-secondary:hover {
  background: #f7fafc;
}

.btn-small {
  padding: 6px 12px;
  font-size: 13px;
}

.btn-danger {
  background: #ef4444;
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
}

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

.company-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
  transition: all 0.2s;
}

.company-card:hover {
  border-color: #8b7fc7;
  box-shadow: 0 4px 12px rgba(139, 127, 199, 0.1);
}

.company-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 12px;
}

.company-name {
  font-size: 16px;
  font-weight: 600;
  color: #1a202c;
}

.company-founder {
  font-size: 13px;
  color: #64748b;
  margin-bottom: 8px;
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 6px;
  margin-right: 6px;
  margin-bottom: 6px;
}

.badge-stage {
  background: #dbeafe;
  color: #1e40af;
}

.badge-focus {
  background: #fef3c7;
  color: #92400e;
}

.company-notes {
  font-size: 13px;
  color: #64748b;
  margin-top: 12px;
  line-height: 1.5;
}

.company-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.activity-item {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #8b7fc7;
  border-radius: 8px;
  padding: 16px;
  transition: all 0.2s;
}

.activity-item:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.activity-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 8px;
}

.activity-title {
  font-size: 15px;
  font-weight: 600;
  color: #1a202c;
}

.activity-meta {
  display: flex;
  gap: 12px;
  font-size: 13px;
  color: #64748b;
  margin-bottom: 8px;
}

.activity-description {
  font-size: 13px;
  color: #475569;
  margin-bottom: 8px;
}

.activity-outcome {
  font-size: 13px;
  color: #059669;
  background: #d1fae5;
  padding: 8px 12px;
  border-radius: 6px;
  margin-top: 8px;
}

.activity-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.badge-type {
  background: #e0e7ff;
  color: #3730a3;
}

.badge-status-planned {
  background: #fef3c7;
  color: #92400e;
}

.badge-status-in_progress {
  background: #dbeafe;
  color: #1e40af;
}

.badge-status-completed {
  background: #d1fae5;
  color: #065f46;
}

.badge-status-cancelled {
  background: #fee2e2;
  color: #991b1b;
}

.milestone-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.milestone-item {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
}

.milestone-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 12px;
}

.milestone-title {
  font-size: 16px;
  font-weight: 600;
  color: #1a202c;
}

.milestone-description {
  font-size: 13px;
  color: #64748b;
  margin-bottom: 12px;
}

.milestone-meta {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: #64748b;
  margin-bottom: 12px;
}

.progress-bar {
  background: #e2e8f0;
  border-radius: 8px;
  height: 8px;
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-fill {
  background: #8b7fc7;
  height: 100%;
  transition: width 0.3s;
}

.milestone-notes {
  font-size: 13px;
  color: #475569;
  background: #f7fafc;
  padding: 8px 12px;
  border-radius: 6px;
  margin-top: 8px;
}

.milestone-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.project-selector {
  margin-top: 8px;
}

.project-selector select {
  min-width: 300px;
  font-size: 15px;
  font-weight: 500;
}

.project-info-card {
  background: linear-gradient(135deg, #8b7fc7 0%, #a393d1 100%);
  color: white;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
}

.project-info-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 20px;
}

.project-info-header h2 {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 8px;
}

.project-description {
  font-size: 14px;
  opacity: 0.9;
  line-height: 1.5;
}

.project-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.2);
}

.project-meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.meta-label {
  font-size: 12px;
  opacity: 0.8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.meta-value {
  font-size: 16px;
  font-weight: 600;
}

.project-warning {
  margin-top: 16px;
  padding: 12px 16px;
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
}

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: #ffffff;
  border-radius: 12px;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px;
  border-bottom: 1px solid #e2e8f0;
}

.modal-header h2 {
  font-size: 20px;
  font-weight: 600;
  color: #1a202c;
}

.modal-close {
  background: none;
  border: none;
  font-size: 28px;
  color: #64748b;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  color: #1a202c;
}

form {
  padding: 24px;
}

.form-section {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid #e2e8f0;
}

.form-section:last-of-type {
  border-bottom: none;
  padding-bottom: 0;
}

.form-section-title {
  font-size: 14px;
  font-weight: 600;
  color: #1a202c;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #475569;
  margin-bottom: 6px;
}

input, select, textarea {
  padding: 10px 14px;
  font-size: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  width: 100%;
  font-family: inherit;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #8b7fc7;
  box-shadow: 0 0 0 3px rgba(139, 127, 199, 0.1);
}

textarea {
  resize: vertical;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding-top: 20px;
  border-top: 1px solid #e2e8f0;
}

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: #64748b;
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.empty-state-title {
  font-size: 18px;
  font-weight: 600;
  color: #1a202c;
  margin-bottom: 8px;
}

.empty-state-text {
  font-size: 14px;
  margin-bottom: 20px;
}

.filters {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-group label {
  font-size: 12px;
  font-weight: 500;
  color: #64748b;
}

.filter-group select {
  min-width: 180px;
}

@media (max-width: 768px) {
  .nav {
    flex-direction: column;
    gap: 16px;
  }
  
  .nav-links {
    width: 100%;
    justify-content: space-around;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .companies-grid {
    grid-template-columns: 1fr;
  }
  
  .view-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
}