:root {
  --bg: #f7f9fc;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --primary: #1e3a8a;
  --primary-strong: #1e40af;
  --accent: #0ea5e9;
  --success: #16a34a;
  --danger: #dc2626;
  --warn: #d97706;
  --radius: 14px;
  --shadow: 0 6px 20px rgba(15, 23, 42, 0.06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Cantarell, 'Helvetica Neue', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 32px 20px;
}

.container.narrow { max-width: 480px; }

h1, h2, h3 { margin: 0 0 12px 0; font-weight: 600; }
h1 { font-size: 28px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }

.tagline { color: var(--muted); margin-top: 0; }

.hero header { text-align: center; margin-bottom: 36px; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.card {
  display: block;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--text);
  transition: transform 0.12s ease, border-color 0.12s ease;
}
.card:hover { transform: translateY(-2px); border-color: var(--primary); }
.card p { color: var(--muted); margin: 8px 0 0 0; }

.card-operator h2 { color: var(--primary); }
.card-student h2 { color: var(--accent); }

.foot {
  text-align: center;
  margin-top: 40px;
  color: var(--muted);
}
.foot #health-dot { color: var(--muted); }
.foot .ok { color: var(--success); }
.foot .err { color: var(--danger); }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 20px;
}

.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}
.field input, .field select {
  width: 100%;
  padding: 12px 14px;
  font-size: 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font-family: inherit;
}
.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.12);
}

.btn {
  display: inline-block;
  padding: 12px 20px;
  border: none;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s ease;
}
.btn:hover { background: var(--primary-strong); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--primary); border: 1px solid var(--primary); }
.btn.danger { background: var(--danger); }

.msg {
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
  margin-top: 12px;
}
.msg.ok { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.msg.err { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.msg.info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

.pin-display {
  font-family: ui-monospace, 'SF Mono', Consolas, monospace;
  font-size: 48px;
  font-weight: 700;
  letter-spacing: 8px;
  text-align: center;
  padding: 20px;
  background: #f1f5f9;
  border-radius: 12px;
  margin: 16px 0;
  color: var(--primary);
}

.qr-box {
  display: flex;
  justify-content: center;
  padding: 20px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 16px;
}
.qr-box img, .qr-box canvas { max-width: 220px; }

.student-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.student-list li {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.student-list li:last-child { border-bottom: none; }
.student-list .name { font-weight: 600; }
.student-list .meta { color: var(--muted); font-size: 13px; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.topbar .title { font-size: 22px; font-weight: 600; color: var(--primary); }
.topbar .user { color: var(--muted); font-size: 14px; }

.pin-input {
  font-family: ui-monospace, 'SF Mono', Consolas, monospace;
  font-size: 28px;
  letter-spacing: 10px;
  text-align: center;
}

.hidden { display: none !important; }

/* Faz 2 — Curriculum sayfası */
.pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.pill {
  padding: 10px 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  transition: all 0.12s ease;
}
.pill:hover { border-color: var(--primary); color: var(--primary); }
.pill.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.inline-form {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.inline-form input {
  flex: 1;
  min-width: 200px;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
}
.inline-form input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30,58,138,0.12);
}

.unit-list {
  list-style: none;
  padding: 0;
  margin: 12px 0 0 0;
}
.unit-list li {
  padding: 14px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  transition: border-color 0.12s ease;
}
.unit-list li:hover { border-color: var(--primary); }
.unit-list li.active {
  border-color: var(--primary);
  background: #eff6ff;
}
.unit-list .name { font-weight: 600; }
.unit-list .meta { color: var(--muted); font-size: 13px; }

.subject-card {
  cursor: pointer;
}
.subject-card.active {
  border-color: var(--primary);
  background: #eff6ff;
}
.subject-card .icon {
  font-size: 28px;
  margin-bottom: 6px;
  display: block;
}
.subject-card .sub-name { font-weight: 600; font-size: 15px; color: var(--text); }
.subject-card .sub-meta { color: var(--muted); font-size: 12px; margin-top: 4px; }

.kind-badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  border-radius: 999px;
  margin-left: 6px;
  font-weight: 600;
  text-transform: uppercase;
}
.kind-badge.lecture_notes { background: #dbeafe; color: #1e40af; }
.kind-badge.question_bank { background: #fef3c7; color: #92400e; }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal-panel {
  background: #fff;
  border-radius: var(--radius);
  padding: 28px;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
