/* CMMC Dashboard Styles */

:root {
  /* Primary Colors - Executive Dark Navy + Vibrant Accents */
  --primary-color: #0f172a;
  --primary-hover: #1e293b;
  --primary-light: #3b82f6;
  --primary-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --accent-purple: #8b5cf6;
  --accent-blue: #3b82f6;
  --accent-cyan: #06b6d4;
  
  /* Semantic Colors - WCAG AA Compliant */
  --success-color: #065f46;
  --success-bg: #d1fae5;
  --warning-color: #92400e;
  --warning-bg: #fed7aa;
  --danger-color: #991b1b;
  --danger-bg: #fecaca;
  --info-color: #075985;
  --info-bg: #e0f2fe;
  
  /* Neutral Scale */
  --bg-color: #f8fafc;
  --bg-secondary: #f1f5f9;
  --card-bg: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-tertiary: #94a3b8;
  --border-color: #e2e8f0;
  --border-hover: #cbd5e1;
  
  /* Shadows - Enhanced depth */
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.08), 0 1px 2px -1px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.08);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.08);
  
  /* Spacing Scale */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  
  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  
  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

/* Animated gradient background */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 20% 50%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
              radial-gradient(circle at 80% 80%, rgba(59, 130, 246, 0.1) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
  animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.1); }
}

/* Typography Improvements */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }

/* Focus Styles for Accessibility */
*:focus-visible {
  outline: 3px solid var(--primary-color);
  outline-offset: 2px;
}

button:focus-visible,
.btn:focus-visible {
  outline: 3px solid var(--primary-color);
  outline-offset: 3px;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(30, 64, 175, 0.15);
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  html {
    scroll-behavior: auto;
  }
}

/* Login Screen */
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #1e3a8a 0%, #312e81 100%);
  padding: var(--space-lg);
  position: relative;
  overflow: hidden;
}

.login-container::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, transparent 70%);
  animation: pulse 15s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.1); opacity: 0.7; }
}

.login-box {
  background: var(--card-bg);
  padding: var(--space-2xl);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 440px;
  position: relative;
  z-index: 1;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.login-box h1 {
  text-align: center;
  margin-bottom: var(--space-sm);
  color: var(--primary-color);
  font-size: 1.875rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.login-box .subtitle {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.login-box .form-group input[type="text"],
.login-box .form-group input[type="password"] {
  color: #1a1a2e;
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.2);
}

.login-box .form-group input[type="text"]:focus,
.login-box .form-group input[type="password"]:focus {
  border-color: var(--primary-color);
  background: rgba(0, 0, 0, 0.03);
}

/* Dashboard Layout */
.dashboard-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: transparent;
  position: relative;
  z-index: 1;
}

.dashboard-header {
  background: rgba(15, 23, 42, 0.95);
  border-bottom: 2px solid rgba(139, 92, 246, 0.2);
  padding: var(--space-lg) var(--space-xl);
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(20px);
}

.dashboard-header h1 {
  font-size: 1.5rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.header-right {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.user-badge {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
  color: #ffffff;
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  border: 1px solid rgba(139, 92, 246, 0.3);
  letter-spacing: 0.01em;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* Navigation */
.dashboard-nav {
  background: rgba(15, 23, 42, 0.95);
  border-bottom: 2px solid rgba(139, 92, 246, 0.2);
  padding: 0 var(--space-xl);
  display: flex;
  gap: var(--space-xs);
  overflow-x: auto;
  position: sticky;
  top: 73px;
  z-index: 90;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(139, 92, 246, 0.5) rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
}

.dashboard-nav::-webkit-scrollbar {
  height: 4px;
}

.dashboard-nav::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

.dashboard-nav::-webkit-scrollbar-thumb {
  background: rgba(139, 92, 246, 0.5);
  border-radius: 2px;
}

.nav-btn {
  background: none;
  border: none;
  padding: var(--space-lg) var(--space-xl);
  cursor: pointer;
  font-size: 0.9375rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
  border-bottom: 3px solid transparent;
  transition: all var(--transition-base);
  white-space: nowrap;
  position: relative;
  letter-spacing: 0.01em;
  min-height: 48px;
  display: flex;
  align-items: center;
}

.nav-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(139, 92, 246, 0.1);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.nav-btn:hover {
  color: #ffffff;
}

.nav-btn:hover::before {
  opacity: 1;
}

.nav-btn.active {
  color: #ffffff;
  border-bottom-color: #8b5cf6;
  font-weight: 700;
  text-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
}

.nav-btn.active::before {
  opacity: 0.3;
}

/* Main Content */
.dashboard-content {
  flex: 1;
  padding: var(--space-xl);
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
  animation: fadeIn var(--transition-slow);
}

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

.view {
  display: none;
}

.view.active {
  display: block;
  animation: fadeIn var(--transition-base);
}

.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-lg);
  border-bottom: 2px solid rgba(139, 92, 246, 0.2);
}

.view-header h2 {
  font-size: 1.875rem;
  color: #ffffff;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-shadow: 0 2px 10px rgba(139, 92, 246, 0.3);
}

.view-header .subtitle {
  display: block;
  margin-top: var(--space-xs);
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9375rem;
  font-weight: 400;
}

.filters-section {
  margin-bottom: var(--space-xl);
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.search-bar {
  margin-bottom: var(--space-lg);
}

.search-bar input[type="text"] {
  width: 100%;
  padding: var(--space-lg) var(--space-xl);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-family: inherit;
  transition: all var(--transition-base);
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  font-weight: 500;
}

.search-bar input[type="text"]::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.search-bar input[type="text"]:hover {
  border-color: rgba(139, 92, 246, 0.5);
  background: rgba(255, 255, 255, 0.08);
}

.search-bar input[type="text"]:focus {
  outline: none;
  border-color: #8b5cf6;
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.2);
  background: rgba(255, 255, 255, 0.1);
}

.filters {
  display: flex;
  gap: var(--space-md);
  align-items: center;
  flex-wrap: wrap;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

@media (max-width: 1200px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .stat-card:first-child {
    grid-column: span 2;
  }
}

@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .stat-card:first-child {
    grid-column: span 1;
  }
}

.stat-card {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  transition: all var(--transition-slow);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(139, 92, 246, 0.1), transparent);
  transform: rotate(45deg);
  transition: all 0.6s ease;
  opacity: 0;
}

.stat-card:hover::before {
  opacity: 1;
  animation: shimmerSweep 1.5s ease infinite;
}

@keyframes shimmerSweep {
  0% { transform: translateX(-100%) rotate(45deg); }
  100% { transform: translateX(100%) rotate(45deg); }
}

.stat-card:hover {
  transform: translateY(-8px) scale(1.03);
  box-shadow: 0 20px 60px 0 rgba(139, 92, 246, 0.5), 0 0 30px rgba(139, 92, 246, 0.3);
  border-color: rgba(139, 92, 246, 0.7);
}

.stat-label {
  font-size: 0.9375rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: var(--space-md);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-value {
  font-size: 3rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: var(--space-sm);
  line-height: 1;
  letter-spacing: -0.04em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3), 0 0 30px rgba(255, 255, 255, 0.3);
  position: relative;
  display: inline-block;
}

.stat-value::after {
  content: '✨';
  position: absolute;
  top: -10px;
  right: -20px;
  font-size: 1.5rem;
  animation: sparkle 3s ease-in-out infinite;
  opacity: 0;
}

@keyframes sparkle {
  0%, 100% { opacity: 0; transform: scale(0) rotate(0deg); }
  50% { opacity: 1; transform: scale(1) rotate(180deg); }
}

.stat-value.critical {
  color: #ef4444;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.05); }
}

.stat-detail {
  color: rgba(255, 255, 255, 0.6);
}

/* Compliance Progress Bar */
.compliance-progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  overflow: hidden;
  margin: var(--space-lg) 0 var(--space-md) 0;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.compliance-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #43e97b 0%, #38f9d7 100%);
  border-radius: 10px;
  transition: width 1.5s ease-out;
  width: 0%;
  box-shadow: 0 2px 10px rgba(67, 233, 123, 0.5);
  animation: progressGlow 2s ease-in-out infinite;
}

@keyframes progressGlow {
  0%, 100% { box-shadow: 0 2px 10px rgba(67, 233, 123, 0.5); }
  50% { box-shadow: 0 2px 20px rgba(67, 233, 123, 0.8); }
}

/* Make first stat card (overall compliance) more prominent */
.stat-card:first-child {
  grid-column: span 2;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 20px 60px 0 rgba(102, 126, 234, 0.6);
  position: relative;
}

.stat-card:first-child::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
  border-radius: 50%;
  transform: translate(30%, -30%);
  pointer-events: none;
}

.stat-card:first-child .stat-label {
  font-size: 1.125rem;
  color: rgba(255, 255, 255, 0.9);
}

.stat-card:first-child .stat-value {
  font-size: 5rem;
  color: #ffffff;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  position: relative;
  z-index: 2;
}

.stat-card:first-child .stat-detail {
  font-size: 1.125rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
}

.stat-detail {
  font-size: 0.875rem;
  color: var(--text-tertiary);
  font-weight: 500;
}

/* Section Title */
.section-title {
  font-size: 1.5rem;
  color: #ffffff;
  font-weight: 700;
  margin-bottom: var(--space-xl);
  letter-spacing: -0.02em;
  text-align: center;
}

/* Domain Progress Section */
.domain-progress-section {
  margin-bottom: var(--space-2xl);
  padding: var(--space-xl);
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-xl);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.progress-rings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--space-xl);
  padding: var(--space-lg);
}

.progress-ring-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-lg);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
  cursor: pointer;
}

.progress-ring-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(139, 92, 246, 0.3);
  border-color: rgba(139, 92, 246, 0.5);
  background: rgba(139, 92, 246, 0.1);
}

.progress-ring-label {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.8);
  text-align: center;
  font-weight: 600;
}

.progress-ring {
  filter: drop-shadow(0 4px 10px rgba(102, 126, 234, 0.5));
  animation: fadeInScale 0.6s ease-out backwards;
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Charts */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.chart-card {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  margin-bottom: var(--space-lg);
  transition: all var(--transition-slow);
  position: relative;
  overflow: hidden;
}

.chart-card:hover {
  box-shadow: 0 20px 60px 0 rgba(139, 92, 246, 0.3);
  border-color: rgba(139, 92, 246, 0.3);
  transform: translateY(-4px);
}

.chart-card h3 {
  font-size: 1.25rem;
  margin-bottom: var(--space-lg);
  color: #ffffff;
  font-weight: 700;
  letter-spacing: -0.02em;
  padding-bottom: var(--space-md);
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.chart-card h3::before {
  content: '📊';
  font-size: 1.5rem;
}

.chart-card canvas {
  max-height: 300px !important;
  width: 100% !important;
}

/* Activity Card */
.activity-card {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  transition: all var(--transition-base);
}

.activity-card:hover {
  box-shadow: 0 20px 60px 0 rgba(139, 92, 246, 0.3);
  border-color: rgba(139, 92, 246, 0.3);
  transform: translateY(-4px);
}

.activity-card h3 {
  font-size: 1.25rem;
  margin-bottom: var(--space-lg);
  color: #ffffff;
  font-weight: 700;
  letter-spacing: -0.02em;
  padding-bottom: var(--space-md);
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.activity-card h3::before {
  content: '📈';
  font-size: 1.5rem;
}

.activity-item {
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
  transition: all var(--transition-fast);
  min-height: 56px;
}

.activity-item.clickable-activity {
  cursor: pointer;
}

.activity-item:hover {
  background: rgba(139, 92, 246, 0.1);
  border-left: 3px solid #8b5cf6;
  padding-left: calc(var(--space-lg) - 3px);
  transform: translateX(4px);
}

.activity-item.clickable-activity:hover {
  background: rgba(139, 92, 246, 0.15);
  border-left: 4px solid #8b5cf6;
  padding-left: calc(var(--space-lg) - 4px);
  transform: translateX(6px) scale(1.01);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-info {
  flex: 1;
  display: flex;
  gap: var(--space-md);
  align-items: center;
}

.activity-action {
  font-weight: 600;
  color: #ffffff;
  font-size: 0.875rem;
  min-width: 200px;
}

.activity-details {
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.4;
}

.activity-time {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  white-space: nowrap;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  min-width: 80px;
  text-align: right;
}

/* Controls List */
.control-item {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-lg);
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.control-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
  transform: scaleY(0);
  transition: transform var(--transition-base);
}

.control-item.expandable:hover {
  border-color: rgba(139, 92, 246, 0.5);
  transform: translateX(4px);
  background: rgba(139, 92, 246, 0.05);
}

.control-item.expandable:hover::before {
  transform: scaleY(1);
}

.control-item.expanded {
  background: rgba(139, 92, 246, 0.1);
  border-color: rgba(139, 92, 246, 0.7);
  box-shadow: 0 10px 40px rgba(139, 92, 246, 0.4);
}

.control-item.expanded::before {
  transform: scaleY(1);
}

.control-summary {
  padding: var(--space-xl);
  transition: padding var(--transition-base);
}

.control-item.expanded .control-summary {
  padding-bottom: var(--space-md);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.control-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
  gap: var(--space-md);
}

.control-header-right {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.expand-icon {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
  transition: transform var(--transition-base);
}

.control-item.expanded .expand-icon {
  transform: rotate(180deg);
}

.control-id {
  font-weight: 700;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 1.0625rem;
  letter-spacing: -0.01em;
}

.control-domain {
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(139, 92, 246, 0.2);
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-md);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.control-description {
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: var(--space-md);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.control-footer {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  font-size: 0.875rem;
  flex-wrap: wrap;
  color: rgba(255, 255, 255, 0.5);
}

.no-evidence {
  color: #fbbf24 !important;
  font-weight: 600;
}

/* Expandable Control Details */
.control-details-expanded {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.control-item.expanded .control-details-expanded {
  max-height: 1000px;
}

.control-details-content {
  padding: var(--space-xl);
  padding-top: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
  animation: fadeIn 0.3s ease-out;
}

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

.detail-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.detail-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.detail-value {
  font-size: 0.9375rem;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.6;
  padding: var(--space-md);
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-md);
  border-left: 3px solid rgba(139, 92, 246, 0.6);
}

.detail-value.empty-value {
  color: rgba(255, 255, 255, 0.5);
  font-style: italic;
  border-left-color: rgba(255, 255, 255, 0.2);
}

.detail-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--space-md);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  gap: var(--space-lg);
  flex-wrap: wrap;
}

.detail-meta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.7);
}

.detail-meta span {
  display: block;
}

.edit-control-btn {
  flex-shrink: 0;
}

/* Status Badge */
.status-badge {
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  border: 1px solid;
}

.status-compliant {
  background: var(--success-bg);
  color: var(--success-color);
  border-color: var(--success-color);
}

.status-compliant::before {
  content: '✓';
  font-weight: 900;
}

.status-partial {
  background: var(--warning-bg);
  color: var(--warning-color);
  border-color: var(--warning-color);
}

.status-partial::before {
  content: '◐';
}

.status-non-compliant {
  background: var(--danger-bg);
  color: var(--danger-color);
  border-color: var(--danger-color);
}

.status-non-compliant::before {
  content: '✕';
  font-weight: 900;
}

.status-not-assessed {
  background: #e5e7eb;
  color: #374151;
  border-color: #9ca3af;
}

.status-not-assessed::before {
  content: '○';
}

/* Priority Badge */
.priority-badge {
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  border: 1px solid;
}

.priority-critical {
  background: var(--danger-bg);
  color: var(--danger-color);
  border-color: var(--danger-color);
}

.priority-critical::before {
  content: '🔴';
}

.priority-high {
  background: var(--warning-bg);
  color: var(--warning-color);
  border-color: var(--warning-color);
}

.priority-high::before {
  content: '🟠';
}

.priority-medium {
  background: #fef3c7;
  color: #b45309;
  border-color: #d97706;
}

.priority-medium::before {
  content: '🟡';
}

.priority-low {
  background: var(--info-bg);
  color: var(--info-color);
  border-color: var(--info-color);
}

.priority-low::before {
  content: '🔵';
}

/* Task Item */
.task-item {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  margin-bottom: var(--space-lg);
  cursor: pointer;
  transition: all var(--transition-slow);
  position: relative;
  overflow: hidden;
}

.task-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
  transform: scaleY(0);
  transition: transform var(--transition-base);
}

.task-item:hover {
  box-shadow: 0 10px 40px rgba(139, 92, 246, 0.4);
  border-color: rgba(139, 92, 246, 0.5);
  transform: translateX(8px) translateY(-2px);
  background: rgba(139, 92, 246, 0.05);
}

.task-item:hover::before {
  transform: scaleY(1);
}

.task-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-md);
  gap: var(--space-md);
}

.task-title {
  font-weight: 700;
  color: #ffffff;
  flex: 1;
  font-size: 1.0625rem;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

.task-meta {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.task-description {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9375rem;
  margin-bottom: var(--space-md);
  line-height: 1.6;
}

.task-footer {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.5);
  flex-wrap: wrap;
}

/* Document Item */
.doc-item {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  margin-bottom: var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
  transition: all var(--transition-slow);
  position: relative;
  overflow: hidden;
}

.doc-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
  transform: scaleY(0);
  transition: transform var(--transition-base);
}

.doc-item:hover {
  box-shadow: 0 10px 40px rgba(139, 92, 246, 0.4);
  border-color: rgba(139, 92, 246, 0.5);
  transform: translateX(8px) translateY(-2px);
  background: rgba(139, 92, 246, 0.05);
}

.doc-item:hover::before {
  transform: scaleY(1);
}

.doc-info {
  flex: 1;
}

.doc-name {
  font-weight: 700;
  color: #ffffff;
  margin-bottom: var(--space-xs);
  font-size: 1.0625rem;
  letter-spacing: -0.01em;
}

.doc-meta {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.5;
}

.doc-actions {
  display: flex;
  gap: var(--space-sm);
  flex-shrink: 0;
}

/* Forms */
.form-group {
  margin-bottom: var(--space-xl);
}

.form-group label {
  display: block;
  margin-bottom: var(--space-sm);
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.9375rem;
  letter-spacing: -0.01em;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group input[type="date"],
.form-group input[type="file"],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: var(--space-md) var(--space-lg);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  font-family: inherit;
  transition: all var(--transition-base);
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
  border-color: rgba(139, 92, 246, 0.5);
  background: rgba(255, 255, 255, 0.08);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #8b5cf6;
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.2);
  background: rgba(255, 255, 255, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-tertiary);
}

.form-group small {
  display: block;
  margin-top: var(--space-sm);
  color: var(--text-secondary);
  font-size: 0.8125rem;
  line-height: 1.5;
}

/* Buttons */
.btn {
  padding: var(--space-md) var(--space-xl);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-base);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  text-decoration: none;
  text-align: center;
  letter-spacing: 0.01em;
  position: relative;
  overflow: hidden;
  min-height: 44px; /* Better touch target */
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width var(--transition-slow), height var(--transition-slow);
}

.btn:active::before {
  width: 300px;
  height: 300px;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
  border: none;
  font-weight: 700;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
  transform: translateY(-2px);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(139, 92, 246, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.btn-danger {
  background: var(--danger-color);
  color: white;
  box-shadow: var(--shadow-sm);
}

.btn-danger:hover {
  background: #991b1b;
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn:disabled:hover {
  transform: none;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  overflow: auto;
  animation: fadeIn var(--transition-base);
}

.modal.show {
  display: block;
}

.modal-content {
  background-color: var(--card-bg);
  margin: 5% auto;
  padding: var(--space-2xl);
  border-radius: var(--radius-xl);
  width: 90%;
  max-width: 640px;
  box-shadow: var(--shadow-xl);
  position: relative;
  border: 2px solid var(--border-color);
  animation: slideUp var(--transition-base);
}

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

.modal-content h2 {
  margin-bottom: var(--space-xl);
  color: var(--text-primary);
  font-weight: 800;
  font-size: 1.75rem;
  letter-spacing: -0.03em;
  padding-bottom: var(--space-lg);
  border-bottom: 2px solid var(--border-color);
}

.close {
  position: absolute;
  right: var(--space-xl);
  top: var(--space-xl);
  font-size: 1.75rem;
  font-weight: bold;
  color: var(--text-secondary);
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.close:hover {
  color: var(--text-primary);
  background: var(--bg-color);
}

.modal-actions {
  display: flex;
  gap: var(--space-md);
  justify-content: flex-end;
  margin-top: var(--space-2xl);
  padding-top: var(--space-xl);
  border-top: 2px solid var(--border-color);
}

/* Error Message */
.error-message {
  color: var(--danger-color);
  font-size: 0.9375rem;
  margin-top: var(--space-lg);
  padding: var(--space-lg);
  background: var(--danger-bg);
  border: 2px solid var(--danger-color);
  border-radius: var(--radius-md);
  display: none;
  font-weight: 600;
  animation: slideDown var(--transition-base);
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.error-message.show {
  display: block;
}

/* Loading State */
.loading {
  text-align: center;
  padding: var(--space-2xl) var(--space-xl);
  color: var(--text-secondary);
  font-size: 0.9375rem;
  font-weight: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
}

.loading::before {
  content: '';
  display: block;
  width: 40px;
  height: 40px;
  border: 4px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-right-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Skeleton Loading for Cards */
.skeleton {
  background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--border-color) 50%, var(--bg-secondary) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: var(--space-2xl) var(--space-xl);
  color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-xl);
  border: 2px dashed rgba(139, 92, 246, 0.3);
  margin: var(--space-xl) 0;
  position: relative;
  overflow: hidden;
}

.empty-state::before {
  content: '📭';
  font-size: 4rem;
  display: block;
  margin-bottom: var(--space-lg);
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

.empty-state h3 {
  margin-bottom: var(--space-md);
  color: #ffffff;
  font-weight: 700;
  font-size: 1.25rem;
}

.empty-state p {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9375rem;
  line-height: 1.6;
}

/* Result Count */
.result-count {
  padding: var(--space-md) var(--space-lg);
  margin-bottom: var(--space-lg);
  background: rgba(139, 92, 246, 0.15);
  border-left: 4px solid #8b5cf6;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: 0.01em;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.2);
}

/* Responsive Design */
@media (max-width: 1024px) {
  .charts-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  /* Typography adjustments */
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.125rem; }
  
  /* Layout spacing */
  .dashboard-content {
    padding: var(--space-md);
  }
  
  .dashboard-header {
    padding: var(--space-md);
    position: relative;
  }
  
  .dashboard-header h1 {
    font-size: 1.25rem;
  }
  
  .header-right {
    gap: var(--space-md);
  }
  
  /* Navigation improvements */
  .dashboard-nav {
    padding: 0 var(--space-md);
    gap: 0;
    top: 62px; /* Adjusted for smaller mobile header */
  }
  
  .nav-btn {
    padding: var(--space-md) var(--space-md);
    font-size: 0.8125rem;
    min-height: 48px;
  }
  
  /* Ensure touch targets are adequate */
  .btn {
    min-height: 48px;
    padding: var(--space-md) var(--space-lg);
  }
  
  /* Search bar on mobile */
  .search-bar input[type="text"] {
    font-size: 16px; /* Prevents zoom on iOS */
  }

  /* View header */
  .view-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-lg);
  }
  
  .view-header h2 {
    font-size: 1.5rem;
  }

  /* Filters */
  .filters {
    width: 100%;
    flex-direction: column;
    gap: var(--space-md);
  }

  .filters select,
  .filters button {
    width: 100%;
    min-height: 48px; /* Better touch target */
  }

  /* Stats grid */
  .stats-grid {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }

  /* Charts */
  .charts-grid {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }

  /* Card layouts */
  .control-header,
  .task-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-md);
  }
  
  .doc-item {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-md);
  }
  
  .doc-actions {
    width: 100%;
    justify-content: stretch;
  }
  
  .doc-actions .btn {
    flex: 1;
  }
  
  /* Control footer */
  .control-footer,
  .task-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
  }
  
  /* Modal adjustments */
  .modal-content {
    margin: var(--space-lg);
    padding: var(--space-xl);
    max-width: calc(100% - var(--space-2xl));
  }
  
  .modal-content h2 {
    font-size: 1.5rem;
  }
  
  /* Login box */
  .login-box {
    padding: var(--space-xl);
  }
  
  .login-box h1 {
    font-size: 1.5rem;
  }
  
  /* Compliance docs grid */
  .compliance-docs-grid {
    grid-template-columns: 1fr;
  }
  
  /* Activity items */
  .activity-item {
    flex-direction: column;
    gap: var(--space-md);
  }
  
  .activity-time {
    align-self: flex-start;
  }
}

@media (max-width: 480px) {
  /* Extra small screens */
  .stat-value {
    font-size: 2rem;
  }
  
  .dashboard-header h1 {
    font-size: 1.125rem;
  }
  
  .user-badge {
    font-size: 0.8125rem;
    padding: var(--space-xs) var(--space-md);
  }
  
  .nav-btn {
    padding: var(--space-md);
    font-size: 0.8125rem;
  }
}

/* Compliance Documents Grid */
.compliance-docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: var(--space-lg);
  margin-top: var(--space-xl);
}

.compliance-doc-card {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  cursor: pointer;
  transition: all var(--transition-slow);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
  position: relative;
  overflow: hidden;
}

.compliance-doc-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  transform: scaleX(0);
  transition: transform var(--transition-base);
}

.compliance-doc-card:hover {
  box-shadow: 0 20px 60px rgba(139, 92, 246, 0.4);
  transform: translateY(-8px) scale(1.02);
  border-color: rgba(139, 92, 246, 0.6);
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.25) 0%, rgba(118, 75, 162, 0.25) 100%);
}

.compliance-doc-card:hover::before {
  transform: scaleX(1);
}

.compliance-doc-icon {
  font-size: 3.5rem;
  margin-bottom: var(--space-lg);
  display: block;
  line-height: 1;
}

.compliance-doc-title {
  font-size: 1.375rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: var(--space-md);
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.compliance-doc-type {
  display: inline-block;
  padding: var(--space-xs) var(--space-md);
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 700;
  margin-bottom: var(--space-md);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

.compliance-doc-description {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9375rem;
  line-height: 1.6;
}

/* Document Viewer Modal */
.modal-large .modal-content {
  max-width: 1200px;
  max-height: 90vh;
  overflow-y: auto;
}

.document-viewer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-lg);
  border-bottom: 2px solid var(--border-color);
}

.document-viewer-header h2 {
  font-size: 1.75rem;
  color: var(--text-primary);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.document-actions {
  display: flex;
  gap: var(--space-md);
}

.document-content {
  padding: var(--space-xl);
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-height: calc(90vh - 220px);
  overflow-y: auto;
  line-height: 1.7;
}

/* Formatted document content styles */
.document-content h1 {
  font-size: 2rem;
  color: var(--text-primary);
  margin-top: 2rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary-color);
}

.document-content h1:first-child {
  margin-top: 0;
}

.document-content h2 {
  font-size: 1.5rem;
  color: var(--text-primary);
  margin-top: 2rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.document-content h3 {
  font-size: 1.25rem;
  color: var(--text-primary);
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.document-content h4 {
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

.document-content p {
  margin-bottom: 1rem;
  line-height: 1.7;
  color: var(--text-primary);
}

.document-content strong {
  color: var(--text-primary);
  font-weight: 600;
}

.document-content em {
  font-style: italic;
  color: var(--text-secondary);
}

.document-content ul, .document-content ol {
  margin-left: 2rem;
  margin-bottom: 1rem;
}

.document-content li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.document-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  background: white;
  box-shadow: var(--shadow-sm);
}

.document-content th,
.document-content td {
  padding: 0.75rem;
  text-align: left;
  border: 1px solid var(--border-color);
}

.document-content th {
  background: var(--primary-color);
  color: white;
  font-weight: 600;
}

.document-content tr:nth-child(even) {
  background: #f9fafb;
}

.document-content code {
  background: #1e293b;
  color: #e2e8f0;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 0.875rem;
}

.document-content pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 1rem;
  border-radius: 8px;
  overflow-x: auto;
  margin: 1rem 0;
}

.document-content pre code {
  background: none;
  padding: 0;
}

.document-content blockquote {
  border-left: 4px solid var(--primary-color);
  padding-left: 1rem;
  margin: 1rem 0;
  color: var(--text-secondary);
  font-style: italic;
}

.document-content hr {
  border: none;
  border-top: 2px solid var(--border-color);
  margin: 2rem 0;
}

/* Print styles */
@media print {
  .modal-content {
    max-width: none;
    box-shadow: none;
    padding: 0;
  }
  
  .document-viewer-header,
  .close,
  .document-actions {
    display: none;
  }
  
  .document-content {
    background: white;
    border: none;
    max-height: none;
  }
  
  .dashboard-header,
  .dashboard-nav {
    display: none !important;
  }
  
  .dashboard-content {
    padding: 0;
  }
}

/* Professional Polish: Subtle Microinteractions */
.control-item,
.task-item,
.doc-item {
  will-change: transform;
}

/* Hover lift effect for interactive cards */
.stat-card:hover {
  transform: translateY(-3px);
}

/* Focus ring improvements */
.control-item:focus-within,
.task-item:focus-within,
.doc-item:focus-within {
  outline: 3px solid var(--primary-color);
  outline-offset: 2px;
}

/* Smooth scroll for anchor links */
html {
  scroll-padding-top: 150px;
}

/* Better selection colors */
::selection {
  background-color: var(--primary-color);
  color: white;
}

::-moz-selection {
  background-color: var(--primary-color);
  color: white;
}

/* Improve form focus indicators */
input:user-invalid,
select:user-invalid,
textarea:user-invalid {
  border-color: var(--danger-color);
  box-shadow: 0 0 0 4px rgba(153, 27, 27, 0.1);
}

/* Disabled state improvements */
button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  filter: grayscale(50%);
}

/* PWA Offline Indicator */
body.offline::before {
  content: '🔴 Offline Mode - Some features may be unavailable';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
  color: white;
  text-align: center;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  z-index: 10000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

body.offline .dashboard-content {
  margin-top: 3rem;
}

/* PWA Install prompt styles (optional) */
.pwa-install-prompt {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--card-bg);
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  border: 2px solid var(--primary-color);
  z-index: 9999;
  max-width: 400px;
  display: none;
}

.pwa-install-prompt.show {
  display: block;
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    transform: translateX(-50%) translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }
}

/* Compliance Documents Grid */
.compliance-docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-xl);
  margin-top: var(--space-xl);
}

.compliance-doc-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: all var(--transition-base);
  border: 2px solid var(--border-color);
  text-align: center;
}

.compliance-doc-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: var(--primary-color);
}

.compliance-doc-icon {
  font-size: 4rem;
  margin-bottom: var(--space-lg);
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.compliance-doc-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
  letter-spacing: -0.02em;
}

.compliance-doc-type {
  display: inline-block;
  background: var(--primary-bg);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-md);
}

.compliance-doc-description {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.5;
}

/* Charts Grid */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: var(--space-xl);
  margin-bottom: var(--space-xl);
}

.chart-card {
  background: var(--card-bg);
  padding: var(--space-xl);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
}

.chart-card h3 {
  margin-bottom: var(--space-lg);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.chart-card canvas {
  max-height: 300px;
}

/* Domain Drill-Down Panel */
.drill-down-panel {
  position: fixed;
  top: 0;
  right: -100%;
  width: min(90vw, 800px);
  height: 100vh;
  background: var(--card-bg);
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
  z-index: 1100;
  transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.drill-down-panel.show {
  right: 0;
}

.drill-down-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: var(--space-xl);
  border-bottom: 3px solid rgba(255, 255, 255, 0.2);
}

.btn-back {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: var(--space-lg);
}

.btn-back:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateX(-4px);
}

.back-arrow {
  font-size: 1.25rem;
  transition: transform var(--transition-base);
}

.btn-back:hover .back-arrow {
  transform: translateX(-2px);
}

.drill-down-title h2 {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: var(--space-md);
  letter-spacing: -0.02em;
}

.drill-down-stats {
  display: flex;
  gap: var(--space-lg);
  flex-wrap: wrap;
}

.drill-stat {
  background: rgba(255, 255, 255, 0.2);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  backdrop-filter: blur(10px);
}

.drill-down-content {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-xl);
  background: var(--bg-color);
}

.drill-control-item {
  background: white;
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
  box-shadow: var(--shadow-sm);
  border: 2px solid var(--border-color);
  transition: all var(--transition-base);
  cursor: pointer;
}

.drill-control-item:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary-color);
  transform: translateY(-2px);
}

.drill-control-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-md);
}

.drill-control-id {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary-color);
  background: rgba(59, 130, 246, 0.1);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-sm);
}

.drill-control-level {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  background: var(--bg-secondary);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.drill-control-description {
  color: var(--text-primary);
  line-height: 1.6;
  margin-bottom: var(--space-md);
  font-size: 0.9375rem;
}

.drill-control-details {
  display: grid;
  gap: var(--space-md);
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-color);
}

.drill-detail-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.drill-detail-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
}

.drill-detail-value {
  font-size: 0.875rem;
  color: var(--text-primary);
  line-height: 1.5;
  padding: 0.75rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--primary-color);
}

.drill-detail-empty {
  font-style: italic;
  color: rgba(255, 255, 255, 0.5);
}

.drill-detail-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-color);
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.drill-edit-btn {
  flex-shrink: 0;
}

.drill-control-nist {
  display: inline-block;
  font-size: 0.75rem;
  background: rgba(139, 92, 246, 0.1);
  color: var(--accent-purple);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  margin-top: 0.5rem;
}

/* Drill-down panel overlay */
.drill-down-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1099;
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.drill-down-overlay.show {
  display: block;
  opacity: 1;
}

/* Scrollbar styling for drill-down */
.drill-down-content::-webkit-scrollbar {
  width: 8px;
}

.drill-down-content::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

.drill-down-content::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

.drill-down-content::-webkit-scrollbar-thumb:hover {
  background: var(--text-tertiary);
}
