:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #0f172a;
  --text-secondary: #64748b;
  --border: #e2e8f0;
  --radius: 8px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  gap: 2rem;
}

nav a {
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 500;
  transition: color 0.2s;
}

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

nav .brand {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}

.container {
  max-width: 960px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

h1 { font-size: 1.75rem; margin-bottom: 1rem; }
h2 { font-size: 1.25rem; margin-bottom: 0.75rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.form-group { margin-bottom: 1rem; }
.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.25rem;
  font-size: 0.875rem;
}

input, textarea, select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-family: inherit;
}

textarea { resize: vertical; min-height: 120px; }

button {
  padding: 0.5rem 1.25rem;
  border: none;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

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

.btn-primary:disabled {
  background: #94a3b8;
  cursor: not-allowed;
}

.status-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.status-selected { background: #dcfce7; color: var(--success); }
.status-rejected { background: #fee2e2; color: var(--danger); }
.status-pending { background: #fef3c7; color: var(--warning); }

.skill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-top: 0.25rem;
}

.skill-tag {
  padding: 0.15rem 0.5rem;
  background: #eff6ff;
  color: var(--primary);
  border-radius: 4px;
  font-size: 0.75rem;
}

.skill-tag.missing {
  background: #fef2f2;
  color: var(--danger);
}

.skill-tag.weak {
  background: #fffbeb;
  color: var(--warning);
  border: 1px solid #fcd34d;
}

.resource-card {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  background: #ffffff;
  max-width: 320px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.resource-card:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.12);
}

.resource-skill {
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--primary);
  font-weight: 700;
}

.resource-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
}

.resource-provider {
  font-size: 0.6875rem;
  color: var(--text-secondary);
}

.resource-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.625rem 0;
  border-bottom: 1px solid var(--border);
}

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

.screening-id {
  font-size: 0.6875rem;
  color: var(--text-secondary);
  background: var(--bg);
  border-radius: 4px;
  padding: 0.125rem 0.375rem;
  white-space: nowrap;
}

.count-badge {
  display: inline-block;
  background: #eff6ff;
  color: var(--primary);
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.125rem 0.5rem;
  margin-left: 0.5rem;
}

.learning-plan .skill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: stretch;
}

.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: 1fr 1fr; }

.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s;
}

.upload-zone:hover { border-color: var(--primary); }
.upload-zone.dragover { border-color: var(--primary); background: #eff6ff; }

.upload-zone p { color: var(--text-secondary); font-size: 0.875rem; }

.result-section { margin-bottom: 1.5rem; }

.meta-row {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}

.meta-row:last-child { border-bottom: none; }
.meta-label { color: var(--text-secondary); }

.empty-state {
  text-align: center;
  padding: 3rem;
  color: var(--text-secondary);
}

.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 0.5rem;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 4px;
  transition: width 0.3s;
}

@media (max-width: 640px) {
  .grid-2 { grid-template-columns: 1fr; }
  nav { flex-direction: column; gap: 0.5rem; }
}
