:root {
  /* Colors - Government Professional / Trustworthy */
  --primary: #1a365d;
  --primary-light: #2c5282;
  --secondary: #ed8936; /* Soft Orange Alert */
  --success: #38a169;
  --warning: #ecc94b;
  --danger: #e53e3e;
  --bg-main: #f7fafc;
  --bg-card: #ffffff;
  --text-main: #2d3748;
  --text-muted: #718096;
  --border: #e2e8f0;
  
  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 4rem;
  
  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.12);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
}

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

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

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

section {
  margin-top: var(--space-xl);
  padding-bottom: var(--space-xl);
}

main > :first-child {
  margin-top: 0;
}

/* Typography */
h1 { font-size: 2.25rem; font-weight: 700; color: var(--primary); margin-bottom: var(--space-sm); }
h2 { font-size: 1.5rem; font-weight: 600; color: var(--primary); margin-bottom: var(--space-sm); }
h3 { font-size: 1.125rem; font-weight: 600; margin-bottom: var(--space-xs); }
p { color: var(--text-muted); }

/* Navigation */
.navbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: var(--space-sm) 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: var(--space-lg);
}

.nav-link {
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 500;
  transition: color 0.2s;
}

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

/* Cards */
.card {
  background: var(--bg-card);
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: var(--space-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

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

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

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

.form-input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-light);
}

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

/* Placeholders */
.placeholder-image {
  background: #edf2f7;
  width: 100%;
  aspect-ratio: 16/9;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.875rem;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
}

.placeholder-image::after {
  content: attr(data-label);
}

.placeholder-avatar {
  width: 40px;
  height: 40px;
  background: #e2e8f0;
  border-radius: 50%;
}

/* Heatmap Grid */
.heatmap {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 4px;
}

.heatmap-cell {
  aspect-ratio: 1;
  border-radius: 2px;
  cursor: pointer;
}

.risk-low { background: #c6f6d5; }
.risk-med { background: #fefcbf; }
.risk-high { background: #feebc8; }
.risk-critical { background: #fed7d7; }

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

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: var(--space-sm);
}

th {
  text-align: left;
  padding: var(--space-sm);
  border-bottom: 2px solid var(--border);
  color: var(--text-muted);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

td {
  padding: var(--space-sm);
  border-bottom: 1px solid var(--border);
}

/* Badge */
.badge {
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-success { background: #c6f6d5; color: #22543d; }
.badge-warning { background: #feebc8; color: #7b341e; }
.badge-danger { background: #fed7d7; color: #822727; }

/* Mood Scale */
.mood-scale {
  display: flex;
  justify-content: space-between;
  gap: var(--space-sm);
  margin: var(--space-lg) 0;
}

.mood-btn {
  flex: 1;
  aspect-ratio: 1;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.mood-btn:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.mood-emoji {
  font-size: 2rem;
  margin-bottom: var(--space-xs);
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-md);
}

.stat-card {
  display: flex;
  flex-direction: column;
}

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

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