:root {
  /* Colors - Light Mode (matching screenshots) */
  --wf-primary: #8B5CF6;
  --wf-primary-hover: #7C3AED;
  --wf-secondary: #06B6D4;
  --wf-accent: #F43F5E; /* Risk red */
  --wf-success: #10B981;
  --wf-warning: #F59E0B;
  
  --wf-bg: #F8FAFC;
  --wf-card-bg: #FFFFFF;
  --wf-border: #E2E8F0;
  
  --wf-text-main: #0F172A;
  --wf-text-secondary: #64748B;
  --wf-text-muted: #94A3B8;
  
  --wf-gradient-primary: linear-gradient(135deg, #8B5CF6 0%, #6366F1 100%);
  --wf-gradient-risk: linear-gradient(135deg, #F43F5E 0%, #E11D48 100%);
  
  /* Shadows */
  --wf-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --wf-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --wf-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --wf-shadow-primary: 0 4px 14px 0 rgba(139, 92, 246, 0.3);
  
  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  
  /* Radius */
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-full: 9999px;
  
  /* Layout */
  --header-height: 70px;
  --sidebar-width: 260px;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: --wf-bg; /* Fallback */
  background-color: var(--wf-bg);
  color: var(--wf-text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a {
  text-decoration: none;
  color: inherit;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--wf-text-main);
}

h1 { font-size: 2.5rem; line-height: 1.2; }
h2 { font-size: 1.875rem; line-height: 1.25; }
h3 { font-size: 1.5rem; line-height: 1.3; }
h4 { font-size: 1.25rem; }

p {
  margin: 0 0 1rem;
  color: var(--wf-text-secondary);
}

.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.text-primary { color: var(--wf-primary); }
.text-success { color: var(--wf-success); }
.text-danger { color: var(--wf-accent); }
.text-warning { color: var(--wf-warning); }
.text-muted { color: var(--wf-text-muted); }

/* Components */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  font-size: 0.95rem;
  gap: 0.5rem;
}

.btn-primary {
  background: var(--wf-gradient-primary);
  color: white;
  box-shadow: var(--wf-shadow-primary);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--wf-border);
  color: var(--wf-text-main);
}

.btn-outline:hover {
  border-color: var(--wf-text-muted);
  background: white;
}

.btn-ghost {
  background: transparent;
  color: var(--wf-text-secondary);
}

.btn-ghost:hover {
  background: rgba(0,0,0,0.05);
  color: var(--wf-text-main);
}

.card {
  background: var(--wf-card-bg);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--wf-shadow);
  border: 1px solid var(--wf-border);
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}

.card:hover {
  box-shadow: var(--wf-shadow-lg);
  border-color: #CBD5E1;
}

/* Navbar */
.navbar {
  height: var(--header-height);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--wf-border);
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-lg);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--wf-text-main);
}

.nav-brand-icon {
  width: 36px;
  height: 36px;
  background: var(--wf-gradient-primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-link {
  color: var(--wf-text-secondary);
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s;
}

.nav-link:hover, .nav-link.active {
  color: var(--wf-primary);
}

/* Forms */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--wf-text-main);
}

.form-input, .form-select {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--wf-border);
  background: white;
  color: var(--wf-text-main);
  font-size: 0.95rem;
  transition: all 0.2s;
}

.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--wf-primary);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
}

.badge-success { background: #DCFCE7; color: #166534; }
.badge-warning { background: #FEF3C7; color: #92400E; }
.badge-danger { background: #FFE4E6; color: #9F1239; }
.badge-neutral { background: #F1F5F9; color: #475569; }

/* Grid Layouts */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-md); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-md); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-md); }

/* Dashboard Specific */
.stat-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

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

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--wf-text-main);
}

.stat-label {
  color: var(--wf-text-secondary);
  font-size: 0.875rem;
}

/* Sidebar for Admin */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  background: white;
  border-right: 1px solid var(--wf-border);
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
}

.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: var(--space-lg);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 2rem;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  color: var(--wf-text-secondary);
  font-weight: 500;
  transition: all 0.2s;
}

.sidebar-item:hover {
  background: #F1F5F9;
  color: var(--wf-text-main);
}

.sidebar-item.active {
  background: #EFF6FF;
  color: var(--wf-primary);
}

/* Tables */
.table-container {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.table th {
  text-align: left;
  padding: 1rem;
  border-bottom: 1px solid var(--wf-border);
  color: var(--wf-text-secondary);
  font-weight: 600;
  background: #F8FAFC;
}

.table td {
  padding: 1rem;
  border-bottom: 1px solid var(--wf-border);
  color: var(--wf-text-main);
}

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

/* Utilities */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-8 { margin-bottom: 2rem; }
.mt-4 { margin-top: 1rem; }
.w-full { width: 100%; }
.text-center { text-align: center; }

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

@media (max-width: 768px) {
  .admin-layout { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; }
  .main-content { margin-left: 0; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .navbar { padding: 0 var(--space-md); }
  .nav-links { display: none; } /* Hide nav links on mobile for wireframe simplicity */
}

/* Placeholder for Images */
.placeholder-image {
  background: #E2E8F0;
  width: 100%;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94A3B8;
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
}

.avatar-placeholder {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #E2E8F0;
  color: #64748B;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
}
