/* ============================================
   AUDIT ASSISTANT - Modern Security Dashboard
   Professional UX/UI Design
   ============================================ */

/* Google Fonts - Inter for clean UI */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* CSS Variables - Custom Color Palette */
:root {
  /* Primary - Deep Indigo/Purple */
  --primary-50: #eef2ff;
  --primary-100: #e0e7ff;
  --primary-200: #c7d2fe;
  --primary-300: #a5b4fc;
  --primary-400: #818cf8;
  --primary-500: #6366f1;
  --primary-600: #4f46e5;
  --primary-700: #4338ca;
  --primary-800: #3730a3;
  --primary-900: #312e81;

  /* Accent - Teal/Cyan */
  --accent-400: #2dd4bf;
  --accent-500: #14b8a6;
  --accent-600: #0d9488;

  /* Neutral - Slate */
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;

  /* Semantic Colors */
  --success-light: #d1fae5;
  --success: #10b981;
  --success-dark: #059669;
  --warning-light: #fef3c7;
  --warning: #f59e0b;
  --warning-dark: #d97706;
  --danger-light: #fee2e2;
  --danger: #ef4444;
  --danger-dark: #dc2626;
  --info-light: #dbeafe;
  --info: #3b82f6;

  /* Layout */
  --header-height: 64px;
  --sidebar-width: 260px;
  --border-radius: 12px;
  --border-radius-lg: 16px;
  --border-radius-xl: 24px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.3);

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   BASE STYLES
   ============================================ */

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--slate-800);
  background: linear-gradient(135deg, var(--slate-50) 0%, var(--primary-50) 100%);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  color: var(--slate-900);
  margin: 0 0 0.75rem 0;
  letter-spacing: -0.025em;
}

h1 { font-size: 2rem; font-weight: 700; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

p { margin-bottom: 1rem; }

a {
  color: var(--primary-600);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-700);
  text-decoration: none;
}

code, .mono {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

/* ============================================
   LAYOUT
   ============================================ */

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

/* ============================================
   HEADER
   ============================================ */

.header {
  position: sticky;
  top: 0;
  height: var(--header-height);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--slate-200);
  z-index: 1000;
  transition: box-shadow var(--transition-normal);
}

.header:hover {
  box-shadow: var(--shadow-md);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 24px;
}

.header .brand {
  font-size: 1.25rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary-600), var(--accent-500));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: flex;
  align-items: center;
  gap: 10px;
}

.header .brand::before {
  content: '';
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--primary-500), var(--accent-500));
  border-radius: 8px;
  display: inline-block;
}

.header nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header nav a {
  padding: 8px 16px;
  border-radius: var(--border-radius);
  color: var(--slate-600);
  font-weight: 500;
  font-size: 14px;
  transition: all var(--transition-fast);
  position: relative;
}

.header nav a:hover {
  color: var(--primary-600);
  background: var(--primary-50);
}

.header nav a.active {
  color: var(--primary-700);
  background: var(--primary-100);
}

/* User menu in header */
.header .user-menu {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 12px;
  border-radius: var(--border-radius);
  background: var(--slate-100);
  transition: all var(--transition-fast);
}

.header .user-menu:hover {
  background: var(--slate-200);
}

.header .user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-400), var(--accent-400));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 14px;
}

/* ============================================
   CARDS
   ============================================ */

.card {
  background: white;
  border: 1px solid var(--slate-200);
  border-radius: var(--border-radius-lg);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
  transition: all var(--transition-normal);
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--slate-100);
}

.card-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--slate-800);
  margin: 0;
}

.card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.card-icon.primary { background: var(--primary-100); color: var(--primary-600); }
.card-icon.success { background: var(--success-light); color: var(--success); }
.card-icon.warning { background: var(--warning-light); color: var(--warning); }
.card-icon.danger { background: var(--danger-light); color: var(--danger); }

/* ============================================
   BUTTONS
   ============================================ */

button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--slate-700);
  background: white;
  border: 1px solid var(--slate-300);
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
}

button:hover, .btn:hover {
  background: var(--slate-50);
  border-color: var(--slate-400);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

button:active, .btn:active {
  transform: translateY(0);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Primary Button */
button.primary, .btn.primary {
  background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
  border: none;
  color: white;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
}

button.primary:hover, .btn.primary:hover {
  background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.45);
}

/* Success Button */
button.success, .btn.success {
  background: linear-gradient(135deg, var(--success), var(--success-dark));
  border: none;
  color: white;
}

/* Danger Button */
button.danger, .btn.danger {
  color: var(--danger);
  border-color: var(--danger);
  background: white;
}

button.danger:hover, .btn.danger:hover {
  background: var(--danger-light);
  border-color: var(--danger-dark);
}

/* Small Button */
button.small, .btn.small {
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 8px;
}

/* Icon only button */
button.icon-only {
  padding: 10px;
  width: 40px;
  height: 40px;
}

/* ============================================
   FORMS
   ============================================ */

input, select, textarea {
  font-family: inherit;
  font-size: 14px;
  padding: 12px 16px;
  border: 1px solid var(--slate-300);
  border-radius: var(--border-radius);
  background: white;
  color: var(--slate-800);
  transition: all var(--transition-fast);
  width: 100%;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary-400);
  box-shadow: 0 0 0 3px var(--primary-100);
}

input::placeholder {
  color: var(--slate-400);
}

label {
  display: block;
  font-weight: 500;
  color: var(--slate-700);
  margin-bottom: 6px;
  font-size: 14px;
}

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

.form-hint {
  font-size: 13px;
  color: var(--slate-500);
  margin-top: 6px;
}

.form-error {
  font-size: 13px;
  color: var(--danger);
  margin-top: 6px;
}

/* Checkbox & Radio */
input[type="checkbox"], input[type="radio"] {
  width: auto;
  margin-right: 8px;
  accent-color: var(--primary-500);
}

/* ============================================
   TABLES
   ============================================ */

table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: var(--border-radius);
  overflow: hidden;
}

thead {
  background: var(--slate-50);
}

th {
  text-align: left;
  padding: 14px 16px;
  font-weight: 600;
  color: var(--slate-600);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--slate-200);
}

td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--slate-100);
  color: var(--slate-700);
}

tr:hover td {
  background: var(--slate-50);
}

tr:last-child td {
  border-bottom: none;
}

/* ============================================
   BADGES
   ============================================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-critical {
  background: linear-gradient(135deg, #fecaca, #fee2e2);
  color: var(--danger-dark);
  border: 1px solid #fca5a5;
}

.badge-high {
  background: linear-gradient(135deg, #fed7aa, #ffedd5);
  color: #c2410c;
  border: 1px solid #fdba74;
}

.badge-medium {
  background: linear-gradient(135deg, #fde68a, #fef3c7);
  color: #b45309;
  border: 1px solid #fcd34d;
}

.badge-low {
  background: linear-gradient(135deg, #a7f3d0, #d1fae5);
  color: var(--success-dark);
  border: 1px solid #6ee7b7;
}

.badge-info {
  background: var(--info-light);
  color: #1d4ed8;
  border: 1px solid #93c5fd;
}

.badge-neutral {
  background: var(--slate-100);
  color: var(--slate-600);
  border: 1px solid var(--slate-300);
}

/* ============================================
   STATUS INDICATORS
   ============================================ */

.status-pass {
  color: var(--success);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.status-pass::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.status-fail {
  color: var(--danger);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.status-fail::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--danger);
  border-radius: 50%;
}

.status-na {
  color: var(--slate-500);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ============================================
   ORGANIZATIONS
   ============================================ */

.org {
  background: white;
  border: 1px solid var(--slate-200);
  border-radius: var(--border-radius-lg);
  padding: 20px;
  margin-bottom: 16px;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.org::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--primary-400), var(--accent-400));
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.org:hover {
  border-color: var(--primary-300);
  box-shadow: var(--shadow-lg);
}

.org:hover::before {
  opacity: 1;
}

.org-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.org-header h3 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.org-header h3::before {
  content: '';
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary-100), var(--accent-100));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.org-projects ul, .org-docs ul {
  margin: 12px 0;
  padding: 0;
  list-style: none;
}

.org-projects ul.project-list {
  margin-left: 0;
}

.org-projects li, .org-docs li {
  padding: 8px 0;
  border-bottom: 1px solid var(--slate-100);
  display: flex;
  align-items: center;
  gap: 8px;
}

.org-projects li.project-item {
  padding: 0.75rem;
  border-bottom: none;
}

.org-projects li:last-child, .org-docs li:last-child {
  border-bottom: none;
}

.org-projects li::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--primary-400);
  border-radius: 50%;
}

.org-projects li.project-item::before {
  display: none;
}

/* ============================================
   FRAMEWORK STYLES
   ============================================ */

.framework-form {
  padding: 20px;
  background: linear-gradient(135deg, var(--slate-50), var(--primary-50));
  border-radius: var(--border-radius);
  margin: 16px 0;
  border: 1px solid var(--slate-200);
}

.framework-form .form-row {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.framework-form .form-row label {
  min-width: 160px;
  font-weight: 500;
  color: var(--slate-700);
  margin-bottom: 0;
}

.framework-form .form-row select,
.framework-form .form-row input {
  flex: 1;
  min-width: 200px;
}

.framework-card {
  background: white;
  border: 1px solid var(--slate-200);
  border-radius: var(--border-radius-lg);
  padding: 20px;
  margin-bottom: 16px;
  transition: all var(--transition-normal);
}

.framework-card:hover {
  border-color: var(--primary-300);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.framework-card h4 {
  margin: 0 0 12px 0;
  color: var(--slate-800);
  display: flex;
  align-items: center;
  gap: 10px;
}

.framework-card .meta {
  color: var(--slate-500);
  font-size: 13px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.framework-card .meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.control-list {
  max-height: 450px;
  overflow-y: auto;
  border: 1px solid var(--slate-200);
  border-radius: var(--border-radius);
  padding: 12px;
  background: var(--slate-50);
}

.control-list::-webkit-scrollbar {
  width: 8px;
}

.control-list::-webkit-scrollbar-track {
  background: var(--slate-100);
  border-radius: 4px;
}

.control-list::-webkit-scrollbar-thumb {
  background: var(--slate-300);
  border-radius: 4px;
}

.control-list::-webkit-scrollbar-thumb:hover {
  background: var(--slate-400);
}

/* ============================================
   CHECKLIST STYLES
   ============================================ */

.checklist-item {
  border-bottom: 1px solid var(--slate-100);
  padding: 16px 0;
  transition: background var(--transition-fast);
}

.checklist-item:hover {
  background: var(--slate-50);
  margin: 0 -12px;
  padding: 16px 12px;
  border-radius: var(--border-radius);
}

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

.checklist-item .control-id {
  font-weight: 700;
  color: var(--primary-600);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  background: var(--primary-50);
  padding: 4px 10px;
  border-radius: 6px;
  display: inline-block;
}

.checklist-item .control-text {
  margin: 12px 0;
  white-space: pre-wrap;
  color: var(--slate-700);
  line-height: 1.7;
}

.checklist-item .guidance {
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  border-left: 4px solid var(--warning);
  padding: 12px 16px;
  margin: 12px 0;
  font-size: 13px;
  border-radius: 0 var(--border-radius) var(--border-radius) 0;
  color: var(--slate-700);
}

/* ============================================
   DETAILS/ACCORDION
   ============================================ */

details {
  margin: 12px 0;
  background: white;
  border: 1px solid var(--slate-200);
  border-radius: var(--border-radius);
  overflow: hidden;
}

details summary {
  cursor: pointer;
  padding: 14px 18px;
  background: var(--slate-50);
  font-weight: 600;
  color: var(--slate-700);
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all var(--transition-fast);
  list-style: none;
}

details summary::-webkit-details-marker {
  display: none;
}

details summary::before {
  content: '';
  width: 20px;
  height: 20px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M9 5l7 7-7 7'/%3E%3C/svg%3E") center/contain no-repeat;
  transition: transform var(--transition-fast);
}

details[open] summary::before {
  transform: rotate(90deg);
}

details summary:hover {
  background: var(--slate-100);
}

details[open] summary {
  border-bottom: 1px solid var(--slate-200);
}

details > *:not(summary) {
  padding: 16px;
}

/* ============================================
   ALERTS & MESSAGES
   ============================================ */

.alert {
  padding: 16px 20px;
  border-radius: var(--border-radius);
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.alert-success {
  background: var(--success-light);
  border: 1px solid #a7f3d0;
  color: var(--success-dark);
}

.alert-warning {
  background: var(--warning-light);
  border: 1px solid #fcd34d;
  color: var(--warning-dark);
}

.alert-danger {
  background: var(--danger-light);
  border: 1px solid #fca5a5;
  color: var(--danger-dark);
}

.alert-info {
  background: var(--info-light);
  border: 1px solid #93c5fd;
  color: #1d4ed8;
}

/* Flash messages */
.flash {
  padding: 14px 20px;
  border-radius: var(--border-radius);
  margin-bottom: 16px;
  animation: slideIn 0.3s ease-out;
}

.flash.success { background: var(--success-light); color: var(--success-dark); border-left: 4px solid var(--success); }
.flash.error { background: var(--danger-light); color: var(--danger-dark); border-left: 4px solid var(--danger); }
.flash.warning { background: var(--warning-light); color: var(--warning-dark); border-left: 4px solid var(--warning); }
.flash.info { background: var(--info-light); color: #1d4ed8; border-left: 4px solid var(--info); }

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

/* ============================================
   UTILITY CLASSES
   ============================================ */

.row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.inline {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 12px 0;
}

.muted {
  color: var(--slate-500);
}

.text-center { text-align: center; }
.text-right { text-align: right; }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.grid {
  display: grid;
  gap: 20px;
}

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

/* ============================================
   FOOTER
   ============================================ */

.footer {
  margin-top: 40px;
  padding: 24px 0;
  text-align: center;
  color: var(--slate-500);
  font-size: 13px;
  border-top: 1px solid var(--slate-200);
}

.footer small {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ============================================
   LOGIN & AUTH PAGES
   ============================================ */

.auth-container {
  min-height: calc(100vh - var(--header-height));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.auth-card {
  background: white;
  border-radius: var(--border-radius-xl);
  box-shadow: var(--shadow-xl);
  padding: 40px;
  width: 100%;
  max-width: 420px;
  border: 1px solid var(--slate-100);
}

.auth-card h1 {
  text-align: center;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--primary-600), var(--accent-500));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-card .subtitle {
  text-align: center;
  color: var(--slate-500);
  margin-bottom: 32px;
}

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

.auth-card button[type="submit"] {
  width: 100%;
  padding: 14px;
  font-size: 15px;
  margin-top: 8px;
}

.auth-card .auth-footer {
  text-align: center;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--slate-200);
  color: var(--slate-500);
}

.auth-card .auth-footer a {
  color: var(--primary-600);
  font-weight: 500;
}

/* ============================================
   DASHBOARD STATS
   ============================================ */

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

.stat-card {
  background: white;
  border: 1px solid var(--slate-200);
  border-radius: var(--border-radius-lg);
  padding: 24px;
  transition: all var(--transition-normal);
}

.stat-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.stat-card .stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 16px;
}

.stat-card .stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--slate-800);
  line-height: 1;
}

.stat-card .stat-label {
  color: var(--slate-500);
  font-size: 14px;
  margin-top: 4px;
}

.stat-card .stat-value.stat-pass {
  color: var(--success);
}

.stat-card .stat-value.stat-fail {
  color: var(--danger);
}

/* ============================================
   CHARTS CONTAINER
   ============================================ */

.charts-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-bottom: 24px;
}

.chart-wrapper {
  background: white;
  border: 1px solid var(--slate-200);
  border-radius: var(--border-radius-lg);
  padding: 20px;
  min-height: 300px;
}

.chart-wrapper h4 {
  margin: 0 0 16px 0;
  color: var(--slate-700);
  font-size: 15px;
  font-weight: 600;
}

.chart-wrapper-full {
  background: white;
  border: 1px solid var(--slate-200);
  border-radius: var(--border-radius-lg);
  padding: 20px;
  min-height: 250px;
  max-height: 600px;
  overflow: hidden;
}

.chart-wrapper-full h4 {
  margin: 0 0 16px 0;
  color: var(--slate-700);
  font-size: 15px;
  font-weight: 600;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .container {
    padding: 16px;
  }

  .header-inner {
    flex-wrap: wrap;
    gap: 12px;
  }

  .header nav {
    order: 3;
    width: 100%;
    justify-content: center;
    padding-bottom: 8px;
  }

  .header nav a {
    padding: 6px 12px;
    font-size: 13px;
  }

  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .framework-form .form-row {
    flex-direction: column;
    align-items: stretch;
  }

  .framework-form .form-row label {
    min-width: auto;
  }

  .org-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .auth-card {
    padding: 24px;
  }

  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.25rem; }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .header nav a {
    padding: 6px 8px;
    font-size: 12px;
  }
}

/* ============================================
   LOADING STATES
   ============================================ */

.loading {
  position: relative;
  pointer-events: none;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 24px;
  margin: -12px 0 0 -12px;
  border: 3px solid var(--slate-200);
  border-top-color: var(--primary-500);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ============================================
   SKELETON LOADING
   ============================================ */

.skeleton {
  background: linear-gradient(90deg, var(--slate-100) 25%, var(--slate-200) 50%, var(--slate-100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--border-radius);
}

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

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
  .header, .footer, button, .btn {
    display: none;
  }

  body {
    background: white;
  }

  .card {
    box-shadow: none;
    border: 1px solid #ddd;
  }
}

/* ============================================
   PROJECT LIST & BADGES
   ============================================ */

.project-list {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

.project-list li {
  list-style: none !important;
}

.project-item {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  margin-left: 0 !important;
  background: var(--slate-50);
  border-radius: var(--border-radius);
  border: 1px solid var(--slate-200);
  transition: all 0.2s ease;
}

.project-item:hover {
  background: var(--slate-100);
  border-color: var(--primary-300);
}

.project-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  width: 100%;
  justify-content: flex-start;
}

.project-name {
  font-weight: 500;
  color: var(--slate-800);
  text-decoration: none;
}

.project-name:hover {
  color: var(--primary-600);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
}

.badge.ref {
  background: var(--primary-100);
  color: var(--primary-700);
}

.badge.auditor {
  background: var(--success-light);
  color: var(--success-dark);
}

.badge.unassigned {
  background: var(--slate-200);
  color: var(--slate-500);
  font-style: italic;
}

/* Project header assignee */
.project-header-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.assignee-selector {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  background: var(--slate-100);
  border-radius: var(--border-radius);
  font-size: 0.875rem;
}

.assignee-selector label {
  color: var(--slate-600);
  font-weight: 500;
}

.assignee-selector select {
  padding: 0.3rem 0.5rem;
  border: 1px solid var(--slate-300);
  border-radius: 4px;
  background: white;
  font-size: 0.85rem;
  min-width: 150px;
}

/* ============================================
   CHAT PANEL STYLES
   ============================================ */

.chat-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  background: var(--primary-600);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  z-index: 1000;
  transition: transform var(--transition-fast), background var(--transition-fast);
}

.chat-toggle:hover {
  transform: scale(1.1);
  background: var(--primary-700);
}

.chat-icon {
  font-size: 1.5rem;
}

.chat-unread {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  background: var(--danger-500);
  color: white;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
}

.chat-panel {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 380px;
  height: 500px;
  max-height: calc(100vh - 100px);
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

@media (max-width: 480px) {
  .chat-panel {
    width: calc(100vw - 32px);
    right: 16px;
    bottom: 16px;
    height: calc(100vh - 100px);
  }
}

.chat-header {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: var(--primary-600);
  color: white;
  gap: 8px;
}

.chat-title {
  font-weight: 600;
  flex: 1;
}

.chat-status {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.2);
}

.chat-status.connected {
  background: var(--success-500);
}

.chat-status.disconnected {
  background: var(--danger-500);
}

.chat-close {
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  opacity: 0.8;
}

.chat-close:hover {
  opacity: 1;
}

.chat-online {
  padding: 8px 16px;
  background: var(--slate-50);
  border-bottom: 1px solid var(--slate-200);
  font-size: 0.8rem;
  color: var(--slate-600);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--slate-50);
}

.chat-message {
  max-width: 85%;
  padding: 8px 12px;
  border-radius: 12px;
  background: white;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  align-self: flex-start;
}

.chat-message.own {
  background: var(--primary-100);
  align-self: flex-end;
}

.chat-message.system {
  max-width: 100%;
  background: transparent;
  box-shadow: none;
  text-align: center;
  color: var(--slate-500);
  font-size: 0.8rem;
  align-self: center;
  padding: 4px 8px;
}

.chat-message.history {
  opacity: 0.8;
}

.chat-message-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}

.chat-user {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary-700);
}

.chat-message.own .chat-user {
  color: var(--primary-800);
}

.chat-time {
  font-size: 0.7rem;
  color: var(--slate-400);
}

.chat-content {
  font-size: 0.9rem;
  line-height: 1.4;
  word-wrap: break-word;
  white-space: pre-wrap;
}

.chat-input-container {
  display: flex;
  padding: 12px;
  gap: 8px;
  border-top: 1px solid var(--slate-200);
  background: white;
}

.chat-input-container input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--slate-300);
  border-radius: 20px;
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition-fast);
}

.chat-input-container input:focus {
  border-color: var(--primary-500);
}

.chat-input-container button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary-600);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: background var(--transition-fast);
}

.chat-input-container button:hover {
  background: var(--primary-700);
}
