/* ISO 9001:2015 QMS Custom Stylesheet & Print Optimizations */

:root {
  --primary: #1e3a8a;
  --primary-light: #3b82f6;
  --primary-dark: #172554;
  --secondary: #0f766e;
  --success: #15803d;
  --warning: #b45309;
  --danger: #b91c1c;
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-600: #475569;
  --slate-800: #1e293b;
  --slate-900: #0f172a;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #1e293b;
  background-color: #f8fafc;
  margin: 0;
  padding: 0;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Sidebar transitions */
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  border-radius: 0.5rem;
  color: #94a3b8;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.15s ease-in-out;
  cursor: pointer;
  text-decoration: none;
}
.sidebar-link:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}
.sidebar-link.active {
  background-color: #2563eb;
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
}

/* KPI Card Animations */
.kpi-card {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
}

/* 5x5 Risk Matrix */
.risk-matrix-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-top: 8px;
}
.risk-cell {
  aspect-ratio: 1.2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
  border: 1px solid rgba(0, 0, 0, 0.05);
}
.risk-cell:hover {
  transform: scale(1.05);
  z-index: 10;
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}
.risk-green { background-color: #dcfce7; color: #166534; }
.risk-yellow { background-color: #fef9c3; color: #854d0e; }
.risk-orange { background-color: #ffedd5; color: #9a3412; }
.risk-red { background-color: #fee2e2; color: #991b1b; }

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
}
.badge-success { background-color: #dcfce7; color: #15803d; }
.badge-warning { background-color: #fef3c7; color: #b45309; }
.badge-danger { background-color: #fee2e2; color: #b91c1c; }
.badge-info { background-color: #dbeafe; color: #1d4ed8; }
.badge-purple { background-color: #f3e8ff; color: #6b21a8; }
.badge-gray { background-color: #f1f5f9; color: #475569; }

/* Modal Styles */
.modal-overlay {
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(2px);
}
.modal-content {
  max-height: 90vh;
}

/* 5-Whys visual flowchart steps */
.why-step {
  border-left: 3px solid #3b82f6;
  padding-left: 1rem;
  margin-bottom: 0.75rem;
  position: relative;
}
.why-step::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 6px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background-color: #3b82f6;
}

/* Print Styling for ISO 9001 Audit Dossier */
@media print {
  body {
    background-color: #ffffff !important;
    color: #000000 !important;
    font-size: 10pt;
  }
  .no-print {
    display: none !important;
  }
  .print-only {
    display: block !important;
  }
  .page-break {
    page-break-before: always;
  }
  .card, table, .border {
    border-color: #cbd5e1 !important;
    box-shadow: none !important;
  }
  a {
    text-decoration: none;
    color: inherit;
  }
}

