:root {
  color: #1f2937;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #eef2ff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(135deg, #eef2ff 0%, #f8fafc 55%, #eef2ff 100%);
  color: #0f172a;
}

button,
input,
select,
textarea {
  font: inherit;
}

.site-header {
  align-items: center;
  background: #ffffff;
  border-bottom: 1px solid #dbe4ff;
  display: grid;
  gap: 1rem;
  grid-template-columns: auto 1fr auto;
  padding: 1.25rem clamp(1rem, 4vw, 3rem);
  position: relative;
}

.site-header h1 {
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  margin: 0.2rem 0 0;
}

.eyebrow {
  color: #4f46e5;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin: 0;
  text-transform: uppercase;
}

.menu {
  align-self: start;
  position: relative;
}

.menu summary {
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 999px;
  color: #3730a3;
  cursor: pointer;
  font-weight: 700;
  list-style: none;
  padding: 0.65rem 1rem;
}

.menu summary::-webkit-details-marker {
  display: none;
}

.menu-list {
  background: #ffffff;
  border: 1px solid #dbe4ff;
  border-radius: 0.8rem;
  box-shadow: 0 16px 40px rgba(79, 70, 229, 0.14);
  display: grid;
  gap: 0.35rem;
  left: 0;
  min-width: 190px;
  padding: 0.5rem;
  position: absolute;
  top: calc(100% + 0.5rem);
  z-index: 10;
}

.menu-list button {
  background: transparent;
  border: 0;
  border-radius: 0.55rem;
  color: #1f2937;
  cursor: pointer;
  padding: 0.65rem 0.75rem;
  text-align: left;
}

.menu-list button.active,
.menu-list button:hover {
  background: #eef2ff;
  color: #3730a3;
}

nav {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

nav button,
.link-button {
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 999px;
  color: #3730a3;
  cursor: pointer;
  padding: 0.65rem 1rem;
}

nav button.active,
.primary {
  background: #4f46e5;
  color: #ffffff;
}

.role-pill {
  background: #dcfce7;
  border-radius: 999px;
  color: #166534;
  font-weight: 700;
  padding: 0.5rem 0.85rem;
  text-transform: capitalize;
}

.container {
  margin: 0 auto;
  max-width: 1380px;
  padding: clamp(1rem, 2.4vw, 2.25rem);
  width: 100%;
}

.card {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #dbe4ff;
  border-radius: 1.5rem;
  box-shadow: 0 18px 45px rgba(79, 70, 229, 0.12);
  padding: clamp(1rem, 2.4vw, 2rem);
  width: 100%;
  max-width: 100%;
  backdrop-filter: blur(8px);
}

.card h2 {
  color: #111827;
  font-size: 1.35rem;
  margin: 0.4rem 0 0.6rem;
}

.card p {
  color: #475569;
  line-height: 1.7;
}

.auth-card {
  margin: 0 auto;
  max-width: 520px;
}

.auth-card input[type="email"],
.auth-card input[type="password"] {
  padding-left: 1.35rem;
  padding-right: 1.35rem;
}

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

label {
  display: grid;
  font-weight: 700;
  gap: 0.4rem;
}

input,
select,
textarea {
  border: 1px solid #cbd5e1;
  border-radius: 0.8rem;
  padding: 0.8rem 1rem;
}

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

.inline-form {
  align-items: end;
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(150px, 0.8fr) minmax(120px, 0.6fr) minmax(220px, 1.4fr) auto;
  margin: 1.5rem 0;
}

.primary {
  border: 0;
  border-radius: 0.9rem;
  cursor: pointer;
  font-weight: 800;
  padding: 0.9rem 1rem;
}

.link-button {
  margin-top: 1rem;
}

.error {
  background: #fee2e2;
  border-radius: 0.8rem;
  color: #991b1b;
  padding: 0.8rem;
}

.table-wrap {
  margin-top: 1.5rem;
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  min-width: 640px;
  width: 100%;
  overflow: hidden;
  border-radius: 1rem;
}

th,
td {
  border-bottom: 1px solid #e2e8f0;
  padding: 0.9rem 1rem;
  text-align: left;
}

th {
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

th {
  background: #eef2ff;
  color: #3730a3;
  font-weight: 800;
}

.recommendation-list {
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
}

.recommendation {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.8rem;
  padding: 1rem;
}

.recommendation p {
  margin: 0;
  white-space: pre-wrap;
}

.recommendation span {
  color: #64748b;
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  margin-top: 0.75rem;
}

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

.portal-title-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.85rem;
}

.portal-title-row p {
  margin: 0;
}

.portal-selected-student {
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 999px;
  color: #4338ca;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 0.3rem 0.65rem;
}

.student-required-card {
  align-items: center;
  display: flex;
  gap: 1rem;
  margin: 0 auto;
  max-width: 680px;
}

.student-required-icon {
  align-items: center;
  background: #eef2ff;
  border-radius: 999px;
  display: flex;
  flex: 0 0 auto;
  font-size: 1.7rem;
  height: 58px;
  justify-content: center;
  width: 58px;
}

.student-required-card h2 {
  margin: 0.25rem 0;
}

.student-required-toast {
  align-items: center;
  animation: student-toast-in 0.2s ease-out;
  background: #ffffff;
  border: 1px solid #c7d2fe;
  border-left: 5px solid #4f46e5;
  border-radius: 0.8rem;
  bottom: 1.25rem;
  box-shadow: 0 12px 30px rgba(30, 41, 59, 0.2);
  color: #1e293b;
  display: flex;
  gap: 0.75rem;
  left: 50%;
  max-width: calc(100% - 2rem);
  padding: 0.8rem 1rem;
  position: fixed;
  transform: translateX(-50%);
  width: 430px;
  z-index: 2000;
}

.student-required-toast > span {
  font-size: 1.35rem;
}

.student-required-toast strong,
.student-required-toast small {
  display: block;
}

.student-required-toast small {
  color: #64748b;
  margin-top: 0.15rem;
}

@keyframes student-toast-in {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.profile-summary-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 1.25rem;
}

.profile-hero {
  align-items: center;
  display: flex;
  gap: 1rem;
}

.profile-hero h2,
.profile-hero p {
  margin-bottom: 0.3rem;
  margin-top: 0.3rem;
}

.profile-avatar {
  align-items: center;
  background: linear-gradient(135deg, #4f46e5, #60a5fa);
  border: 4px solid rgba(255, 255, 255, 0.85);
  border-radius: 999px;
  box-shadow: 0 8px 22px rgba(79, 70, 229, 0.22);
  color: #ffffff;
  display: flex;
  flex: 0 0 auto;
  font-size: 1.25rem;
  font-weight: 900;
  height: 64px;
  justify-content: center;
  width: 64px;
}

.profile-summary-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  padding: 1.1rem;
  position: relative;
}

.profile-card-heading {
  align-items: center;
  display: flex;
  gap: 0.55rem;
}

.profile-card-icon {
  align-items: center;
  background: #e0e7ff;
  border-radius: 0.6rem;
  color: #4338ca;
  display: inline-flex;
  font-size: 1rem;
  font-weight: 900;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.profile-summary-card h3 {
  color: #111827;
  margin: 0.55rem 0 0.35rem;
}

.profile-summary-card p {
  color: #64748b;
  margin: 0.3rem 0;
}

.profile-detail-line strong {
  color: #334155;
}

.profile-card-link {
  background: transparent;
  border: 0;
  color: #4f46e5;
  cursor: pointer;
  display: block;
  font-size: 0.8rem;
  font-weight: 800;
  margin-top: 1rem;
  padding: 0;
}

.profile-card-link:hover {
  color: #3730a3;
  text-decoration: underline;
}

.profile-summary-label {
  color: #4f46e5;
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.profile-homework-status {
  border-radius: 999px;
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 800;
  margin-top: 0.65rem;
  padding: 0.3rem 0.65rem;
}

.profile-homework-status.completed {
  background: #dcfce7;
  color: #166534;
}

.profile-homework-status.waiting {
  background: #fef3c7;
  color: #92400e;
}

@media (max-width: 640px) {
  .profile-summary-grid {
    grid-template-columns: 1fr;
  }
}

.hero-card {
  background: linear-gradient(135deg, #ffffff 0%, #e0e7ff 100%);
}

.progress-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.metric {
  background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  padding: 1rem;
}

.metric span {
  color: #64748b;
  display: block;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.metric strong {
  color: #312e81;
  display: block;
  font-size: 1.6rem;
}

.student-list {
  display: grid;
  gap: 0.85rem;
  margin-top: 1.5rem;
}

.student-row {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr auto auto auto;
  padding: 1rem;
  width: 100%;
}

.student-row h3,
.student-row p {
  margin: 0;
}

.student-row p {
  color: #64748b;
}

.student-button {
  cursor: pointer;
  text-align: left;
}

.active-student {
  border-color: #4f46e5;
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.15);
}

.selected-student-panel {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  margin-top: 1rem;
  padding: 1rem;
}

.selected-student-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.selected-student-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.student-actions {
  display: grid;
  gap: 1rem;
}

.student-section {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  padding: 1rem;
}

.status {
  background: #fef3c7;
  border-radius: 999px;
  color: #92400e;
  font-weight: 700;
  padding: 0.45rem 0.75rem;
}

.lecture-row {
  cursor: pointer;
}

.lecture-row.active-row {
  background: #eef2ff;
}

.lecture-detail {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  margin-top: 1.5rem;
  padding: 1rem;
}

.lecture-meta {
  color: #64748b;
  font-weight: 700;
}

.student-context {
  background: #eef2ff;
  border-radius: 999px;
  color: #3730a3;
  display: inline-block;
  font-weight: 700;
  margin-bottom: 1rem;
  padding: 0.45rem 0.8rem;
}

.homework-section {
  margin-top: 1rem;
}

.homework-form {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-top: 1rem;
}

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

.homework-list {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.homework-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  padding: 1rem;
}

.homework-card__header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.homework-card__header h3 {
  margin: 0;
}

.homework-card__header span {
  background: #eef2ff;
  border-radius: 999px;
  color: #3730a3;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0.35rem 0.7rem;
}

.homework-card--collapsible summary {
  cursor: pointer;
  list-style: none;
}

.homework-card--collapsible summary::-webkit-details-marker {
  display: none;
}

.homework-card--collapsible summary::before {
  color: #4f46e5;
  content: '›';
  font-size: 1.5rem;
  line-height: 1;
  transition: transform 0.2s ease;
}

.homework-card--collapsible details[open] summary::before {
  transform: rotate(90deg);
}

.homework-card__content {
  display: grid;
  gap: 0.75rem;
  padding-top: 1rem;
}

.lecture-tag {
  color: #4f46e5;
  font-weight: 700;
  margin: 0.4rem 0 0.75rem;
}

.topic-tracking-page {
  display: grid;
  gap: 0.85rem;
}

.topic-tracking-page h2 {
  font-size: 1.1rem;
  margin-bottom: 0.2rem;
}

.topic-tracking-page>p:not(.eyebrow) {
  font-size: 0.92rem;
  margin: 0;
}

.topic-heading-row {
  align-items: stretch;
  display: grid;
  gap: 1rem;
  grid-template-columns: 170px minmax(0, 1fr);
}

.topic-heading-copy {
  align-self: center;
}

.teacher-notes-box {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 0.75rem;
  color: #1f2937;
  min-height: 116px;
  padding: 0.8rem 0.95rem;
  resize: vertical;
  width: 100%;
}

.teacher-notes-box:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.18);
  outline: none;
}

.teacher-notes-box[readonly],
.topic-note[readonly] {
  background: #f1f5f9;
  color: #64748b;
  cursor: default;
}

.exam-chart-card {
  background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  margin-top: 1rem;
  padding: 1rem;
  position: relative;
}

.exam-chart-header {
  align-items: start;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.exam-chart-title-row {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
}

.exam-chart-type {
  align-items: center;
  color: #475569;
  display: flex;
  font-size: 0.78rem;
  font-weight: 800;
  gap: 0.4rem;
}

.exam-chart-type select,
.exam-filter select,
.exam-filter input {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 0.45rem;
  color: #1e293b;
  min-height: 34px;
  padding: 0.35rem 0.5rem;
}

.exam-average-score {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 999px;
  color: #047857;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.3rem 0.65rem;
}

.exam-average-score strong {
  color: #065f46;
  font-size: 0.85rem;
}

.exam-chart-header h4 {
  margin: 0;
}

.exam-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: flex-end;
}

.exam-chart-legend-item {
  align-items: center;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  color: #475569;
  cursor: pointer;
  display: inline-flex;
  font-size: 0.9rem;
  gap: 0.35rem;
  font-weight: 700;
  padding: 0.35rem 0.7rem;
}

.exam-chart-legend-item.active {
  background: #eef2ff;
  border-color: #818cf8;
  color: #3730a3;
}

.exam-chart-legend-swatch {
  border-radius: 999px;
  display: inline-block;
  height: 0.7rem;
  width: 0.7rem;
}

.exam-chart-svg {
  height: 260px;
  overflow: visible;
  width: 100%;
}

.exam-chart-point {
  cursor: pointer;
  outline: none;
  transform-box: fill-box;
  transform-origin: center;
  transition: filter 150ms ease, stroke-width 150ms ease, transform 150ms ease;
}

.exam-chart-interactive {
  cursor: pointer;
  outline: none;
  transition: filter 150ms ease, opacity 150ms ease;
}

.exam-chart-interactive:hover,
.exam-chart-interactive:focus,
.exam-chart-interactive.is-pinned {
  filter: drop-shadow(0 3px 5px rgb(30 41 59 / 0.3));
  opacity: 0.78;
}

.exam-chart-point:hover,
.exam-chart-point:focus,
.exam-chart-point.is-pinned {
  filter: drop-shadow(0 3px 5px rgb(30 41 59 / 0.3));
  stroke: #312e81;
  stroke-width: 3;
  transform: scale(1.55);
}

.exam-chart-tooltip {
  background: rgb(15 23 42 / 0.96);
  border: 1px solid rgb(129 140 248 / 0.7);
  border-radius: 0.9rem;
  box-shadow: 0 14px 34px rgb(15 23 42 / 0.24);
  color: #f8fafc;
  min-width: 220px;
  padding: 0.8rem 0.9rem;
  pointer-events: none;
  position: absolute;
  transform: translate(-50%, -100%);
  z-index: 20;
}

.exam-chart-tooltip::after {
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 7px solid rgb(15 23 42 / 0.96);
  content: "";
  left: 50%;
  position: absolute;
  top: 100%;
  transform: translateX(-50%);
}

.exam-chart-tooltip[hidden] {
  display: none;
}

.exam-chart-tooltip-topline {
  align-items: center;
  display: flex;
  font-size: 0.78rem;
  gap: 0.75rem;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}

.exam-chart-tooltip-value {
  background: #eef2ff;
  border-radius: 999px;
  color: #3730a3;
  padding: 0.2rem 0.5rem;
}

.exam-chart-tooltip-label {
  color: #a5b4fc;
  display: block;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.exam-chart-tooltip-publisher {
  display: block;
  font-size: 0.95rem;
  margin-top: 0.15rem;
}

.exam-chart-tooltip-hint {
  color: #94a3b8;
  display: block;
  font-size: 0.67rem;
  margin-top: 0.55rem;
}

.exam-chart-axis {
  stroke: #94a3b8;
  stroke-width: 1;
}

.exam-chart-grid-line {
  stroke: #e2e8f0;
  stroke-width: 1;
  stroke-dasharray: 4 4;
}

.exam-chart-axis-text {
  fill: #64748b;
  font-size: 11px;
}

.exam-chart-point-label {
  fill: #334155;
  font-size: 10px;
  font-weight: 700;
}

.exam-chart-empty {
  align-items: center;
  color: #64748b;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0;
}

.exam-chart-empty button {
  margin: 0;
}

.topic-checkbox:disabled {
  cursor: default;
  opacity: 0.65;
}

.topic-tracking-layout {
  align-items: start;
  display: grid;
  gap: 1rem;
  grid-template-columns: 170px minmax(0, 1fr);
}

.topic-side-nav {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.8rem;
  display: grid;
  gap: 0.5rem;
  padding: 0.65rem;
}

.topic-side-nav p {
  color: #475569;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  margin: 0;
  text-transform: uppercase;
}

.topic-table-area {
  min-width: 0;
}

.teacher-notes-label-row {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  margin-bottom: 0.35rem;
}

.teacher-notes-label-row span {
  color: #334155;
  font-size: 0.82rem;
  font-weight: 800;
}

.teacher-notes-label-row small {
  color: #64748b;
  font-size: 0.72rem;
}

.topic-option-bar {
  align-items: center;
  background: transparent;
  border: 0;
  display: grid;
  gap: 0.45rem;
  padding: 0;
  width: 100%;
}

.exam-option-bar {
  gap: 0.55rem;
}

.exam-option-bar > .topic-option {
  align-items: center;
  display: flex;
  min-height: 40px;
  margin: 0;
}

.exam-table-title-editor {
  padding: 0.3rem;
}

.exam-table-title-input {
  background: #ffffff;
  border: 1px solid #60a5fa;
  border-radius: 0.3rem;
  color: #111827;
  font-size: 0.8rem;
  font-weight: 700;
  min-height: 32px;
  padding: 0.3rem 0.45rem;
  width: 100%;
}

.exam-table-title-input:focus {
  box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.2);
  outline: none;
}

.topic-option {
  background: #dbeafe;
  border: 1px solid #bfdbfe;
  border-radius: 0.35rem;
  color: #1e3a8a;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 800;
  min-height: 34px;
  padding: 0.42rem 0.8rem;
  text-align: left;
  width: 100%;
}

.topic-option:hover {
  background: #bfdbfe;
  border-color: #93c5fd;
  color: #1d4ed8;
}

.topic-option.active {
  background: #60a5fa;
  border-color: #3b82f6;
  box-shadow: 0 6px 14px rgba(59, 130, 246, 0.18);
  color: #ffffff;
}

.topic-add-table {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #047857;
  margin-top: 0.15rem;
}

.topic-add-table:hover {
  background: #d1fae5;
  border-color: #6ee7b7;
  color: #065f46;
}

.topic-table-title-editor {
  padding: 0.3rem;
}

.topic-table-title-input {
  background: #ffffff;
  border: 1px solid #60a5fa;
  border-radius: 0.3rem;
  color: #111827;
  font-size: 0.8rem;
  font-weight: 700;
  min-height: 30px;
  padding: 0.3rem 0.45rem;
  width: 100%;
}

.topic-table-title-input:focus {
  box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.2);
  outline: none;
}

.topic-data-row {
  transition: background-color 0.15s ease;
}

.topic-data-row:hover td {
  background: #f8fafc;
}

.topic-row-drag-handle {
  background: transparent;
  border: 0;
  color: #64748b;
  cursor: grab;
  font-size: 0.75rem;
  font-weight: 900;
  line-height: 1;
  margin-right: 0.4rem;
  padding: 0.15rem;
  vertical-align: middle;
}

.topic-row-drag-handle:active {
  cursor: grabbing;
}

.topic-data-row.dragging {
  opacity: 0.45;
}

.topic-data-row.drag-over td {
  background: #dbeafe;
  border-top: 2px dashed #3b82f6;
}

.topic-context-delete {
  align-items: center;
  display: inline-flex;
  gap: 0.3rem;
  position: fixed;
  z-index: 1000;
}

.topic-context-delete-button {
  align-items: center;
  background: #dc2626;
  border: 2px solid #ffffff;
  border-radius: 999px;
  box-shadow: 0 6px 18px rgba(127, 29, 29, 0.35);
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  font-size: 1.35rem;
  font-weight: 900;
  height: 34px;
  justify-content: center;
  line-height: 1;
  padding: 0 0 2px;
  width: 34px;
}

.topic-context-delete-button:hover {
  background: #b91c1c;
  transform: scale(1.06);
}

.topic-context-edit-button {
  background: #2563eb;
  border: 2px solid #ffffff;
  border-radius: 999px;
  box-shadow: 0 6px 18px rgba(30, 64, 175, 0.25);
  color: #ffffff;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 800;
  min-height: 34px;
  padding: 0.3rem 0.65rem;
}

.topic-context-edit-button:hover {
  background: #1d4ed8;
}

.topic-title-input {
  background: #ffffff;
  border: 1px solid #60a5fa;
  border-radius: 0.35rem;
  color: #111827;
  font: inherit;
  min-height: 30px;
  padding: 0.25rem 0.4rem;
  width: calc(100% - 30px);
}

.topic-title-input:focus {
  box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.2);
  outline: none;
}

.topic-table-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  overflow: hidden;
}

.topic-table-header {
  align-items: center;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  gap: 0.65rem;
  justify-content: space-between;
  padding: 0.42rem 0.65rem;
}

.topic-table-header h3 {
  margin: 0;
}

.topic-table-header h3 {
  color: #111827;
  font-size: 0.9rem;
}

.topic-table-header span {
  background: #eef2ff;
  border-radius: 999px;
  color: #3730a3;
  flex: 0 0 auto;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.22rem 0.5rem;
}

.topic-table-actions {
  align-items: center;
  display: flex;
  gap: 0.4rem;
}

.topic-export-button {
  background: #dbeafe;
  border: 1px solid #93c5fd;
  border-radius: 0.35rem;
  color: #1e3a8a;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 900;
  min-height: 24px;
  padding: 0.2rem 0.5rem;
}

.topic-export-button:hover {
  background: #60a5fa;
  border-color: #3b82f6;
  color: #ffffff;
}

.exam-table-actions {
  align-items: center;
  display: flex;
  gap: 0.4rem;
}

.exam-filter {
  align-items: end;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  padding: 0.65rem;
}

.exam-filter label {
  color: #475569;
  display: grid;
  font-size: 0.72rem;
  font-weight: 800;
  gap: 0.2rem;
}

.exam-filter-result {
  align-self: center;
  color: #475569;
  font-size: 0.78rem;
  font-weight: 800;
}

.exam-add-row-button,
.exam-page-button {
  background: #dbeafe;
  border: 1px solid #93c5fd;
  border-radius: 0.35rem;
  color: #1e3a8a;
  cursor: pointer;
  font-weight: 900;
}

.exam-add-row-button {
  height: 26px;
  line-height: 1;
  width: 26px;
}

.exam-add-row-button:hover,
.exam-page-button:hover,
.exam-page-button.active {
  background: #60a5fa;
  border-color: #3b82f6;
  color: #ffffff;
}

.exam-pagination {
  align-items: center;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
  padding: 0.45rem 0.65rem;
}

.exam-page-button {
  min-height: 28px;
  min-width: 32px;
  padding: 0.25rem 0.55rem;
}

.topic-table-wrap {
  margin-top: 0;
}

.topic-table {
  min-width: 1040px;
}

.topic-table th,
.topic-table td {
  padding: 0.28rem 0.42rem;
}

.topic-table th {
  font-size: 0.78rem;
}

.topic-table th:first-child,
.topic-table td:first-child {
  min-width: 240px;
  width: 26%;
}

.topic-table th:not(:first-child),
.topic-table td:not(:first-child) {
  min-width: 250px;
  width: 24.666%;
}

.topic-name {
  color: #111827;
  font-size: 0.84rem;
  font-weight: 800;
  vertical-align: top;
}

.topic-resource-row td {
  background: #f8fbff;
}

.topic-resource-row .topic-name {
  color: #1e3a8a;
  vertical-align: middle;
}

.topic-resource-cell {
  position: relative;
  vertical-align: top;
}

.resource-input-list {
  display: grid;
  gap: 0.18rem;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  overflow: visible;
  padding-right: 1.65rem;
}

.resource-input-item {
  min-width: 0;
  padding-left: 1rem;
  position: relative;
}

.resource-drag-handle {
  background: transparent;
  border: 0;
  color: #64748b;
  cursor: grab;
  font-size: 0.72rem;
  font-weight: 900;
  height: 18px;
  left: 0;
  line-height: 1;
  padding: 0;
  position: absolute;
  top: 0.12rem;
  width: 14px;
}

.resource-drag-handle:active {
  cursor: grabbing;
}

.resource-input-item.dragging {
  opacity: 0.45;
}

.resource-input-item.drag-over {
  background: #dbeafe;
  border-radius: 0.35rem;
  outline: 2px dashed #3b82f6;
}

.topic-note {
  background: #f8fafc;
  border-radius: 0.35rem;
  color: #1f2937;
  font-size: 0.72rem;
  line-height: 1.1;
  min-height: 18px;
  overflow: hidden;
  padding: 0.12rem 1rem 0.12rem 0.3rem;
  resize: none;
  min-width: 0;
  width: 100%;
}

.resource-delete-button {
  align-items: center;
  background: transparent;
  border: 0;
  color: #64748b;
  cursor: pointer;
  display: inline-flex;
  font-size: 0.75rem;
  font-weight: 900;
  height: 14px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  position: absolute;
  right: 0.16rem;
  top: 0.16rem;
  width: 14px;
}

.resource-delete-button:hover {
  color: #dc2626;
}

.resource-add-button {
  align-items: center;
  background: #dbeafe;
  border: 1px solid #93c5fd;
  border-radius: 0.35rem;
  color: #1e3a8a;
  cursor: pointer;
  display: inline-flex;
  font-size: 0.85rem;
  font-weight: 900;
  height: 20px;
  justify-content: center;
  line-height: 1;
  position: absolute;
  right: 0.32rem;
  top: 0.32rem;
  width: 20px;
}

.resource-add-button:hover {
  background: #bfdbfe;
  color: #1d4ed8;
}

.topic-check-cell {
  text-align: center;
  vertical-align: middle;
}

.topic-checkbox-list {
  display: grid;
  gap: 0.18rem;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  overflow: visible;
}

.topic-checkbox-slot {
  align-items: center;
  display: inline-flex;
  justify-content: center;
  min-height: 18px;
  min-width: 0;
}

.topic-checkbox {
  accent-color: #60a5fa;
  cursor: pointer;
  height: 14px;
  width: 14px;
}

.exam-table {
  min-width: 1120px;
}

.exam-table th:first-child,
.exam-table td:first-child {
  min-width: 54px;
  width: 54px;
}

.exam-table th:not(:first-child),
.exam-table td:not(:first-child) {
  min-width: 118px;
  width: auto;
}

.exam-number {
  color: #1e3a8a;
  font-size: 0.86rem;
  font-weight: 800;
  text-align: center;
}

.deneme-input {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 0.45rem;
  color: #1f2937;
  font-size: 0.86rem;
  min-height: 34px;
  padding: 0.35rem 0.5rem;
  width: 100%;
}

.deneme-input.calculated-total {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1e3a8a;
  font-weight: 800;
}

.exam-subject-inputs {
  display: grid;
  gap: 0.2rem;
  grid-template-columns: repeat(3, minmax(42px, 1fr));
}

.exam-subject-inputs label {
  display: grid;
  gap: 0.15rem;
}

.exam-subject-inputs label > span {
  color: #64748b;
  font-size: 0.62rem;
  font-weight: 900;
  text-align: center;
}

.exam-subject-inputs .deneme-input {
  min-height: 30px;
  padding: 0.25rem 0.3rem;
  text-align: center;
}

.exam-subject-net {
  color: #475569;
  font-size: 0.68rem;
  margin-top: 0.25rem;
  text-align: right;
}

.exam-subject-net strong {
  color: #1e3a8a;
}

.deneme-input:focus,
.topic-note:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.18);
  outline: none;
}

.homework-card p {
  margin: 0;
  white-space: pre-wrap;
}

.all-records-page {
  display: grid;
  gap: 1.25rem;
}

.all-records-button {
  margin: 0;
}

.all-homeworks-button {
  align-items: center;
  background: linear-gradient(135deg, #4f46e5, #2563eb);
  border: 1px solid #4338ca;
  border-radius: 0.7rem;
  box-shadow: 0 5px 14px rgba(79, 70, 229, 0.22);
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  font-size: 0.82rem;
  font-weight: 800;
  gap: 0.45rem;
  min-height: 38px;
  padding: 0.5rem 0.8rem;
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}

.all-homeworks-button span:first-child {
  align-items: center;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  display: inline-flex;
  height: 22px;
  justify-content: center;
  width: 22px;
}

.all-homeworks-button:hover {
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.32);
  transform: translateY(-1px);
}

.all-homeworks-button:focus-visible {
  outline: 3px solid rgba(96, 165, 250, 0.4);
  outline-offset: 2px;
}

.lecture-page-heading {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.lecture-page-heading h2 {
  margin: 0;
}

.homework-student-tag {
  color: #4338ca;
  font-size: 0.85rem;
}

.homework-card__footer {
  align-items: center;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  margin-top: 0.9rem;
}

.homework-status {
  color: #64748b;
  font-weight: 700;
}

.small {
  border-radius: 0.8rem;
  padding: 0.7rem 0.9rem;
}

@media (max-width: 720px) {

  .site-header,
  .student-row,
  .selected-student-header {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .inline-form {
    grid-template-columns: 1fr;
  }

  .menu-list {
    position: static;
    margin-top: 0.5rem;
  }

  .progress-grid {
    grid-template-columns: 1fr;
  }

  .container {
    padding: 1rem;
  }

  .topic-heading-row,
  .topic-tracking-layout {
    grid-template-columns: 1fr;
  }

  .topic-option-bar {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }

  .topic-option {
    text-align: center;
  }
}
