:root {
  color-scheme: light;
  --brand-navy: #14213a;
  --brand-navy-2: #1e2f52;
  --brand-cyan: #18b8d8;
  --brand-cyan-strong: #0c8fac;
  --brand-cyan-soft: #e6f8fc;
  --brand-yellow: #ffd04d;
  --brand-yellow-soft: #fff6d9;
  --accent-green: #2fbd74;
  --accent-green-soft: #e8f8ef;
  --accent-coral: #ff735f;
  --accent-coral-soft: #fff0ed;
  --accent-purple: #8368e8;
  --accent-purple-soft: #f0edff;
  --accent-orange: #f59e0b;
  --accent-orange-soft: #fff4dc;
  --accent-blue: #3f8cff;
  --accent-blue-soft: #eaf3ff;
  --page-bg: #eaf3fb;
  --page-bg-2: #f7fbff;
  --surface: #ffffff;
  --surface-soft: #f8fbff;
  --text: #182033;
  --muted: #607086;
  --line: #e2eaf3;
  --panel-line: rgba(88, 122, 171, 0.24);
  --shadow-panel: 0 24px 60px rgba(41, 69, 112, 0.14);
  --shadow-card: 0 14px 34px rgba(41, 69, 112, 0.1);
  --shadow-hover: 0 28px 72px rgba(41, 69, 112, 0.17);
  --radius-panel: 28px;
  --radius-card: 22px;
  --radius-control: 16px;
  --sidebar-width: 286px;
  --content-width: 1180px;
  --space-page: clamp(16px, 3vw, 32px);
  font-family: "Nunito", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 0;
}

body {
  min-width: 0;
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(180deg, var(--page-bg) 0%, #f0f7ff 42%, var(--page-bg-2) 100%);
  color: var(--text);
  letter-spacing: 0;
}

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

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.ui-icon {
  width: 1.15em;
  height: 1.15em;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

h1,
h2,
h3,
p {
  margin-top: 0;
  overflow-wrap: anywhere;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(2rem, 5vw, 3.35rem);
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 6px;
  font-size: clamp(1.22rem, 2vw, 1.55rem);
  line-height: 1.12;
}

h3 {
  margin-bottom: 8px;
  font-size: 1.05rem;
  line-height: 1.18;
}

p {
  line-height: 1.55;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  transform: translateY(-150%);
  border-radius: 999px;
  background: var(--brand-navy);
  color: #fff;
  padding: 10px 14px;
  font-weight: 900;
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  padding: 22px 18px;
  background:
    linear-gradient(180deg, #14213a 0%, #1b2d50 74%, #263b64 100%);
  color: #fff;
  box-shadow: 18px 0 44px rgba(20, 33, 58, 0.18);
}

.sidebar::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 28px 28px;
  content: "";
}

.sidebar > * {
  position: relative;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 22px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.08);
}

.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--brand-yellow), #fff3ac 48%, var(--brand-cyan));
  color: var(--brand-navy);
  box-shadow: 0 12px 30px rgba(24, 184, 216, 0.24);
  font-weight: 1000;
}

.brand-mark .ui-icon {
  width: 25px;
  height: 25px;
  stroke-width: 2.2;
}

.brand-title {
  margin: 0;
  font-weight: 1000;
  line-height: 1.12;
}

.brand-subtitle {
  margin: 3px 0 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.82rem;
  font-weight: 800;
}

.nav-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-link,
.mobile-nav-link {
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 48px;
  border-radius: 16px;
  font-weight: 900;
  transition:
    background 160ms ease,
    color 160ms ease,
    border-color 160ms ease,
    transform 160ms ease;
}

.nav-link {
  border: 1px solid transparent;
  padding: 0 12px;
  color: rgba(255, 255, 255, 0.76);
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
}

.nav-link[aria-current="page"] {
  border-color: rgba(255, 255, 255, 0.16);
  background: #fff;
  color: var(--brand-navy);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
}

.nav-icon {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 1000;
}

.nav-icon .ui-icon {
  width: 18px;
  height: 18px;
}

.nav-link[aria-current="page"] .nav-icon {
  background: var(--brand-cyan);
  color: #fff;
}

.teacher-profile {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: auto;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 22px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.1);
}

.avatar {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 16px;
  background: var(--brand-yellow);
  color: var(--brand-navy);
  font-weight: 1000;
}

.avatar .ui-icon {
  width: 22px;
  height: 22px;
  stroke-width: 2.2;
}

.profile-name {
  margin: 0;
  font-weight: 1000;
}

.profile-role {
  margin: 3px 0 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.82rem;
  font-weight: 800;
}

.main-area {
  min-width: 0;
  padding: 28px var(--space-page) 44px;
}

.page {
  width: min(100%, var(--content-width));
  margin: 0 auto;
}

.page-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  border: 1px solid var(--panel-line);
  border-radius: var(--radius-panel);
  padding: clamp(20px, 3vw, 28px);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(247, 251, 255, 0.94)),
    var(--surface);
  box-shadow: var(--shadow-panel);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--brand-cyan-strong);
  font-size: 0.76rem;
  font-weight: 1000;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.header-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
}

.page-header p {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
  font-weight: 760;
}

.header-meta {
  display: inline-flex;
  width: fit-content;
  min-height: 34px;
  align-items: center;
  margin: 6px 0 10px;
  border-radius: 999px;
  padding: 0 13px;
  background: var(--brand-yellow-soft);
  color: #6f5500;
  font-size: 0.92rem;
  font-weight: 1000;
}

.back-link,
.button,
.clear-search,
.filter-chip {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 16px;
  font-weight: 1000;
  text-decoration: none;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.button.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--brand-cyan), var(--accent-blue));
  box-shadow: 0 12px 28px rgba(24, 184, 216, 0.24);
}

.button.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 38px rgba(24, 184, 216, 0.28);
}

.button.secondary,
.back-link {
  border-color: rgba(63, 140, 255, 0.16);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  box-shadow: 0 8px 20px rgba(31, 47, 79, 0.08);
}

.button.secondary:hover,
.back-link:hover,
.filter-chip:hover {
  border-color: rgba(24, 184, 216, 0.38);
  transform: translateY(-1px);
}

.button.disabled {
  cursor: not-allowed;
  border-color: var(--line);
  background: #f2f6fa;
  color: #7d8896;
}

.nav-link:focus-visible,
.mobile-nav-link:focus-visible,
.button:focus-visible,
.card-link:focus-visible,
.block-card:focus-visible,
.resource-chip:focus-visible,
.search-input:focus-visible,
.back-link:focus-visible,
.filter-chip:focus-visible,
.clear-search:focus-visible {
  outline: 3px solid rgba(24, 184, 216, 0.32);
  outline-offset: 3px;
}

.section {
  margin-top: 22px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.section-heading p {
  margin: 0;
  color: var(--muted);
  font-weight: 780;
}

.welcome-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(220px, 0.6fr);
  gap: 22px;
  align-items: center;
  overflow: hidden;
  border: 1px solid rgba(24, 184, 216, 0.2);
  border-radius: var(--radius-panel);
  padding: clamp(20px, 3vw, 28px);
  background:
    linear-gradient(135deg, rgba(232, 248, 239, 0.88), rgba(234, 243, 255, 0.94) 44%, rgba(255, 246, 217, 0.9)),
    #fff;
  box-shadow: var(--shadow-panel);
}

.welcome-panel h2 {
  max-width: 720px;
  font-size: clamp(1.55rem, 3vw, 2.25rem);
}

.welcome-panel p:not(.eyebrow) {
  max-width: 680px;
  color: var(--muted);
  font-weight: 800;
}

.welcome-art {
  display: grid;
  grid-template-columns: repeat(2, 78px);
  gap: 12px;
  justify-content: end;
}

.welcome-art span {
  display: grid;
  height: 78px;
  place-items: center;
  border-radius: 24px;
  color: var(--brand-navy);
  font-weight: 1000;
  box-shadow: var(--shadow-card);
}

.welcome-art span:nth-child(1) {
  background: var(--brand-yellow);
}

.welcome-art span:nth-child(2) {
  background: var(--accent-purple-soft);
  color: #4a38a8;
}

.welcome-art span:nth-child(3) {
  grid-column: 1 / -1;
  background: var(--brand-cyan);
  color: #fff;
}

.welcome-art .ui-icon {
  width: 28px;
  height: 28px;
  stroke-width: 2.2;
}

.level-grid,
.resource-grid,
.block-grid,
.module-grid,
.tool-grid {
  display: grid;
  gap: 16px;
}

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

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

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

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

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

.level-card,
.resource-card,
.block-card,
.module-card,
.tool-card,
.empty-state,
.search-panel,
.module-controls {
  border: 1px solid var(--panel-line);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.card-link,
.block-card {
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.card-link:hover,
.block-card:hover {
  border-color: rgba(24, 184, 216, 0.42);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.level-card {
  position: relative;
  display: grid;
  min-height: 270px;
  overflow: hidden;
  padding: 20px;
}

.level-card-accent,
.block-accent {
  position: absolute;
  inset: 0 0 auto;
  height: 6px;
  background: var(--brand-cyan);
}

.level-card::after {
  position: absolute;
  right: -34px;
  bottom: -34px;
  width: 126px;
  height: 126px;
  border: 20px solid rgba(24, 184, 216, 0.12);
  border-radius: 32px;
  transform: rotate(18deg);
  content: "";
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.level-icon,
.resource-icon,
.block-icon,
.tool-icon,
.empty-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--brand-navy);
  font-weight: 1000;
}

.level-icon .ui-icon,
.resource-icon .ui-icon,
.block-icon .ui-icon,
.tool-icon .ui-icon,
.empty-icon .ui-icon {
  width: 24px;
  height: 24px;
  stroke-width: 2.2;
}

.level-icon {
  width: 60px;
  height: 60px;
  border-radius: 22px;
  background: var(--accent-blue-soft);
  font-size: 1rem;
}

.level-cebollitas {
  --level-main: #ffd04d;
  --level-soft: #fff6d9;
  --level-text: #6f5500;
}

.level-patatas {
  --level-main: #f59e0b;
  --level-soft: #fff4dc;
  --level-text: #7a4300;
}

.level-tortillas {
  --level-main: #18b8d8;
  --level-soft: #e8f6ff;
  --level-text: #0b6678;
}

.level-flow {
  --level-main: #8368e8;
  --level-soft: #f0edff;
  --level-text: #4531a4;
}

.level-card-accent,
.level-card .level-icon {
  background: var(--level-main, var(--brand-cyan));
  color: var(--brand-navy);
}

.level-card .status-badge {
  background: var(--level-soft, var(--accent-blue-soft));
  color: var(--level-text, var(--brand-cyan-strong));
}

.card-body {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: end;
  gap: 8px;
  min-width: 0;
  margin-top: 24px;
}

.card-body p {
  margin-bottom: 0;
  color: var(--muted);
  font-weight: 760;
}

.card-meta {
  color: var(--level-text, var(--brand-cyan-strong));
  font-size: 0.9rem;
  font-weight: 1000;
}

.status-badge,
.block-number,
.block-stats span,
.module-number,
.review-badge,
.tool-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 0.76rem;
  font-weight: 1000;
  white-space: nowrap;
}

.status-badge {
  background: var(--accent-green-soft);
  color: #16764a;
}

.status-badge.soon {
  background: #eef2f7;
  color: #6b7685;
}

.disabled-card {
  color: #7c8796;
}

.disabled-card::before {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.36);
  content: "";
}

.resource-card,
.tool-card {
  display: grid;
  gap: 14px;
  min-height: 178px;
  padding: 20px;
}

.resource-card p,
.tool-card p,
.block-card p,
.module-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-weight: 760;
}

.resource-icon,
.tool-icon {
  width: 48px;
  height: 48px;
  border-radius: 18px;
  background: var(--accent-blue-soft);
  color: #2367c7;
}

.resource-card:nth-child(2) .resource-icon,
.tool-card:nth-child(2n) .tool-icon {
  background: var(--brand-yellow-soft);
  color: #8b6400;
}

.resource-card:nth-child(3) .resource-icon,
.tool-card:nth-child(3n) .tool-icon {
  background: var(--accent-green-soft);
  color: #16764a;
}

.block-card {
  position: relative;
  display: grid;
  gap: 12px;
  min-height: 245px;
  overflow: hidden;
  padding: 18px;
  color: var(--text);
}

.block-card:nth-child(6n + 1) {
  --block-main: var(--brand-yellow);
  --block-soft: var(--brand-yellow-soft);
  --block-text: #6f5500;
}

.block-card:nth-child(6n + 2) {
  --block-main: var(--accent-green);
  --block-soft: var(--accent-green-soft);
  --block-text: #16764a;
}

.block-card:nth-child(6n + 3) {
  --block-main: var(--accent-coral);
  --block-soft: var(--accent-coral-soft);
  --block-text: #a73c2f;
}

.block-card:nth-child(6n + 4) {
  --block-main: var(--brand-cyan);
  --block-soft: var(--accent-blue-soft);
  --block-text: #0b6678;
}

.block-card:nth-child(6n + 5) {
  --block-main: var(--accent-purple);
  --block-soft: var(--accent-purple-soft);
  --block-text: #4531a4;
}

.block-card:nth-child(6n + 6) {
  --block-main: var(--accent-orange);
  --block-soft: var(--accent-orange-soft);
  --block-text: #7a4300;
}

.block-accent {
  background: var(--block-main);
}

.block-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.block-icon {
  width: 48px;
  height: 48px;
  border-radius: 18px;
  background: var(--block-soft);
  color: var(--block-text);
}

.block-number {
  background: var(--block-soft);
  color: var(--block-text);
}

.block-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.block-stats span {
  background: #f3f7fb;
  color: var(--muted);
}

.block-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  color: var(--block-text);
  font-weight: 1000;
}

.arrow {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 14px;
  background: var(--block-soft);
  color: var(--block-text);
  font-weight: 1000;
}

.module-controls {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 14px;
  align-items: end;
  margin-bottom: 16px;
  padding: 16px;
}

.module-search,
.search-label {
  display: grid;
  gap: 7px;
  color: #394553;
  font-size: 0.9rem;
  font-weight: 900;
}

.search-panel {
  margin-bottom: 18px;
  padding: 16px;
}

.search-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: #fff;
  padding: 0 12px;
}

.search-symbol {
  color: var(--muted);
  font-weight: 1000;
}

.search-symbol .ui-icon {
  width: 18px;
  height: 18px;
}

.search-input {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
}

.search-wrap:focus-within {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 4px rgba(63, 140, 255, 0.14);
}

.clear-search {
  min-height: 34px;
  padding: 0 10px;
  background: var(--accent-blue-soft);
  color: #2367c7;
  font-size: 0.8rem;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.filter-chip {
  min-height: 38px;
  border-color: var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 0.9rem;
}

.filter-chip.is-active {
  border-color: transparent;
  background: linear-gradient(135deg, var(--brand-cyan), var(--accent-blue));
  color: #fff;
  box-shadow: 0 10px 22px rgba(24, 184, 216, 0.2);
}

.module-card {
  display: grid;
  gap: 12px;
  min-height: 285px;
  padding: 18px;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.module-card:hover {
  border-color: rgba(24, 184, 216, 0.38);
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}

.module-card.is-review {
  border-color: rgba(255, 208, 77, 0.7);
  background:
    linear-gradient(180deg, rgba(255, 246, 217, 0.58), rgba(255, 255, 255, 0.96) 34%),
    #fff;
}

.module-top {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.module-number {
  background: var(--accent-blue-soft);
  color: #2367c7;
}

.review-badge {
  background: var(--brand-yellow-soft);
  color: #7a5900;
}

.module-card h3 {
  margin-bottom: 0;
  font-size: 1.08rem;
}

.module-card p {
  display: -webkit-box;
  min-height: 3.1em;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.resource-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.resource-chip {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  min-height: 30px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 0.78rem;
  font-weight: 1000;
  text-decoration: none;
}

.chip-icon {
  width: 15px;
  height: 15px;
  stroke-width: 2.4;
}

.resource-chip.linked {
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.resource-chip.linked:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(41, 69, 112, 0.12);
}

.resource-video {
  background: var(--accent-coral-soft);
  color: #a73c2f;
}

.resource-presentacion {
  background: var(--accent-purple-soft);
  color: #4531a4;
}

.resource-guia {
  background: var(--accent-blue-soft);
  color: #2367c7;
}

.resource-wordwall {
  background: var(--accent-green-soft);
  color: #16764a;
}

.resource-baamboozle {
  background: var(--accent-orange-soft);
  color: #7a4300;
}

.resource-actividad {
  background: var(--brand-cyan-soft, #e6f8fc);
  color: #0b6678;
}

.resource-chip.reference {
  border-color: var(--line);
  background: #f6f8fb;
  color: var(--muted);
}

.resource-chip.missing {
  border-color: var(--line);
  background: #f8fafc;
  color: #97a2b1;
}

.module-footer {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
}

.external-button {
  min-height: 38px;
}

.empty-state {
  display: grid;
  gap: 12px;
  justify-items: center;
  padding: 42px 22px;
  text-align: center;
}

.module-grid > .empty-state {
  grid-column: 1 / -1;
}

.empty-icon {
  width: 68px;
  height: 68px;
  border-radius: 24px;
  background: linear-gradient(135deg, var(--brand-yellow), var(--brand-cyan));
  color: var(--brand-navy);
  font-size: 1rem;
}

.empty-state h2 {
  margin-bottom: 0;
}

.empty-state p {
  max-width: 560px;
  margin-bottom: 0;
  color: var(--muted);
  font-weight: 780;
}

.tool-card {
  position: relative;
  overflow: hidden;
}

.tool-card::before {
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, var(--brand-cyan), var(--brand-yellow));
  content: "";
}

.tool-status {
  justify-self: start;
  background: #f3f7fb;
  color: var(--muted);
}

.mobile-nav {
  position: fixed;
  right: 12px;
  bottom: 12px;
  left: 12px;
  z-index: 50;
  display: none;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  border: 1px solid var(--panel-line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.94);
  padding: 8px;
  box-shadow: 0 18px 44px rgba(20, 33, 58, 0.18);
  backdrop-filter: blur(18px);
}

.mobile-nav-link {
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  min-height: 58px;
  padding: 4px;
  color: var(--muted);
  font-size: 0.7rem;
  text-align: center;
}

.mobile-nav-link .nav-icon {
  width: 28px;
  height: 28px;
  background: #f3f7fb;
  color: var(--brand-navy);
  font-size: 0.65rem;
}

.mobile-nav-link[aria-current="page"] {
  background: var(--accent-blue-soft);
  color: var(--brand-navy);
}

.mobile-nav-link[aria-current="page"] .nav-icon {
  background: var(--brand-cyan);
  color: #fff;
}

@media (max-width: 1180px) {
  .level-grid,
  .tool-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 940px) {
  .app-shell {
    grid-template-columns: 238px minmax(0, 1fr);
    --sidebar-width: 238px;
  }

  .sidebar {
    padding: 18px 14px;
  }

  .brand {
    align-items: start;
  }

  .brand-title,
  .brand-subtitle,
  .nav-link span:not(.nav-icon),
  .teacher-profile div:not(.avatar) {
    display: none;
  }

  .sidebar {
    width: 92px;
  }

  .app-shell {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .brand,
  .teacher-profile,
  .nav-link {
    justify-content: center;
  }

  .module-controls {
    grid-template-columns: 1fr;
  }

  .filter-chips {
    justify-content: flex-start;
  }
}

@media (max-width: 780px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    display: none;
  }

  .main-area {
    padding: 18px 12px 104px;
  }

  .mobile-nav {
    display: grid;
  }

  .page-header {
    display: grid;
    padding: 18px;
  }

  .header-row {
    display: grid;
    justify-content: stretch;
  }

  .back-link {
    justify-self: start;
  }

  .welcome-panel {
    grid-template-columns: 1fr;
  }

  .welcome-art {
    display: none;
  }

  .level-grid,
  .block-grid,
  .module-grid,
  .resource-grid,
  .tool-grid {
    grid-template-columns: 1fr;
  }

  .level-card {
    min-height: 235px;
  }

  .module-card {
    min-height: 260px;
  }

  .filter-chips {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
  }
}

@media (max-width: 420px) {
  h1 {
    font-size: 2rem;
  }

  .page-header,
  .welcome-panel,
  .module-controls,
  .search-panel {
    border-radius: 22px;
  }

  .mobile-nav {
    right: 8px;
    bottom: 8px;
    left: 8px;
  }

  .mobile-nav-link {
    min-height: 56px;
    font-size: 0.66rem;
  }

  .resource-chip {
    min-height: 32px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
