:root {
  --brand: #214f7a;
  --brand-dark: #173752;
  --accent: #2f8f71;
  --ink: #17202a;
  --muted: #667085;
  --line: #d9e2ec;
  --surface: #ffffff;
  --page: #f5f7fb;
  --warning-soft: #fff3cd;
}

* {
  box-sizing: border-box;
}

body {
  background: var(--page);
  color: var(--ink);
  font-size: 16px;
  letter-spacing: 0;
}

a {
  color: var(--brand);
}

.app-navbar {
  background: linear-gradient(90deg, var(--brand-dark), var(--brand));
  box-shadow: 0 4px 18px rgba(23, 55, 82, 0.18);
}

.muted-user {
  color: rgba(255, 255, 255, 0.78) !important;
}

.app-shell {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  min-height: calc(100vh - 56px);
}

.sidebar {
  background: #ffffff;
  border-right: 1px solid var(--line);
  height: calc(100vh - 56px);
  overflow-y: auto;
  padding: 1.25rem;
  position: sticky;
  top: 56px;
}

.nav-search {
  max-width: 360px;
  width: 100%;
}

.sidebar-title {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
}

.sidebar-title.mt-3 {
  margin-top: 1rem !important;
}

.side-link {
  border-radius: 8px;
  color: #344054;
  font-weight: 600;
  padding: 0.7rem 0.8rem;
  text-decoration: none;
}

.side-link:hover,
.side-link.active {
  background: #e8f1f8;
  color: var(--brand-dark);
}

.content {
  min-width: 0;
  padding: 1.5rem;
}

.flash-stack {
  margin-bottom: 1rem;
}

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

.page-heading h1,
.section-title h2 {
  font-size: 1.75rem;
  font-weight: 800;
  margin: 0;
}

.eyebrow {
  color: var(--accent);
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.content-card,
.info-card,
.stat-card,
.auth-card,
.home-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(16, 24, 40, 0.06);
}

.content-card,
.info-card,
.home-panel {
  padding: 1.25rem;
}

.home-panel {
  overflow: hidden;
  padding: 2rem;
}

.info-card h2 {
  font-size: 1.15rem;
  font-weight: 800;
}

.info-card p {
  color: var(--muted);
  margin: 0;
}

.stat-card {
  padding: 1rem;
}

.stat-value {
  color: var(--brand-dark);
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
}

.stat-label {
  color: var(--muted);
  font-weight: 700;
  margin-top: 0.45rem;
}

.catalog-preview {
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 260px;
  padding: 1rem;
}

.preview-bar {
  background: var(--brand);
  border-radius: 8px;
  height: 42px;
  margin-bottom: 1rem;
}

.preview-row {
  background: #dbe7f3;
  border-radius: 8px;
  height: 22px;
  margin-bottom: 0.7rem;
}

.preview-row.strong {
  background: #9cc2df;
}

.preview-row.short {
  width: 68%;
}

.preview-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 1.25rem;
}

.preview-grid span {
  background: #dff2e8;
  border: 1px solid #b7dfcc;
  border-radius: 8px;
  height: 82px;
}

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

.auth-card {
  max-width: 430px;
  padding: 1.5rem;
  width: 100%;
}

.demo-box {
  background: #f6f8fb;
  border: 1px dashed #b7c6d7;
  border-radius: 8px;
  color: #475467;
  padding: 0.9rem;
}

.table {
  margin-bottom: 0;
}

.table thead th {
  color: #475467;
  font-size: 0.82rem;
  text-transform: uppercase;
}

.grade-pill {
  align-items: center;
  background: #e6f4ef;
  border: 1px solid #b8dfcf;
  border-radius: 999px;
  color: #146a4a;
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
  min-width: 2.35rem;
  padding: 0.2rem 0.55rem;
}

.stack-list {
  display: grid;
  gap: 0.85rem;
}

.stack-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
}

.stack-item h3,
.stack-item h4 {
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 0.35rem;
}

.mini-item {
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 0.25rem;
  padding: 0.8rem;
}

.mini-item span {
  color: var(--muted);
  font-size: 0.92rem;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.quick-actions a {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--brand-dark);
  font-weight: 800;
  padding: 0.65rem 0.85rem;
  text-decoration: none;
}

.quick-actions a:hover {
  background: #e8f1f8;
}

.lesson-actions {
  align-items: flex-end;
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.meet-badge {
  background: #e6f4ef;
  border: 1px solid #b8dfcf;
  color: #146a4a;
}

.status-scheduled {
  background: #eef4ff;
  color: #294b8e;
}

.status-live {
  background: #e6f4ef;
  color: #146a4a;
}

.status-ended {
  background: #f2f4f7;
  color: #475467;
}

.status-cancelled {
  background: #fff0f0;
  color: #a40000;
}

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

.room-header h1 {
  font-size: 1.8rem;
  font-weight: 800;
  margin: 0;
}

.room-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr) 360px;
}

.meet-stage {
  align-items: center;
  background: radial-gradient(circle at top, #2f8f71 0, #173752 46%, #0d1d2c 100%);
  border-radius: 8px;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 420px;
  padding: 2rem;
  text-align: center;
}

.meet-logo {
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 8px;
  font-size: 2rem;
  font-weight: 900;
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
}

.room-side {
  display: grid;
  gap: 1rem;
}

.chat-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 0.65rem;
  max-height: 360px;
  overflow-y: auto;
  padding: 0.8rem;
}

.chat-message {
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.7rem;
}

.chat-message span {
  color: var(--muted);
  display: block;
  font-size: 0.82rem;
}

.chat-message p {
  margin: 0.35rem 0 0;
  white-space: pre-wrap;
}

.unread-item {
  border-color: #9cc2df;
  box-shadow: 0 0 0 3px rgba(33, 79, 122, 0.08);
}

.w-fit {
  width: fit-content;
}

.priority-badge {
  border: 1px solid transparent;
}

.priority-badge.priority-normal {
  background: #eef4ff;
  border-color: #c7d7fe;
  color: #294b8e;
}

.priority-badge.priority-important {
  background: #fff7e6;
  border-color: #fedc8b;
  color: #9a5b00;
}

.priority-badge.priority-urgent {
  background: #fff0f0;
  border-color: #ffb4b4;
  color: #a40000;
}

.message-meta {
  color: var(--muted);
  display: grid;
  gap: 0.35rem;
}

.message-body {
  font-size: 1.05rem;
  white-space: pre-wrap;
}

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

.timeline-item {
  border: 1px solid var(--line);
  border-left: 5px solid var(--brand);
  border-radius: 8px;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 190px minmax(0, 1fr);
  padding: 1rem;
}

.timeline-item.priority-important {
  border-left-color: #d08a00;
}

.timeline-item.priority-urgent {
  border-left-color: #c1121f;
}

.timeline-date {
  color: var(--brand-dark);
  font-weight: 800;
}

.timeline-content h2 {
  font-size: 1.05rem;
  font-weight: 800;
  margin: 0.35rem 0;
}

.timeline-content p {
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.date-chip {
  background: #eef4ff;
  border: 1px solid #c7d7fe;
  border-radius: 8px;
  color: #294b8e;
  flex: 0 0 auto;
  font-weight: 700;
  height: fit-content;
  padding: 0.35rem 0.6rem;
  text-align: right;
}

.empty-state {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 2rem auto;
  max-width: 640px;
  padding: 2rem;
  text-align: center;
}

.empty-state h1,
.empty-state h2 {
  font-weight: 800;
}

.form-narrow {
  max-width: 620px;
}

.child-section {
  margin-bottom: 2rem;
}

.section-title {
  margin-bottom: 1rem;
}

.section-title p {
  color: var(--muted);
  margin: 0.2rem 0 0;
}

.btn {
  border-radius: 8px;
  font-weight: 700;
}

.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
}

.btn-primary:hover {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
}

.form-control,
.form-select {
  border-radius: 8px;
}

@media (max-width: 991.98px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-bottom: 1px solid var(--line);
    border-right: 0;
    height: auto;
    position: static;
  }

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

  .content {
    padding: 1rem;
  }

  .page-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .room-header {
    align-items: flex-start;
    flex-direction: column;
  }

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

@media (max-width: 575.98px) {
  .home-panel {
    padding: 1.25rem;
  }

  .sidebar .nav {
    grid-template-columns: 1fr;
  }

  .stat-value {
    font-size: 1.6rem;
  }

  .content-card,
  .info-card {
    padding: 1rem;
  }

  .date-chip {
    text-align: left;
  }

  .lesson-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .lesson-actions .btn,
  .lesson-actions form,
  .lesson-actions form .btn {
    width: 100%;
  }

  .timeline-item {
    grid-template-columns: 1fr;
  }
}
