/* Dashboard Styles */

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

.dashboard-title {
  font-size: 32px;
  font-weight: 700;
  color: #2e2e38;
  margin-bottom: 8px;
}

.dashboard-subtitle {
  font-size: 16px;
  color: #6e6e78;
  margin-bottom: 32px;
}

/* Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.metric-card {
  background: white;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s, box-shadow 0.2s;
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.metric-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.metric-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: white;
  font-weight: bold;
}

.metric-label {
  font-size: 14px;
  color: #6e6e78;
  font-weight: 500;
}

.metric-value {
  font-size: 36px;
  font-weight: 700;
  color: #2e2e38;
  margin-bottom: 8px;
}

.metric-trend {
  font-size: 13px;
  color: #4CAF50;
  font-weight: 500;
}

/* Chart Section */
.chart-section {
  background: white;
  border-radius: 12px;
  padding: 32px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  margin-bottom: 40px;
}

.section-title {
  font-size: 20px;
  font-weight: 700;
  color: #2e2e38;
  margin-bottom: 24px;
}

.chart-container {
  height: 300px;
  position: relative;
}

/* Control Families */
.control-families-section {
  margin-bottom: 40px;
}

.families-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.family-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.family-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

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

.family-id {
  font-size: 18px;
  font-weight: 700;
  color: #2e2e38;
  background: #f5f5f7;
  padding: 6px 12px;
  border-radius: 6px;
}

.family-score {
  font-size: 24px;
  font-weight: 700;
  color: #4CAF50;
}

.family-name {
  font-size: 16px;
  font-weight: 600;
  color: #2e2e38;
  margin-bottom: 16px;
  min-height: 48px;
}

.family-stats {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.stat-item {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: 500;
}

.stat-compliant {
  background: #E8F5E9;
  color: #2E7D32;
}

.stat-partial {
  background: #FFF3E0;
  color: #E65100;
}

.stat-non {
  background: #FFEBEE;
  color: #C62828;
}

.progress-bar {
  height: 6px;
  background: #f5f5f7;
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4CAF50 0%, #66BB6A 100%);
  transition: width 0.3s ease;
}

/* Findings Section */
.findings-section {
  background: white;
  border-radius: 12px;
  padding: 32px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.findings-table {
  width: 100%;
}

.table-header {
  display: grid;
  grid-template-columns: 100px 1fr 120px 120px 140px;
  gap: 16px;
  padding: 12px 16px;
  background: #f5f5f7;
  border-radius: 8px;
  margin-bottom: 8px;
}

.th {
  font-size: 13px;
  font-weight: 700;
  color: #6e6e78;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.table-row {
  display: grid;
  grid-template-columns: 100px 1fr 120px 120px 140px;
  gap: 16px;
  padding: 16px;
  border-bottom: 1px solid #f5f5f7;
  transition: background 0.2s;
}

.table-row:hover {
  background: #fafafa;
}

.td {
  font-size: 14px;
  color: #2e2e38;
  display: flex;
  align-items: center;
}

.finding-title {
  font-weight: 500;
}

.control-badge {
  background: #2e2e38;
  color: white;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  font-family: 'Courier New', monospace;
}

.severity-badge {
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.severity-high {
  background: #FFEBEE;
  color: #C62828;
}

.severity-medium {
  background: #FFF3E0;
  color: #E65100;
}

.severity-low {
  background: #E3F2FD;
  color: #1565C0;
}

.status-badge {
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.status-open {
  background: #FFEBEE;
  color: #C62828;
}

.status-progress {
  background: #FFF3E0;
  color: #E65100;
}

.status-resolved {
  background: #E8F5E9;
  color: #2E7D32;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .table-header,
  .table-row {
    grid-template-columns: 80px 1fr 100px 100px 120px;
    gap: 12px;
  }
  
  .families-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }
}

@media (max-width: 768px) {
  .dashboard-container {
    padding: 20px;
  }
  
  .metrics-grid {
    grid-template-columns: 1fr;
  }
  
  .families-grid {
    grid-template-columns: 1fr;
  }
  
  .table-header {
    display: none;
  }
  
  .table-row {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 16px;
    border: 1px solid #f5f5f7;
    border-radius: 8px;
    margin-bottom: 12px;
  }
  
  .td::before {
    content: attr(data-label);
    font-weight: 700;
    color: #6e6e78;
    margin-right: 8px;
    font-size: 12px;
    text-transform: uppercase;
  }
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.metric-card,
.family-card,
.table-row {
  animation: fadeIn 0.3s ease-out;
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease-out;
}

.modal-content {
  background: white;
  border-radius: 16px;
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.3s ease-out;
}

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

.modal-header {
  padding: 32px;
  border-bottom: 2px solid #f5f5f7;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
}

.modal-title {
  font-size: 28px;
  font-weight: 700;
  color: #2e2e38;
  margin: 0 0 12px 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-family-id {
  background: #2e2e38;
  color: white;
  padding: 6px 16px;
  border-radius: 8px;
  font-size: 20px;
  font-family: 'Courier New', monospace;
}

.modal-description {
  font-size: 15px;
  color: #6e6e78;
  line-height: 1.6;
  margin: 0;
}

.modal-close {
  background: #f5f5f7;
  border: none;
  border-radius: 8px;
  width: 40px;
  height: 40px;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6e6e78;
  transition: all 0.2s;
  flex-shrink: 0;
}

.modal-close:hover {
  background: #e5e5e7;
  color: #2e2e38;
  transform: rotate(90deg);
}

.modal-body {
  padding: 32px;
  overflow-y: auto;
}

.modal-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
  padding: 24px;
  background: #f5f5f7;
  border-radius: 12px;
}

.modal-stat {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal-stat-label {
  font-size: 12px;
  color: #6e6e78;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.modal-stat-value {
  font-size: 24px;
  font-weight: 700;
  color: #2e2e38;
}

.modal-stat-value.stat-compliant {
  color: #2E7D32;
}

.modal-stat-value.stat-partial {
  color: #E65100;
}

.modal-stat-value.stat-non {
  color: #C62828;
}

.controls-title {
  font-size: 18px;
  font-weight: 700;
  color: #2e2e38;
  margin: 0 0 20px 0;
}

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

.control-item {
  background: white;
  border: 2px solid #f5f5f7;
  border-radius: 12px;
  padding: 20px;
  transition: all 0.2s;
}

.control-item:hover {
  border-color: #e5e5e7;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.control-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  gap: 12px;
}

.control-item-id {
  background: #2e2e38;
  color: white;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  font-family: 'Courier New', monospace;
}

.control-status-badge {
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.control-status-compliant {
  background: #E8F5E9;
  color: #2E7D32;
}

.control-status-partial {
  background: #FFF3E0;
  color: #E65100;
}

.control-status-non {
  background: #FFEBEE;
  color: #C62828;
}

.control-item-name {
  font-size: 16px;
  font-weight: 600;
  color: #2e2e38;
  margin-bottom: 8px;
}

.control-item-description {
  font-size: 14px;
  color: #6e6e78;
  line-height: 1.6;
}

/* Modal Responsive */
@media (max-width: 768px) {
  .modal-overlay {
    padding: 0;
  }
  
  .modal-content {
    border-radius: 0;
    max-height: 100vh;
    height: 100vh;
  }
  
  .modal-header {
    padding: 20px;
  }
  
  .modal-title {
    font-size: 22px;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .modal-body {
    padding: 20px;
  }
  
  .modal-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 16px;
  }
}

/* Print Styles */
@media print {
  .dashboard-container {
    padding: 0;
  }
  
  .metric-card,
  .family-card,
  .chart-section,
  .findings-section {
    box-shadow: none;
    page-break-inside: avoid;
  }
  
  .modal-overlay {
    display: none;
  }
}
