/* DMT Risk Assessment System v2.0 - Custom Styles */

/* Navigation and Layout Styles */
.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  z-index: 50;
}

.dropdown-menu.hidden {
  display: none;
}

.dropdown {
  position: relative;
}

/* Ensure navigation doesn't create extra spacing */
nav {
  position: relative;
  z-index: 40;
}

main {
  position: relative;
  z-index: 1;
}

/* Navigation Menu Styles */
.nav-menu-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 0.5rem;
  color: #374151;
  transition: all 0.2s ease;
  cursor: pointer;
}

.nav-menu-item:hover {
  background-color: #f9fafb;
  color: #111827;
}

.nav-menu-item.active {
  background-color: #eff6ff;
  color: #2563eb;
}

.nav-submenu-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  border-radius: 0.375rem;
  color: #4b5563;
  transition: all 0.2s ease;
  cursor: pointer;
  font-size: 0.875rem;
}

.nav-submenu-item:hover {
  background-color: #f9fafb;
  color: #111827;
}

.nav-submenu-item.active {
  background-color: #eff6ff;
  color: #2563eb;
}

.ai-intel-menu:hover .ai-intel-submenu {
  opacity: 1;
  visibility: visible;
}

/* Enhanced Settings Styles */
.settings-nav-item {
  transition: all 0.2s ease;
}

.settings-nav-item:hover {
  background-color: #f3f4f6;
}

.settings-nav-item.active {
  background-color: #eff6ff;
  color: #2563eb;
}

/* AI Assure Navigation Styles */
.ai-assure-nav-item {
  transition: all 0.2s ease;
}

.ai-assure-nav-item:hover {
  background-color: #f3f4f6;
}

.ai-assure-nav-item.active {
  background-color: #eff6ff;
  color: #2563eb;
}

.system-subtab {
  transition: all 0.2s ease;
}

.system-subtab:hover {
  background-color: #f9fafb;
}

.system-subtab.active {
  background-color: #f3f4f6;
}

.auto-save-field {
  transition: all 0.2s ease;
}

.auto-save-field:focus {
  ring-color: #3b82f6;
  border-color: transparent;
}

/* Mobile Responsive Settings */
@media (max-width: 1024px) {
  .settings-sidebar.fixed {
    background: rgba(0, 0, 0, 0.5);
  }
  
  .settings-sidebar.fixed > div {
    background: white;
    max-width: 280px;
    height: 100vh;
    overflow-y: auto;
  }
}

/* Auto-save status animation */
.fa-spin {
  animation: fa-spin 1s infinite linear;
}

@keyframes fa-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Advanced settings toggle animation */
.transform {
  transition: transform 0.2s ease;
}

.rotate-90 {
  transform: rotate(90deg);
}

/* Framework Tabs */
.framework-tab {
  padding: 8px 16px;
  border-bottom: 2px solid transparent;
  color: #6b7280;
  font-weight: 500;
  transition: all 0.2s ease;
}

.framework-tab:hover {
  color: #374151;
  border-bottom-color: #d1d5db;
}

.framework-tab.active {
  color: #2563eb;
  border-bottom-color: #2563eb;
}

/* Modern Navigation Styles */
.nav-container {
  position: relative;
}

/* Hover bridge below trigger to eliminate hover gap */
.nav-container::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 10px;
}

.nav-menu {
  z-index: 1000;
  pointer-events: none; /* disabled when hidden */
}

/* Ensure hidden dropdowns don't steal clicks */
.nav-menu[style*="display: none"],
.nav-menu[style*="visibility: hidden"],
.nav-menu.invisible,
.nav-menu.opacity-0 {
  pointer-events: none;
}

/* Keep menu open while hovered */
.nav-menu:hover {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto;
}

.nav-menu-item {
  display: flex;
  align-items: center;
  space-x: 12px;
  padding: 12px 16px;
  border-radius: 8px;
  text-decoration: none;
  color: #374151;
  font-weight: 500;
  transition: all 0.2s ease;
}

.nav-menu-item:hover {
  background-color: #f3f4f6;
  color: #111827;
}

/* Ensure no ancestor clips dropdowns */
#navigation, #navigation * {
  overflow: visible !important;
}

/* (reverted) generic dropdown helpers removed to restore simple nav */

.nav-menu-item.active {
  background-color: #eff6ff;
  color: #2563eb;
}

.nav-menu-item i {
  width: 20px;
  text-align: center;
  margin-right: 12px;
}

/* Notification styles */
#notifications-dropdown {
  max-height: 400px;
  overflow-y: auto;
}

/* Mobile-First Responsive Design */
@media (max-width: 768px) {
  /* Mobile Navigation */
  .nav-mobile {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #e5e7eb;
    padding: 8px 0;
    z-index: 50;
    display: flex;
    justify-content: space-around;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  }

  .nav-mobile-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 4px;
    color: #6b7280;
    text-decoration: none;
    font-size: 10px;
    min-width: 60px;
    touch-action: manipulation;
  }

  .nav-mobile-item.active {
    color: #3b82f6;
  }

  .nav-mobile-item i {
    font-size: 18px;
    margin-bottom: 2px;
  }

  /* Mobile Header */
  .mobile-header {
    padding: 12px 16px;
    background: white;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 40;
  }

  .mobile-header h1 {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
  }

  /* Mobile Content */
  .mobile-content {
    padding: 16px;
    padding-bottom: 80px; /* Space for bottom navigation */
  }

  /* Touch-friendly buttons */
  .btn-mobile {
    min-height: 44px;
    padding: 12px 16px;
    font-size: 16px;
    touch-action: manipulation;
  }

  /* Cards on mobile */
  .card-mobile {
    margin-bottom: 12px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  }

  /* Form inputs on mobile */
  .form-input-mobile {
    min-height: 44px;
    padding: 12px 16px;
    font-size: 16px; /* Prevents zoom on iOS */
    border-radius: 8px;
  }

  /* Hide desktop navigation on mobile */
  .desktop-nav {
    display: none !important;
  }

  /* Mobile grid adjustments */
  .mobile-grid-1 {
    grid-template-columns: 1fr;
  }

  .mobile-grid-2 {
    grid-template-columns: 1fr 1fr;
  }

  /* Touch-friendly spacing */
  .mobile-spacing {
    padding: 16px;
    margin-bottom: 16px;
  }

  /* Modal adjustments for mobile */
  .modal-mobile {
    margin: 16px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
  }

  /* Dashboard metrics on mobile */
  .metric-card-mobile {
    padding: 16px;
    text-align: center;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 12px;
  }

  /* Notification bell on mobile */
  .notification-bell-mobile {
    position: relative;
    padding: 8px;
    background: transparent;
    border: none;
    color: #6b7280;
  }

  /* Heat map container mobile */
  .heatmap-mobile {
    overflow-x: auto;
    margin: -16px;
    padding: 16px;
  }

  /* Document grid mobile */
  .document-grid-mobile {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  /* Table responsive on mobile */
  .table-mobile {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .table-mobile table {
    min-width: 600px;
  }

  /* Swipe indicators */
  .swipe-indicator {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 12px;
  }

  /* Pull to refresh indicator */
  .pull-refresh {
    position: absolute;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    color: #6b7280;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.3s ease;
  }

  .pull-refresh.show {
    opacity: 1;
  }
}

/* Tablet adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
  .tablet-grid-2 {
    grid-template-columns: 1fr 1fr;
  }

  .tablet-grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Tablet navigation */
  .nav-tablet {
    padding: 16px 24px;
  }

  .nav-tablet .nav-item {
    padding: 12px 16px;
    font-size: 14px;
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  /* Larger touch targets */
  .btn, .nav-item, .dropdown-item {
    min-height: 44px;
    padding: 12px 16px;
  }

  /* Remove hover effects on touch devices */
  .btn:hover, .nav-item:hover {
    background-color: inherit;
  }

  /* Touch-friendly dropdowns */
  .dropdown-menu {
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  }

  .dropdown-item {
    padding: 16px 20px;
    font-size: 16px;
  }

  /* Touch scroll indicators */
  .scrollable {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
  }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  /* Sharper icons and borders */
  .icon {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
}

/* Dark mode preferences */
@media (prefers-color-scheme: dark) {
  /* Dark mode styles would go here if implemented */
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Loading animations */
.animate-pulse-slow {
  animation: pulse-slow 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse-slow {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: .5;
  }
}

/* Risk level colors */
.risk-critical {
  @apply bg-red-100 text-red-800 border-red-200;
}

.risk-high {
  @apply bg-orange-100 text-orange-800 border-orange-200;
}

.risk-medium {
  @apply bg-yellow-100 text-yellow-800 border-yellow-200;
}

.risk-low {
  @apply bg-green-100 text-green-800 border-green-200;
}

.risk-very-low {
  @apply bg-gray-100 text-gray-800 border-gray-200;
}

/* Status indicators */
.status-active {
  @apply bg-green-100 text-green-800;
}

.status-inactive {
  @apply bg-gray-100 text-gray-800;
}

.status-pending {
  @apply bg-yellow-100 text-yellow-800;
}

.status-completed {
  @apply bg-blue-100 text-blue-800;
}

/* Dashboard cards */
.dashboard-card {
  @apply bg-white rounded-lg shadow-sm border border-gray-200 p-6;
  transition: all 0.2s ease-in-out;
}

.dashboard-card:hover {
  @apply shadow-md border-gray-300;
}

.metric-card {
  @apply dashboard-card flex items-center justify-between;
}

.metric-value {
  @apply text-3xl font-bold;
}

.metric-label {
  @apply text-sm text-gray-600 mt-1;
}

.metric-icon {
  @apply w-12 h-12 rounded-lg flex items-center justify-center text-xl;
}

/* Navigation */
.nav-item {
  @apply flex items-center px-4 py-2 text-sm font-medium rounded-md transition-colors duration-150;
}

.nav-item:hover {
  @apply bg-gray-100 text-gray-900;
}

.nav-item.active {
  @apply bg-blue-100 text-blue-700;
}

/* Tables */
.table-container {
  @apply bg-white rounded-lg shadow overflow-hidden;
}

.table-header {
  @apply bg-gray-50 px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider;
}

.table-cell {
  @apply px-6 py-4 whitespace-nowrap text-sm text-gray-900;
}

.table-row:hover {
  @apply bg-gray-50;
}

/* Enhanced Buttons */
.btn-primary {
  background: linear-gradient(135deg, rgb(37, 99, 235) 0%, rgb(29, 78, 216) 100%);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: 0.025em;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -1px rgb(0 0 0 / 0.06);
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-primary:hover {
  background: linear-gradient(135deg, rgb(29, 78, 216) 0%, rgb(37, 99, 235) 100%);
  transform: translateY(-1px);
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -2px rgb(0 0 0 / 0.05);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -1px rgb(0 0 0 / 0.06);
}

.btn-primary:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgb(59 130 246 / 0.3), 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

.btn-secondary {
  background: linear-gradient(135deg, rgb(248, 250, 252) 0%, rgb(241, 245, 249) 100%);
  color: rgb(55, 65, 81);
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  border: 1.5px solid rgb(209, 213, 219);
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: 0.025em;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px 0 rgb(0 0 0 / 0.06);
}

.btn-secondary:hover {
  background: linear-gradient(135deg, rgb(241, 245, 249) 0%, rgb(229, 231, 235) 100%);
  border-color: rgb(156, 163, 175);
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -1px rgb(0 0 0 / 0.06);
}

.btn-secondary:active {
  transform: translateY(0);
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px 0 rgb(0 0 0 / 0.06);
}

.btn-secondary:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgb(156 163 175 / 0.3), 0 1px 3px 0 rgb(0 0 0 / 0.1);
}

.btn-danger {
  background: linear-gradient(135deg, rgb(220, 38, 38) 0%, rgb(185, 28, 28) 100%);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: 0.025em;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -1px rgb(0 0 0 / 0.06);
}

.btn-danger:hover {
  background: linear-gradient(135deg, rgb(185, 28, 28) 0%, rgb(153, 27, 27) 100%);
  transform: translateY(-1px);
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -2px rgb(0 0 0 / 0.05);
}

.btn-danger:active {
  transform: translateY(0);
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -1px rgb(0 0 0 / 0.06);
}

.btn-danger:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgb(248 113 113 / 0.3), 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

/* Forms - Enhanced Modern Styling */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: rgb(31, 41, 55);
  margin-bottom: 0.625rem;
  letter-spacing: 0.025em;
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid rgb(209, 213, 219);
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px 0 rgb(0 0 0 / 0.06);
  background-color: white;
  font-size: 0.875rem;
  transition: all 0.2s ease-in-out;
  position: relative;
}

.form-input:hover {
  border-color: rgb(156, 163, 175);
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.12), 0 1px 2px 0 rgb(0 0 0 / 0.08);
}

.form-input:focus {
  outline: none;
  border-color: rgb(59, 130, 246);
  box-shadow: 0 0 0 3px rgb(59 130 246 / 0.1), 0 1px 3px 0 rgb(0 0 0 / 0.1);
  background-color: rgb(249, 250, 251);
}

.form-input::placeholder {
  color: rgb(156, 163, 175);
  font-style: italic;
}

.form-select {
  width: 100%;
  padding: 0.75rem 1rem;
  padding-right: 2.5rem;
  border: 1.5px solid rgb(209, 213, 219);
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px 0 rgb(0 0 0 / 0.06);
  background-color: white;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.75rem center;
  background-repeat: no-repeat;
  background-size: 1rem;
  font-size: 0.875rem;
  transition: all 0.2s ease-in-out;
  appearance: none;
}

.form-select:hover {
  border-color: rgb(156, 163, 175);
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.12), 0 1px 2px 0 rgb(0 0 0 / 0.08);
}

.form-select:focus {
  outline: none;
  border-color: rgb(59, 130, 246);
  box-shadow: 0 0 0 3px rgb(59 130 246 / 0.1), 0 1px 3px 0 rgb(0 0 0 / 0.1);
  background-color: rgb(249, 250, 251);
}

.form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid rgb(209, 213, 219);
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px 0 rgb(0 0 0 / 0.06);
  background-color: white;
  resize: vertical;
  font-size: 0.875rem;
  transition: all 0.2s ease-in-out;
  min-height: 6rem;
}

.form-textarea:hover {
  border-color: rgb(156, 163, 175);
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.12), 0 1px 2px 0 rgb(0 0 0 / 0.08);
}

.form-textarea:focus {
  outline: none;
  border-color: rgb(59, 130, 246);
  box-shadow: 0 0 0 3px rgb(59 130 246 / 0.1), 0 1px 3px 0 rgb(0 0 0 / 0.1);
  background-color: rgb(249, 250, 251);
}

.form-textarea::placeholder {
  color: rgb(156, 163, 175);
  font-style: italic;
}

/* Form sections with icons */
.form-section {
  background: linear-gradient(135deg, rgb(248, 250, 252) 0%, rgb(241, 245, 249) 100%);
  border: 1px solid rgb(226, 232, 240);
  border-radius: 0.75rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  position: relative;
}

.form-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, rgb(59, 130, 246), rgb(147, 51, 234));
  border-radius: 0.75rem 0.75rem 0 0;
}

.form-section-title {
  font-size: 1rem;
  font-weight: 600;
  color: rgb(31, 41, 55);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.form-section-icon {
  width: 1.25rem;
  height: 1.25rem;
  color: rgb(59, 130, 246);
}

/* Enhanced checkbox styling */
.form-checkbox {
  width: 1.125rem;
  height: 1.125rem;
  border: 2px solid rgb(209, 213, 219);
  border-radius: 0.25rem;
  background-color: white;
  transition: all 0.2s ease-in-out;
  cursor: pointer;
}

.form-checkbox:checked {
  background-color: rgb(59, 130, 246);
  border-color: rgb(59, 130, 246);
}

.form-checkbox:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgb(59 130 246 / 0.1);
}

/* Alerts and notifications */
.alert {
  @apply p-4 rounded-md;
}

.alert-success {
  @apply alert bg-green-50 border border-green-200 text-green-800;
}

.alert-error {
  @apply alert bg-red-50 border border-red-200 text-red-800;
}

.alert-warning {
  @apply alert bg-yellow-50 border border-yellow-200 text-yellow-800;
}

.alert-info {
  @apply alert bg-blue-50 border border-blue-200 text-blue-800;
}

/* Badge components */
.badge {
  @apply inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium;
}

.badge-sm {
  @apply inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium;
}

/* Enhanced Modal Overlays */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(17, 24, 39, 0.75) 0%, rgba(75, 85, 99, 0.6) 100%);
  backdrop-filter: blur(4px);
  overflow-y: auto;
  height: 100%;
  width: 100%;
  z-index: 50;
  animation: fadeInBackdrop 0.3s ease-out;
}

@keyframes fadeInBackdrop {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  position: relative;
  top: 2rem;
  margin: 2rem auto 4rem auto;
  padding: 0;
  border: none;
  width: 95%;
  max-width: 60rem;
  max-height: 85vh;
  box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25), 0 0 0 1px rgb(255 255 255 / 0.1);
  border-radius: 1rem;
  background: linear-gradient(135deg, rgb(255, 255, 255) 0%, rgb(249, 250, 251) 100%);
  overflow-y: auto;
  animation: slideInModal 0.4s ease-out;
  display: flex;
  flex-direction: column;
}

@keyframes slideInModal {
  from { 
    opacity: 0; 
    transform: translateY(-20px) scale(0.95);
  }
  to { 
    opacity: 1; 
    transform: translateY(0) scale(1);
  }
}

/* Enhanced Modal Header */
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  background: linear-gradient(135deg, rgb(59, 130, 246) 0%, rgb(147, 51, 234) 100%);
  color: white;
  position: relative;
  overflow: hidden;
}

.modal-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Ccircle cx='30' cy='30' r='4'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") repeat;
  pointer-events: none;
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  position: relative;
  z-index: 1;
}

.modal-title i {
  font-size: 1.25rem;
  opacity: 0.9;
}

.modal-header button {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease-in-out;
  position: relative;
  z-index: 1;
}

.modal-header button:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}

/* Enhanced Modal Body */
.modal-body {
  padding: 2rem;
  position: relative;
  flex: 1;
  overflow-y: auto;
  max-height: calc(85vh - 200px);
}

.modal-body > * + * {
  margin-top: 1.5rem;
}

/* Modal form specific styling */
.modal-form-container {
  max-height: calc(85vh - 160px);
  overflow-y: auto;
  padding: 2rem;
}

.modal-form-buttons {
  position: sticky;
  bottom: 0;
  background: white;
  padding: 1.5rem 2rem;
  border-top: 1px solid #e5e7eb;
  margin-top: auto;
}

/* Enhanced Modal Footer */
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  padding: 1.5rem 2rem;
  background: linear-gradient(135deg, rgb(248, 250, 252) 0%, rgb(241, 245, 249) 100%);
  border-top: 1px solid rgb(226, 232, 240);
}

/* Charts and visualizations */
.chart-container {
  @apply relative h-64 w-full;
}

.chart-legend {
  @apply flex flex-wrap justify-center mt-4 space-x-4;
}

.chart-legend-item {
  @apply flex items-center text-sm;
}

.chart-legend-color {
  @apply w-3 h-3 rounded-full mr-2;
}

/* Risk matrix styles */
.risk-matrix {
  @apply grid grid-cols-6 gap-1 p-4 bg-white rounded-lg shadow;
}

.risk-matrix-cell {
  @apply aspect-square flex items-center justify-center text-xs font-medium rounded;
  min-height: 40px;
}

.risk-matrix-header {
  @apply bg-gray-100 text-gray-700 font-semibold;
}

.risk-matrix-label {
  @apply bg-gray-50 text-gray-600;
}

/* Responsive design adjustments */
@media (max-width: 768px) {
  .dashboard-card {
    @apply p-4;
  }
  
  .metric-value {
    @apply text-2xl;
  }
  
  .nav-item {
    @apply px-2 py-1 text-xs;
  }
  
  .table-cell {
    @apply px-3 py-2 text-xs;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
  }
}

/* Animation utilities */
.fade-in {
  animation: fadeIn 0.3s ease-in-out;
}

.slide-up {
  animation: slideUp 0.3s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

/* Loading states */
.skeleton {
  @apply animate-pulse bg-gray-200 rounded;
}

.skeleton-text {
  @apply skeleton h-4 w-3/4 mb-2;
}

.skeleton-avatar {
  @apply skeleton w-10 h-10 rounded-full;
}

/* Custom scrollbars */
.custom-scrollbar::-webkit-scrollbar {
  width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* Module-specific styles */
.compliance-tab {
  white-space: nowrap;
  padding: 0.5rem 1rem;
  border-bottom: 2px solid transparent;
  font-weight: 500;
  font-size: 0.875rem;
  color: rgb(107, 114, 128);
  cursor: pointer;
  transition: all 0.15s ease;
}

.compliance-tab:hover {
  color: rgb(55, 65, 81);
  border-bottom-color: rgb(209, 213, 219);
}

.compliance-tab.active {
  color: rgb(37, 99, 235);
  border-bottom-color: rgb(37, 99, 235);
}

.compliance-tab-content {
  min-height: 24rem;
}

/* Settings tabs */
.settings-tab {
  white-space: nowrap;
  padding: 0.5rem 1rem;
  border-bottom: 2px solid transparent;
  font-weight: 500;
  font-size: 0.875rem;
  color: rgb(107, 114, 128);
  cursor: pointer;
  transition: all 0.15s ease;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}

.settings-tab:hover {
  color: rgb(55, 65, 81);
  border-bottom-color: rgb(209, 213, 219);
}

.settings-tab.active {
  color: rgb(37, 99, 235);
  border-bottom-color: rgb(37, 99, 235);
}

/* Data table enhancements */ 
.table-hover tbody tr:hover {
  @apply bg-gray-50;
}

.priority-critical {
  @apply bg-red-100 text-red-800;
}

.priority-high {
  @apply bg-orange-100 text-orange-800;
}

.priority-medium {
  @apply bg-yellow-100 text-yellow-800;
}

.priority-low {
  @apply bg-green-100 text-green-800;
}

/* Progress bars */
.progress-bar {
  @apply w-full bg-gray-200 rounded-full h-2;
}

.progress-fill {
  @apply h-2 rounded-full transition-all duration-300;
}

/* Filter section */
.filter-section {
  @apply bg-white rounded-lg shadow p-4 mb-6;
}

/* Statistics cards */
.stat-card {
  @apply bg-white rounded-lg shadow p-4;
}

.stat-icon {
  @apply w-8 h-8 rounded-lg flex items-center justify-center;
}

.stat-value {
  @apply text-lg font-semibold text-gray-900;
}

.stat-label {
  @apply text-sm font-medium text-gray-500;
}