:root {
  --blue: #1e3a8a;
  --blue-2: #2563eb;
  --ink: #172033;
  --muted: #6b7280;
  --line: #e5e7eb;
  --paper: #ffffff;
  --bg: #f6f8fc;
  --yellow: #facc15;
  --red: #ef4444;
  --green: #22c55e;
  --shadow: 0 18px 55px rgba(20, 32, 60, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
select,
textarea {
  font: inherit;
}

button {
  text-align: left;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 280px;
  padding: 24px;
  color: #fff;
  background: var(--blue);
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.brand {
  width: 100%;
  border: 0;
  color: inherit;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: var(--blue);
  background: var(--yellow);
  font-weight: 900;
}

.brand strong,
.brand span,
.brand small {
  display: block;
}

.brand small,
.profile-mini p {
  color: rgba(255, 255, 255, 0.74);
}

.nav {
  display: grid;
  gap: 8px;
}

.nav button {
  border: 0;
  color: rgba(255, 255, 255, 0.82);
  padding: 12px 14px;
  border-radius: 16px;
  background: transparent;
  font-weight: 700;
  cursor: pointer;
}

.nav button:hover,
.nav button.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
}

.profile-mini {
  margin-top: auto;
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.12);
}

.profile-mini h2,
.profile-mini p {
  margin: 0;
}

.profile-mini h2 {
  margin: 8px 0 4px;
  font-size: 1.2rem;
}

.skill-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  font-size: 0.9rem;
}

.meter {
  height: 8px;
  margin-top: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.22);
}

.meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--yellow);
}

.app-shell {
  margin-left: 280px;
  padding: 28px;
}

.page {
  display: none;
}

.page.active {
  display: block;
}

.topbar,
.section-heading,
.status-grid,
.split-layout,
.filters {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar,
.section-heading {
  justify-content: space-between;
}

.topbar h1,
.section-heading h2 {
  margin: 0;
}

.topbar h1 {
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--blue-2);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.primary-action {
  min-height: 44px;
  border: 0;
  border-radius: 14px;
  padding: 0 18px;
  color: #12204a;
  background: var(--yellow);
  font-weight: 900;
  cursor: pointer;
  text-align: center;
}

.primary-action:hover {
  filter: brightness(0.96);
}

.full {
  width: 100%;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 26px 0;
}

.summary-card,
.planner-section,
.tasks-panel,
.assistant-panel,
.home-tile {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.summary-card {
  padding: 20px;
}

.summary-card span,
.summary-card p {
  color: var(--muted);
}

.summary-card strong {
  display: block;
  margin: 8px 0;
  color: var(--blue);
  font-size: 2.3rem;
}

.summary-card p {
  margin: 0;
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.home-tile {
  min-height: 190px;
  padding: 22px;
  color: var(--ink);
  cursor: pointer;
}

.home-tile:hover {
  border-color: rgba(37, 99, 235, 0.4);
  transform: translateY(-2px);
}

.home-tile span,
.home-tile small {
  display: block;
  color: var(--muted);
}

.home-tile span {
  margin-bottom: 18px;
  color: var(--blue-2);
  font-weight: 900;
  text-transform: uppercase;
}

.home-tile strong {
  display: block;
  margin-bottom: 10px;
  font-size: 1.25rem;
}

.summary-card.urgent {
  border-color: rgba(239, 68, 68, 0.3);
}

.summary-card.warning.overloaded {
  border-color: rgba(239, 68, 68, 0.45);
  background: #fff7ed;
}

.planner-section,
.tasks-panel,
.assistant-panel {
  margin-top: 26px;
  padding: 22px;
}

.wide-panel {
  max-width: 780px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}

.high,
.task-card.high {
  --priority: var(--red);
}

.medium,
.task-card.medium {
  --priority: var(--yellow);
}

.low,
.task-card.low {
  --priority: var(--green);
}

.dot.high {
  background: var(--red);
}

.dot.medium {
  background: var(--yellow);
}

.dot.low {
  background: var(--green);
}

.week-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(155px, 1fr));
  gap: 12px;
  margin-top: 18px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.day-column {
  min-height: 420px;
  padding: 12px;
  border: 1px dashed #cbd5e1;
  border-radius: 20px;
  background: #f8fafc;
}

.day-column.over {
  border-color: var(--red);
  background: #fff1f2;
}

.day-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  font-weight: 900;
}

.day-head span {
  color: var(--muted);
  font-weight: 700;
}

.task-card {
  margin-bottom: 10px;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid var(--line);
  border-left: 6px solid var(--priority);
  background: #fff;
  cursor: grab;
}

.task-card:hover {
  border-color: rgba(37, 99, 235, 0.35);
}

.task-card:active {
  cursor: grabbing;
}

.task-card h3 {
  margin: 0 0 6px;
  font-size: 0.98rem;
}

.task-card p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.86rem;
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.task-meta span,
.status-select {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
  color: #374151;
  background: #fff;
  font-size: 0.78rem;
}

.status-select {
  width: 100%;
  margin-top: 10px;
  border-radius: 12px;
}

.card-link {
  width: 100%;
  min-height: 34px;
  margin-top: 8px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: var(--blue);
  font-size: 0.82rem;
  font-weight: 800;
  text-align: center;
  cursor: pointer;
}

.split-layout {
  align-items: stretch;
  margin-top: 26px;
}

.tasks-panel {
  flex: 1.3;
}

.assistant-panel {
  flex: 0.9;
}

.compact {
  align-items: flex-start;
}

.filters {
  margin: 16px 0;
}

.filters select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: #fff;
}

.filters select {
  min-height: 42px;
  padding: 0 12px;
}

.task-list {
  display: grid;
  gap: 12px;
}

.teacher-task {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #fff;
}

.teacher-task h3,
.teacher-task p {
  margin: 0;
}

.teacher-task p {
  color: var(--muted);
  font-size: 0.9rem;
}

.teacher-task.highlighted {
  border-color: rgba(250, 204, 21, 0.95);
  box-shadow: 0 0 0 4px rgba(250, 204, 21, 0.22), var(--shadow);
}

.task-actions {
  display: flex;
  flex-wrap: wrap;
  align-self: center;
  gap: 8px;
}

.teacher-task button,
.submission-item button {
  align-self: center;
  min-height: 38px;
  border: 0;
  border-radius: 12px;
  padding: 0 12px;
  color: #fff;
  background: var(--blue);
  font-weight: 800;
  cursor: pointer;
  text-align: center;
}

.teacher-task button[data-action="submit"],
.submission-item button[data-submit-for] {
  color: #12204a;
  background: var(--yellow);
}

.submission-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 12px;
  margin-top: 14px;
}

.submission-panel > div,
.feedback-box {
  padding: 12px;
  border-radius: 16px;
  background: #f8fafc;
  border: 1px solid var(--line);
}

.submission-panel strong {
  display: block;
  margin: 6px 0;
  color: var(--blue);
}

.tag {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  padding: 5px 9px;
  color: #1e3a8a;
  background: #dbeafe;
  font-size: 0.76rem;
  font-weight: 900;
}

.feedback-box p {
  margin-top: 8px;
}

.submission-list {
  display: grid;
  gap: 14px;
}

.submission-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 0.9fr);
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
}

.submission-item h3,
.submission-item p {
  margin: 0;
}

.submission-item label {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-weight: 900;
}

.submission-item textarea {
  min-height: 92px;
  font-weight: 400;
}

.input-label {
  display: block;
  margin: 14px 0 8px;
  font-weight: 900;
}

textarea {
  resize: vertical;
  min-height: 138px;
  padding: 13px;
}

.hint-box {
  margin-top: 14px;
  padding: 16px;
  border-radius: 18px;
  background: #eff6ff;
  color: #1e3a8a;
}

.hint-box ul {
  margin: 0;
  padding-left: 20px;
}

.timetable {
  display: grid;
  grid-template-columns: 90px repeat(5, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 18px;
  overflow-x: auto;
}

.time-slot,
.lesson-card,
.day-label {
  min-height: 74px;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #fff;
}

.day-label,
.time-slot {
  display: grid;
  place-items: center;
  color: var(--blue);
  font-weight: 900;
  background: #eff6ff;
}

.lesson-card {
  border-left: 6px solid var(--blue-2);
}

.lesson-card strong,
.lesson-card span {
  display: block;
}

.lesson-card span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.85rem;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 26px;
}

@media (max-width: 1040px) {
  .sidebar {
    position: static;
    width: auto;
    border-radius: 0 0 24px 24px;
  }

  .app-shell {
    margin-left: 0;
  }

  .nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .split-layout {
    flex-direction: column;
  }

  .home-grid,
  .profile-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .sidebar,
  .app-shell {
    padding: 18px;
  }

  .topbar,
  .section-heading,
  .filters {
    align-items: stretch;
    flex-direction: column;
  }

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

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

  .home-grid,
  .profile-grid {
    grid-template-columns: 1fr;
  }

  .teacher-task {
    grid-template-columns: 1fr;
  }

  .submission-panel,
  .submission-item {
    grid-template-columns: 1fr;
  }
}
