:root {
  --bg: #f6f8fc;
  --surface: #ffffff;
  --text: #1b2430;
  --muted: #5f6c7b;
  --primary: #0d6efd;
  --success: #198754;
  --danger: #dc3545;
  --border: #dbe3ef;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: var(--bg);
  color: var(--text);
}

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

.container {
  width: min(1100px, 92%);
  margin: 0 auto;
}

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.topbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 0;
}

.brand {
  font-weight: 700;
  letter-spacing: 0.3px;
}

.nav-links {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.btn,
button {
  border: 0;
  border-radius: 10px;
  padding: 0.7rem 1rem;
  cursor: pointer;
  background: var(--primary);
  color: #fff;
}

.btn.secondary,
button.secondary {
  background: #4f5d75;
}

.btn.danger,
button.danger {
  background: var(--danger);
}

main {
  padding: 1.5rem 0 2.5rem;
}

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

.grid {
  display: grid;
  gap: 1rem;
}

.grid.stats {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.actions-grid {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.stat h3 {
  margin: 0;
  font-size: 0.95rem;
  color: var(--muted);
}

.stat p {
  margin: 0.35rem 0 0;
  font-size: 1.6rem;
  font-weight: 700;
}

form {
  display: grid;
  gap: 0.8rem;
}

label {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.form-grid {
  display: grid;
  gap: 0.75rem;
}

.form-grid.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid .full {
  grid-column: 1 / -1;
}

.upload-panel {
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 0.75rem;
}

.upload-panel .msg {
  margin-top: 0.5rem;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
  font-size: 0.95rem;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 0.65rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

small.muted {
  color: var(--muted);
}

.auth-wrap {
  min-height: calc(100vh - 76px);
  display: grid;
  place-items: center;
}

.auth-card {
  width: min(420px, 100%);
}

.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  background: #e9f1ff;
  color: var(--primary);
}

.inline {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.msg {
  padding: 0.55rem 0.8rem;
  border-radius: 10px;
  font-size: 0.9rem;
}

.msg.error {
  background: #ffe5e8;
  color: #9f1d2d;
}

.msg.success {
  background: #e6f7eb;
  color: #0f5132;
}

.footer {
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
  padding: 1rem 0 2rem;
}

.eyebrow {
  margin: 0 0 0.45rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
}

.teacher-dashboard-shell {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 280px minmax(0, 1fr);
  align-items: start;
}

.teacher-dashboard-sidebar {
  position: sticky;
  top: 1.5rem;
}

.teacher-sidebar-card {
  background: linear-gradient(160deg, #0f172a 0%, #1d4ed8 100%);
  color: #fff;
  border: 0;
  border-radius: 28px;
  padding: 1.4rem;
}

.teacher-sidebar-card .eyebrow,
.teacher-sidebar-card .muted {
  color: rgba(255, 255, 255, 0.78);
}

.teacher-sidebar-card h1 {
  margin: 0 0 0.65rem;
}

.teacher-side-nav {
  display: grid;
  gap: 0.65rem;
  margin-top: 1.2rem;
}

.teacher-side-nav a {
  display: block;
  padding: 0.8rem 0.95rem;
  border-radius: 16px;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.teacher-dashboard-content {
  display: grid;
  gap: 1.25rem;
}

.teacher-hero-card {
  border-radius: 24px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.teacher-stats-grid {
  margin-top: 1rem;
}

.teacher-stat-card {
  margin-bottom: 0;
  border-radius: 18px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
}

.teacher-form-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.section-heading h3 {
  margin: 0;
}

.weekday-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.weekday-option {
  margin: 0;
}

.weekday-option input {
  display: none;
}

.weekday-option span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 96px;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-weight: 600;
}

.weekday-option input:checked + span {
  background: #0f172a;
  border-color: #0f172a;
  color: #fff;
}

.teacher-list {
  display: grid;
  gap: 0.8rem;
}

.teacher-list-item {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 1rem;
  border-radius: 18px;
  background: #f8fbff;
  border: 1px solid var(--border);
}

.teacher-list-item p {
  margin: 0.25rem 0 0;
}

.course-setup-grid {
  display: grid;
  gap: 0.9rem;
}

.course-setup-card {
  padding: 1rem;
  border-radius: 18px;
  background: #f8fbff;
  border: 1px solid var(--border);
}

.course-setup-card p {
  margin: 0.45rem 0 0;
}

.teacher-course-upload {
  margin-top: 1rem;
}

.teacher-course-upload-actions {
  justify-content: space-between;
  flex-wrap: wrap;
}

@media (max-width: 760px) {
  .form-grid.two-col {
    grid-template-columns: 1fr;
  }

  .teacher-dashboard-shell,
  .teacher-form-grid {
    grid-template-columns: 1fr;
  }

  .teacher-dashboard-sidebar {
    position: static;
  }

  .teacher-list-item,
  .section-heading {
    flex-direction: column;
    align-items: flex-start;
  }
}
