/* ── Reset & Base ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue:      #3a5fa5;
  --blue-light:#5a80c8;
  --blue-pale: #e8eef8;
  --border:    #b0c0de;
  --text:      #1a1a2e;
  --muted:     #555;
  --white:     #ffffff;
  --radius:    6px;
  --shadow:    0 1px 4px rgba(0,0,0,0.10);
}

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: #f0f4fb;
  color: var(--text);
  font-size: 16px;
  line-height: 1.5;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Nav ─────────────────────────────────────────────────────────────────── */
nav {
  background: var(--blue);
  color: var(--white);
  padding: 0.6rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
nav .brand { font-weight: 700; font-size: 1.1rem; letter-spacing: 0.02em; }
nav a { color: rgba(255,255,255,0.85); font-size: 0.9rem; padding: 0.25rem 0.65rem; border-radius: 6px; }
nav a:hover { color: var(--white); text-decoration: none; }
nav a.nav-active {
  color: var(--white);
  font-weight: 600;
  background: rgba(255,255,255,0.22);
}

/* ── Page wrapper ────────────────────────────────────────────────────────── */
.page { max-width: 1100px; margin: 1.5rem auto; padding: 0 1rem; }

/* ── Cards ───────────────────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow);
}

/* ── Lesson Dashboard ────────────────────────────────────────────────────── */
/* ── Lesson Dashboard (purple / Avenir theme) ────────────────────────────── */
.dash {
  --p:        #6a4fb0;
  --p-deep:   #4a3680;
  --p-soft:   #8a6fd0;
  --p-pale:   #efe9fb;
  --p-paler:  #f6f2fd;
  --p-border: #ddd2f2;
  font-family: 'Avenir Next', 'Avenir', 'Segoe UI', system-ui, sans-serif;
  color: #251c3a;
}

/* Picker */
.dash-picker {
  background: var(--white);
  border: 1px solid var(--p-border);
  border-radius: 12px;
  padding: 0.7rem 1.1rem;
  display: flex; align-items: center; gap: 0.85rem; flex-wrap: wrap;
  margin-bottom: 1.25rem;
  box-shadow: 0 2px 10px rgba(74,54,128,0.07);
}
.dash-picker label { font-size: 0.82rem; font-weight: 600; color: var(--p); text-transform: uppercase; letter-spacing: .04em; }
.dash-picker select, .dash-picker input[type=date] {
  border: 1px solid var(--p-border); border-radius: 8px;
  padding: 0.4rem 0.65rem; font-size: 0.92rem; color: #251c3a;
  font-family: inherit; background: var(--p-paler);
}
.dash-picker button {
  background: var(--p); color: #fff; border: none; border-radius: 8px;
  padding: 0.45rem 1.25rem; font-size: 0.9rem; font-weight: 600; cursor: pointer;
  font-family: inherit; transition: background .15s;
}
.dash-picker button:hover { background: var(--p-deep); }

/* Empty state */
.dash-empty {
  background: var(--white); border: 1px solid var(--p-border); border-radius: 14px;
  padding: 2.5rem 1.5rem; text-align: center; color: var(--muted);
  box-shadow: 0 2px 12px rgba(74,54,128,0.07);
}
.dash-empty strong { display: block; font-size: 1.25rem; color: var(--p-deep); margin-bottom: 0.35rem; }

/* Hero */
.dash-hero {
  background: var(--white);
  border: 1px solid var(--p-border);
  border-radius: 16px;
  padding: 1.6rem 1.9rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 4px 18px rgba(74,54,128,0.08);
  border-left: 6px solid var(--p);
}
.dash-eyebrow {
  display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap;
  font-size: 0.86rem; color: var(--p); font-weight: 600;
  text-transform: uppercase; letter-spacing: .03em;
}
.dash-eyebrow .dash-dot { color: var(--p-soft); }
.dash-eyebrow .dash-topic { color: var(--p-deep); }
.dash-title {
  font-size: 2.3rem; font-weight: 800; line-height: 1.1;
  color: var(--p-deep); margin: 0.5rem 0 0;
  letter-spacing: -0.01em;
}
.dash-hook {
  margin-top: 1.1rem; padding: 0.9rem 1.1rem;
  background: var(--p-paler); border-radius: 12px;
  border: 1px solid var(--p-border);
}
.dash-hook-tag {
  display: inline-block; font-size: 0.66rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .08em;
  color: #fff; background: var(--p-soft);
  padding: 0.12rem 0.55rem; border-radius: 999px; margin-bottom: 0.45rem;
}
.dash-hook p { font-size: 1.06rem; line-height: 1.5; color: #2e2447; margin: 0; }
.dash-hook-title { font-weight: 800 !important; color: var(--p-deep) !important; margin-bottom: .35rem !important; }

.dash-targets { margin-top: 1.1rem; }
.dash-targets-tag {
  font-size: 0.72rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .06em; color: var(--p); margin-bottom: 0.5rem;
}
.dash-targets ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.dash-targets li {
  display: flex; align-items: flex-start; gap: 0.6rem;
  font-size: 0.97rem; line-height: 1.4; color: #2e2447;
}
.dash-tnum {
  flex-shrink: 0; width: 1.4rem; height: 1.4rem; border-radius: 50%;
  background: var(--p-pale); color: var(--p-deep);
  font-size: 0.78rem; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
  margin-top: 0.05rem;
}

/* Main grid */
.dash-main {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem;
  align-items: start; margin-bottom: 1.25rem;
}
.dash-col { display: flex; flex-direction: column; gap: 1.25rem; }
.dash-card {
  background: var(--white); border: 1px solid var(--p-border);
  border-radius: 14px; padding: 1.1rem 1.3rem;
  box-shadow: 0 2px 12px rgba(74,54,128,0.06);
}
.dash-card h3 {
  font-size: 0.78rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .06em; color: var(--p);
  margin-bottom: 0.7rem; padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--p-pale);
}
.dash-card-donow { border-left: 5px solid var(--p-soft); }
.dash-donow { font-size: 1.05rem; line-height: 1.5; color: #2e2447; margin: 0; }

.dash-muted { color: #9a93ad; font-style: italic; font-size: 0.95rem; }
.dash-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 0.55rem; }
.dash-list li {
  font-size: 0.97rem; line-height: 1.45; color: #2e2447;
  display: flex; align-items: baseline; gap: 0.45rem; flex-wrap: wrap;
  padding-left: 1.1rem; position: relative;
}
.dash-list li::before {
  content: '•'; position: absolute; left: 0.15rem;
  color: currentColor; font-weight: 800;
}
/* Announcement colour by source */
.dash-list li.ann-lesson { color: #1a1a2e; }           /* attached to the lesson */
.dash-list li.ann-manual { color: #1f8a4c; font-weight: 600; }  /* manually added */
.dash-list li.ann-quiz   { color: #c0392b; font-weight: 600; }  /* auto quiz reminder */
.dash-assignment {
  font-size: 1.05rem; font-weight: 600; color: #2e2447;
  background: var(--p-paler); border-radius: 10px;
  padding: 0.7rem 0.95rem; display: inline-block;
}

/* Image */
.dash-image {
  background: var(--white); border: 1px solid var(--p-border);
  border-radius: 14px; padding: 0.9rem;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 12px rgba(74,54,128,0.06);
}
.dash-image img {
  max-width: 100%; max-height: 420px; border-radius: 8px; display: block;
}
.dash-image-empty { color: var(--p-soft); font-style: italic; padding: 3rem 1rem; }

/* Resources (collapsed) */
.dash-resources {
  background: var(--white); border: 1px solid var(--p-border);
  border-radius: 12px; box-shadow: 0 2px 10px rgba(74,54,128,0.05);
  overflow: hidden;
}
.dash-resources summary {
  cursor: pointer; padding: 0.85rem 1.2rem;
  font-size: 0.82rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .05em; color: var(--p);
  display: flex; align-items: center; gap: 0.6rem; list-style: none;
}
.dash-resources summary::-webkit-details-marker { display: none; }
.dash-resources summary::before {
  content: '▸'; color: var(--p-soft); font-size: 0.9rem; transition: transform .15s;
}
.dash-resources[open] summary::before { transform: rotate(90deg); }
.dash-res-count {
  background: var(--p-pale); color: var(--p-deep);
  font-size: 0.72rem; font-weight: 800; border-radius: 999px;
  padding: 0.05rem 0.55rem;
}
.dash-res-body {
  padding: 0.4rem 1.2rem 1.1rem; display: flex; flex-direction: column; gap: 0.5rem;
}
.dash-res-item {
  display: flex; align-items: center; gap: 0.65rem;
  padding: 0.5rem 0.7rem; border-radius: 9px;
  background: var(--p-paler); border: 1px solid var(--p-border);
  color: #2e2447; font-size: 0.95rem; font-weight: 600;
}
.dash-res-item:hover { background: var(--p-pale); text-decoration: none; }
.dash-res-ic {
  flex-shrink: 0; font-size: 0.66rem; font-weight: 800;
  min-width: 2.1rem; height: 1.5rem; padding: 0 0.35rem;
  border-radius: 6px; color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
}
.ic-file  { background: #c0392b; }
.ic-video { background: var(--p); font-size: 0.8rem; }
.ic-prac  { background: #2e7d52; font-size: 0.85rem; }

@media (max-width: 760px) {
  .dash-main { grid-template-columns: 1fr; }
  .dash-title { font-size: 1.8rem; }
}

/* ── Date / Section picker ───────────────────────────────────────────────── */
.picker-bar {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  box-shadow: var(--shadow);
}
.picker-bar label { font-size: 0.88rem; color: var(--muted); }
.picker-bar select, .picker-bar input[type=date] {
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.3rem 0.6rem;
  font-size: 0.9rem;
  color: var(--text);
}
.picker-bar button {
  background: var(--blue);
  color: var(--white);
  border: none;
  border-radius: 4px;
  padding: 0.35rem 1rem;
  font-size: 0.9rem;
  cursor: pointer;
}
.picker-bar button:hover { background: var(--blue-light); }

/* ── Standard Overview ───────────────────────────────────────────────────── */
.so-header {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.5rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}
.so-header .std-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--blue);
}
.so-header .std-meta { font-size: 0.9rem; color: var(--muted); }

.so-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.so-grid .targets-panel { grid-column: 1; }
.so-grid .resources-panel { grid-column: 2; }
.so-grid .mistakes-panel { grid-column: 1 / -1; }

.so-panel {
  background: var(--white);
  border: 1.5px solid var(--blue-light);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow);
}
.so-panel h3 {
  color: var(--blue);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--blue-pale);
  padding-bottom: 0.4rem;
}
.so-panel .resource-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.25rem 0;
  border-bottom: 1px solid var(--blue-pale);
  font-size: 0.93rem;
}
.so-panel .resource-row:last-child { border-bottom: none; }
.so-panel .resource-label { color: var(--muted); min-width: 160px; font-size: 0.82rem; }
.so-panel .target-item {
  display: flex;
  gap: 0.5rem;
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--blue-pale);
  font-size: 0.95rem;
  align-items: flex-start;
}
.so-panel .target-item:last-child { border-bottom: none; }
.so-panel .target-num {
  color: var(--blue);
  font-weight: 600;
  min-width: 1.4rem;
}
.so-panel .mistakes-text {
  color: var(--muted);
  font-size: 0.93rem;
  white-space: pre-wrap;
}

/* ── Standards browser ───────────────────────────────────────────────────── */
.std-list { display: flex; flex-direction: column; gap: 0.5rem; }
.std-item {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow);
  transition: border-color 0.15s;
}
.std-item:hover { border-color: var(--blue-light); }
.std-item .std-code { font-weight: 700; color: var(--blue); min-width: 90px; }
.std-item .std-desc { flex: 1; }
.std-item .std-unit { color: var(--muted); font-size: 0.85rem; }

/* ── Home page ───────────────────────────────────────────────────────────── */
.home-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 1.5rem;
}
.home-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}
.home-card h2 { color: var(--blue); margin-bottom: 0.5rem; }
.home-card p { color: var(--muted); font-size: 0.93rem; margin-bottom: 1rem; }
.section-list { list-style: none; display: flex; flex-direction: column; gap: 0.4rem; }
.section-list a {
  display: block;
  background: var(--blue-pale);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.5rem 0.9rem;
  font-size: 0.93rem;
  color: var(--blue);
  font-weight: 500;
}
.section-list a:hover { background: #d4def5; text-decoration: none; }

/* ── No-lesson state ─────────────────────────────────────────────────────── */
.no-lesson {
  background: var(--white);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  text-align: center;
  color: var(--muted);
}
.no-lesson strong { display: block; font-size: 1.1rem; margin-bottom: 0.5rem; color: var(--blue); }

/* ── Util ────────────────────────────────────────────────────────────────── */
.muted { color: var(--muted); font-size: 0.88rem; }
.mt1 { margin-top: 1rem; }
h1 { font-size: 1.4rem; color: var(--blue); margin-bottom: 1rem; }

/* ── Two-month school calendar ───────────────────────────────────────────── */
.mc-nav {
  display: flex; align-items: center; gap: 1rem; margin-bottom: 1.25rem;
}
.mc-nav-btn {
  background: var(--blue); color: #fff; padding: .3rem .8rem;
  border-radius: var(--radius); text-decoration: none; font-size: .9rem; font-weight: 600;
}
.mc-nav-btn:hover { background: var(--blue-light); }
.mc-nav-lbl { font-weight: 700; color: var(--blue); flex: 1; text-align: center; font-size: 1rem; }

.mc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
@media (max-width: 700px) { .mc-grid { grid-template-columns: 1fr; } }

.mc-month { background: #fff; border-radius: var(--radius); border: 1px solid var(--border);
  box-shadow: var(--shadow); overflow: hidden; }

.mc-month-name { background: var(--blue); color: #fff; padding: .55rem .9rem;
  font-size: .95rem; font-weight: 700; margin: 0; }

.mc-cal {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 1px; background: var(--border); padding: 1px;
}

/* Day-of-week headers */
.mc-dow {
  background: var(--blue-pale); text-align: center;
  font-size: .7rem; font-weight: 700; color: var(--blue);
  padding: .3rem 0;
}

/* Day cells */
.mc-cell {
  background: #fff; min-height: 72px; padding: 4px;
  position: relative;
  display: flex; align-items: center; justify-content: center;
}
.mc-blank     { background: #f9f9f9; }
.mc-weekend   { background: #f5f5f5; }
.mc-no-record { background: #fff; }
.mc-holiday   { background: #fef9ec; }
.mc-today     { outline: 2px solid var(--blue); outline-offset: -2px; }

/* Date number — small, top-left corner */
.mc-date-num {
  position: absolute; top: 4px; left: 6px;
  font-size: .72rem; font-weight: 700; color: var(--muted);
  line-height: 1;
}
.mc-weekend .mc-date-num   { color: #ccc; }
.mc-today   .mc-date-num   { color: var(--blue); font-weight: 800; }
.mc-holiday .mc-date-num   { color: #c8a040; }

/* Day-type letter — large and centered */
.mc-letter {
  font-size: 2rem; font-weight: 900; line-height: 1;
  padding: 0; border-radius: 0; background: none;
}
.mc-a { color: #1565C0; }
.mc-b { color: #2E7D32; }
.mc-c { color: #795548; }
.mc-d { color: #6A1B9A; }
.mc-e { color: #C62828; }

/* Half-day indicator — small, bottom-right */
.mc-half {
  position: absolute; bottom: 3px; right: 5px;
  font-size: .65rem; color: #e65100; font-weight: 700;
}

/* Holiday label — centered */
.mc-holiday-lbl {
  font-size: .62rem; color: #a07020; font-style: italic;
  text-align: center; line-height: 1.3; padding: 0 2px;
}

/* Legend */
.mc-legend {
  display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin-top: 1rem;
  font-size: .8rem; color: var(--muted); align-items: center;
}
.mc-legend-item { display: flex; align-items: center; gap: .35rem; }
/* Legend badges use colored pill (small) */
.mc-legend-badge {
  font-size: .72rem; font-weight: 800; padding: .1rem .4rem;
  border-radius: 3px; color: #fff; background: currentColor;
}
.mc-legend-badge.mc-a { background: #1565C0; color: #fff; }
.mc-legend-badge.mc-b { background: #2E7D32; color: #fff; }
.mc-legend-badge.mc-c { background: #795548; color: #fff; }
.mc-legend-badge.mc-d { background: #6A1B9A; color: #fff; }
.mc-legend-badge.mc-e { background: #C62828; color: #fff; }

.mc-holiday-dot { width: 10px; height: 10px; background: #fef9ec;
  border: 1px solid #e6ac00; border-radius: 2px; display: inline-block; }

/* ── Calendar ────────────────────────────────────────────────────────────── */
.cal-nav {
  display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem;
}
.cal-nav-btn {
  background: var(--blue); color: #fff; padding: 0.35rem 0.9rem;
  border-radius: var(--radius); text-decoration: none; font-size: 0.9rem;
}
.cal-nav-btn:hover { background: var(--blue-light); }
.cal-week-label { font-weight: 600; color: var(--blue); }

.cal-table-wrap { overflow-x: auto; }
.cal-table {
  border-collapse: collapse; width: 100%; min-width: 700px;
  background: #fff; border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.cal-table th, .cal-table td {
  border: 1px solid var(--border); padding: 0.5rem 0.6rem;
  vertical-align: top; font-size: 0.88rem;
}
.cal-section-col { width: 120px; }
.cal-day-head { text-align: center; min-width: 140px; }
.cal-date-label { font-size: 0.78rem; color: var(--muted); margin-bottom: 0.25rem; }

/* Day type badges */
.cal-day-badge {
  display: inline-block; padding: 0.15rem 0.5rem;
  border-radius: 4px; font-weight: 700; font-size: 0.8rem;
  color: #fff; margin-bottom: 0.2rem;
}
.day-a { background: #4a7fb5; }
.day-b { background: #5a9e6f; }
.day-c { background: #b87333; }
.day-d { background: #8b5e9e; }
.day-e { background: #c0392b; }

.cal-closed { background: #f5f5f5; }
.cal-closed-label { font-size: 0.75rem; color: var(--muted); font-style: italic; }
.cal-half-label { font-size: 0.75rem; color: #b87333; font-weight: 600; }

.cal-section-label {
  font-size: 0.82rem; font-weight: 600; line-height: 1.3;
  background: var(--blue-pale);
}
.cal-section-label a { color: var(--blue); text-decoration: none; }
.cal-section-label a:hover { text-decoration: underline; }

.cal-cell { min-height: 3rem; }
.cal-no-meet { background: #f0f0f0; }
.cal-no-meet-label { color: #bbb; font-size: 0.8rem; }

.cal-lesson-entry {
  background: var(--blue-pale); border-left: 3px solid var(--blue);
  padding: 0.2rem 0.4rem; border-radius: 3px; font-size: 0.82rem;
}
.cal-lesson-num {
  font-weight: 700; color: var(--blue); margin-right: 0.3rem;
}
.cal-quiz-entry {
  background: #fef3cd; border-left: 3px solid #e6ac00;
  padding: 0.2rem 0.4rem; border-radius: 3px;
  font-size: 0.82rem; font-weight: 600; color: #7a5a00;
}
.cal-plan-link {
  color: var(--blue-light); font-size: 0.8rem; text-decoration: none;
  opacity: 0.6;
}
.cal-plan-link:hover { opacity: 1; text-decoration: underline; }

/* ── Teacher Schedule ────────────────────────────────────────────────────── */
.sched-controls {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  margin-bottom: 1rem;
}
.sched-view-toggle { display: flex; gap: .2rem; }
.sched-toggle-btn {
  padding: .3rem .8rem; border-radius: var(--radius);
  font-size: .85rem; font-weight: 600; text-decoration: none;
  border: 1px solid var(--border); color: var(--muted); background: #fff;
  cursor: pointer;
}
.sched-toggle-btn:hover { border-color: var(--blue); color: var(--blue); }
.sched-toggle-btn.active { background: var(--blue); color: #fff; border-color: var(--blue); }

.sched-week-nav { display: flex; align-items: center; gap: .5rem; }
.sched-nav-btn {
  background: var(--blue); color: #fff; font-size: 1.1rem; font-weight: bold;
  padding: .15rem .55rem; border-radius: var(--radius); text-decoration: none;
}
.sched-nav-btn:hover { background: var(--blue-light); }
.sched-week-lbl { font-weight: 600; color: var(--blue); font-size: .88rem; }

/* ── Weekly planner grid (time-based) ────────────────────────────────── */
.pg-outer {
  display: flex;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* Time label column */
.pg-time-col {
  width: 52px; flex-shrink: 0;
  position: relative;
  border-right: 1px solid var(--border);
  background: #fafafa;
}
.pg-hour-lbl {
  position: absolute; right: 6px;
  font-size: .62rem; color: var(--muted);
  transform: translateY(-50%);
  white-space: nowrap;
}

/* Day columns wrapper */
.pg-days { display: flex; flex: 1; min-width: 0; position: relative; }

/* Current-time red line */
.pg-time-line {
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: #e53935;
  z-index: 20;
  pointer-events: none;
}
.pg-time-line::before {
  content: '';
  position: absolute;
  left: -4px; top: 50%;
  transform: translateY(-50%);
  width: 9px; height: 9px;
  border-radius: 50%;
  background: #e53935;
}

/* Individual day column */
.pg-day-col {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
  border-right: 1px solid var(--border);
}
.pg-day-col:last-child { border-right: none; }

/* Day header */
.pg-day-hdr {
  text-align: center; padding: .4rem .3rem;
  background: var(--blue-pale);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.pg-hdr-closed { background: #ebebeb; }
.pg-dow   { font-size: .72rem; font-weight: 700; color: var(--blue); }
.pg-date  { font-size: .68rem; color: var(--muted); }
.pg-dtype { font-size: .65rem; font-weight: 600; color: var(--blue); margin-top: .1rem; }
.pg-note  { font-size: .62rem; color: var(--muted); font-style: italic; }

/* Time body — contains absolutely positioned blocks */
.pg-day-body { position: relative; flex-shrink: 0; }

/* Horizontal hour lines */
.pg-grid-line {
  position: absolute; left: 0; right: 0;
  border-top: 1px solid #efefef;
}

/* Closed-day overlay */
.pg-closed-overlay {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(
    -45deg, transparent, transparent 6px, rgba(0,0,0,.03) 6px, rgba(0,0,0,.03) 12px
  );
}

/* Class / event blocks */
.pg-block {
  position: absolute; left: 3px; right: 3px;
  border-radius: 4px; overflow: hidden;
  padding: .25rem .35rem;
  display: flex; flex-direction: column; justify-content: flex-start;
  font-size: .72rem;
}

.pg-class { color: #fff; }
.pg-class-period { font-size: .6rem; opacity: .8; font-weight: 600; }
.pg-class-name   { font-size: .78rem; font-weight: 700; line-height: 1.2; }
.pg-class-lesson { font-size: .62rem; opacity: .88; font-style: italic; margin-top: .1rem; }

.pg-lunch {
  background: #fff8e1; color: #a07020; font-weight: 600;
  border: 1px solid #ffe082;
  align-items: center; justify-content: center; text-align: center;
  font-size: .75rem;
}

/* Rotation view specifics */
:root { --rot-col: 155px; --rot-lbl: 95px; }

.rot-split { display: flex; gap: 1rem; align-items: flex-start; }
/* Both sections have fixed widths so every day column is identical */
.rot-abcd { flex: none; width: calc(var(--rot-lbl) + 4 * var(--rot-col)); }
.rot-eday { flex: none; width: calc(var(--rot-lbl) + var(--rot-col));   }

.rot-table { table-layout: fixed; }
.rot-table .rot-block-col { width: var(--rot-lbl); min-width: var(--rot-lbl); }
.rot-day-th { width: var(--rot-col); }
.rot-col-hdr { font-size: .85rem; font-weight: 700; color: var(--blue); }

/* All data rows — uniform min-height (expands for word wrap) */
.rot-table tbody td { height: 76px; min-height: 76px; padding: 0; vertical-align: middle; }

/* Lunch row — shorter */
.rot-lunch-row td { height: 34px !important; min-height: 34px !important; }

/* Block label cell */
.rot-block-lbl {
  padding: .3rem .5rem; background: var(--blue-pale);
  text-align: center; height: 76px;
  display: table-cell; vertical-align: middle;
}
.rot-lunch-row .rot-block-lbl { background: #ffe082; height: 34px !important; }
.rbl-session { font-size: .6rem; font-weight: 700; text-transform: uppercase;
  color: var(--muted); letter-spacing: .05em; }
.rbl-name { font-size: .8rem; font-weight: 700; color: var(--blue); }

/* ── Cell types ── */
/* Class meets — entire cell is the section color */
.rot-td-class { padding: 0 !important; cursor: default; }
.rot-class-fill {
  min-height: 76px; padding: .45rem .55rem;
  display: flex; flex-direction: column; justify-content: center;
  color: #fff;
}
.rot-class-period { font-size: .63rem; opacity: .78; font-weight: 600; margin-bottom: .1rem; }
.rot-class-name   { font-size: .82rem; font-weight: 700; line-height: 1.2;
  white-space: normal; overflow-wrap: break-word; word-break: break-word; }

/* Free period */
.rot-td-free { background: #f5f5f5; }
.rot-free-inner { height: 76px; padding: .4rem .5rem;
  display: flex; flex-direction: column; justify-content: center; }
.rot-period-lbl  { font-size: .65rem; color: var(--muted); font-weight: 600; margin-bottom: .15rem; }
.rot-free-lbl    { font-size: .75rem; color: #bbb; font-style: italic; }

/* Lunch */
.rot-lunch-row td { background: #fff8e1; }
.rot-lunch-fill { height: 34px; display: flex; align-items: center;
  justify-content: center; font-size: .78rem; color: #a07020; font-weight: 600; }

/* Legend */
.sched-legend {
  display: flex; flex-wrap: wrap; gap: .6rem 1.5rem;
  font-size: .82rem; color: var(--muted);
}
.legend-item { display: flex; align-items: center; gap: .4rem; }
.legend-dot  {
  width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0;
}

/* ── Planner (drag-and-drop) ─────────────────────────────────────────────── */

/* Full-height layout below nav */
.planner-layout {
  display: flex;
  height: calc(100vh - 46px);
  overflow: hidden;
}

/* ── Sidebar ──────────────────────────────────────────────────── */
.pln-sidebar {
  width: 230px; min-width: 230px; flex-shrink: 0;
  background: #fff; border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  transition: min-width .18s, width .18s;
  overflow: hidden;
}
.pln-sidebar.pln-collapsed { width: 36px; min-width: 36px; }
.pln-sidebar.pln-collapsed .pln-sb-body,
.pln-sidebar.pln-collapsed .pln-sb-title { display: none; }

.pln-sb-hdr {
  display: flex; align-items: center; justify-content: space-between;
  padding: .5rem .65rem; background: var(--blue-pale);
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.pln-sb-title { font-weight: 700; font-size: .82rem; color: var(--blue); }
.pln-sb-toggle {
  background: none; border: none; cursor: pointer;
  font-size: 1rem; font-weight: bold; color: var(--blue); padding: 0 .1rem;
}
.pln-sb-body { flex: 1; overflow-y: auto; padding: .4rem .45rem; }

/* Collapsible course / unit blocks */
.sb-course { border-bottom: 1px solid var(--border); }
.sb-course summary { list-style: none; }
.sb-course summary::-webkit-details-marker { display: none; }

.sb-course-hdr {
  font-size: .75rem; font-weight: 700; text-transform: uppercase;
  color: var(--blue); padding: .5rem .6rem; cursor: pointer;
  display: flex; align-items: center; gap: .3rem;
  background: var(--blue-pale); letter-spacing: .04em;
  user-select: none;
}
.sb-course-hdr::before { content: '\25BE'; font-size: .7rem; transition: transform .15s; }
.sb-course:not([open]) .sb-course-hdr::before { transform: rotate(-90deg); }

.sb-course-hdr-quiz { background: #fef3cd; color: #7a5a00; }
.sb-course-quiz { border-top: 2px solid var(--border); margin-top: .25rem; }

.sb-unit { }
.sb-unit summary { list-style: none; }
.sb-unit summary::-webkit-details-marker { display: none; }

.sb-unit-hdr {
  font-size: .7rem; font-weight: 600; color: var(--muted);
  padding: .3rem .5rem; cursor: pointer; display: flex;
  align-items: center; gap: .25rem; user-select: none;
  border-bottom: 1px solid #eef;
}
.sb-unit-hdr::before { content: '\25BE'; font-size: .65rem; color: var(--blue-light); transition: transform .15s; }
.sb-unit:not([open]) .sb-unit-hdr::before { transform: rotate(-90deg); }

.sb-unit-body { padding: .2rem .2rem .3rem; }

/* keep legacy group header if still needed */
.pln-grp-hdr {
  font-size: .68rem; font-weight: 700; text-transform: uppercase;
  color: var(--muted); padding: .55rem .2rem .2rem; letter-spacing: .04em;
}
.pln-grp-quiz { margin-top: .4rem; border-top: 1px solid var(--border); padding-top: .65rem; }

/* Palette items */
.palette-item {
  padding: .3rem .45rem; margin-bottom: .18rem;
  border: 1px solid var(--border); border-radius: 4px; background: #fafafa;
  cursor: grab; font-size: .78rem; display: flex; flex-wrap: wrap;
  align-items: baseline; gap: .15rem .3rem; user-select: none;
}
.palette-item:hover:not(.is-dragging) { background: var(--blue-pale); border-color: var(--blue-light); }
.palette-item.is-dragging { opacity: .45; cursor: grabbing; }
.palette-item.pi-sched { border-color: #a5d6a7; background: #f0f8f0; }
.pi-num  { font-weight: 700; color: var(--blue); font-size: .75rem; white-space: nowrap; }
.pi-lbl  { flex: 1; color: var(--text); font-size: .76rem; min-width: 0; }
.pi-dates{ width: 100%; font-size: .68rem; color: var(--muted); padding-left: 1.6rem; }
.pi-q-badge {
  background: #e67e22; color: #fff; font-weight: 700;
  font-size: .65rem; padding: .05rem .28rem; border-radius: 3px;
}
.pi-ver { color: var(--muted); font-size: .68rem; }
.pi-std-code { font-weight: 700; color: #7a5a00; }
.pln-new-lesson-btn {
  display: block; text-align: center; text-decoration: none;
  font-size: .75rem; font-weight: 600; color: var(--blue);
  border: 1px dashed var(--blue-light); border-radius: var(--radius);
  padding: .3rem .5rem; background: var(--blue-pale);
}
.pln-new-lesson-btn:hover { background: #d0dcf5; }
.pi-edit-link { color: var(--text); text-decoration: none; }
.pi-edit-link:hover { color: var(--blue); text-decoration: underline; }

/* ── Main column ──────────────────────────────────────────────── */
.pln-main {
  flex: 1; display: flex; flex-direction: column;
  overflow-y: auto; overflow-x: hidden; min-width: 0;
  background: #f0f4fb;
}

/* Sticky nav */
.pln-nav {
  display: flex; align-items: center; gap: .65rem;
  padding: .45rem .75rem; background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.pln-nav-btn {
  background: var(--blue); color: #fff; font-size: .85rem; font-weight: 600;
  padding: .3rem .75rem; border-radius: var(--radius); text-decoration: none;
}
.pln-nav-btn:hover { background: var(--blue-light); }
.pln-nav-lbl { font-weight: 600; color: var(--blue); font-size: .88rem; flex: 1; text-align: center; }
.pln-course-picker { display: flex; gap: .35rem; margin-left: .5rem; }
.pln-course-btn {
  padding: .25rem .65rem; border-radius: var(--radius);
  font-size: .8rem; font-weight: 600; text-decoration: none;
  border: 1px solid var(--border); color: var(--muted); background: #fff;
}
.pln-course-btn:hover { border-color: var(--blue); color: var(--blue); }
.pln-course-active { background: var(--blue) !important; color: #fff !important; border-color: var(--blue) !important; }

/* Three week blocks */
.pln-weeks {
  display: flex; flex-direction: column; gap: 12px; padding: 12px;
}

.pln-week-block {
  background: #fff; border-radius: var(--radius);
  border: 1px solid var(--border); box-shadow: var(--shadow);
  overflow: hidden;
}

/* Current-week glow */
.pln-week-block.week-now {
  border-color: #f59e0b;
  box-shadow: 0 0 0 2px #f59e0b, 0 0 18px 6px rgba(245,158,11,.18);
}
.week-now .pln-week-hdr-bar { background: #d97706; }

/* Week header bar */
.pln-week-hdr-bar {
  background: var(--blue); color: #fff;
  padding: .35rem .75rem; font-size: .8rem; font-weight: 600;
}

/* Current-day column header */
.dh-today {
  background: #fef3c7 !important;
  border-bottom: 2px solid #f59e0b;
}
.dh-today .dh-dow, .dh-today .dh-num { color: #92400e; }

/* Current-day data cells */
.cell-today.cell-open  { background: #fffbeb; }
.cell-today.cell-dark  { background: #fef3c7; opacity: .7; }

/* Week table */
.pln-week-table {
  width: 100%; border-collapse: collapse; table-layout: fixed;
}
.pln-week-table th,
.pln-week-table td {
  border: 1px solid var(--border); padding: 0; vertical-align: top;
}
.pln-week-table thead tr th:first-child,
.pln-week-table tbody tr td:first-child { border-left: none; }
.pln-week-table tr:last-child td { border-bottom: none; }
.pln-week-table tr th:last-child,
.pln-week-table tr td:last-child { border-right: none; }
.pln-week-table thead tr th { border-top: none; }

/* Section label column */
.pln-sec-col { width: 110px; }

/* Day header cells */
.pln-day-hdr {
  text-align: center; padding: .3rem .25rem;
  background: var(--blue-pale);
}
.pln-day-hdr.dh-closed { background: #ebebeb; }
.dh-dow  { font-size: .67rem; color: var(--muted); }
.dh-num  { font-size: .78rem; font-weight: 600; }
.dh-note { font-size: .62rem; color: var(--muted); font-style: italic; margin-top: .1rem; }

/* Section label cells */
.pln-sec-lbl {
  padding: .45rem .6rem; vertical-align: middle;
  background: var(--blue-pale); width: 110px;
}
.pln-sec-course { font-size: .72rem; font-weight: 600; color: var(--blue); }
.pln-sec-period { font-size: .68rem; color: var(--muted); }

/* Alternating section rows */
.sec-row-alt .pln-sec-lbl { background: #dce6f5; }
.sec-row-alt .pln-sec-lbl .pln-sec-course { color: #2d4a82; }

/* Data cells */
.pln-cell { height: 48px; padding: .18rem; vertical-align: top; position: relative; }
.cell-dark { background: #ebebeb; }
.cell-open { background: #fff; }
/* Faint course/period watermark on empty meetable cells */
.cell-ghost {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: .95rem; font-weight: 800; letter-spacing: .04em;
  text-transform: uppercase; color: #e2e2e2;
  white-space: nowrap; overflow: hidden;
  pointer-events: none; user-select: none;
}
.cell-open.drop-over {
  background: #dde8ff;
  outline: 2px dashed var(--blue); outline-offset: -2px;
}
.cell-loading { opacity: .45; pointer-events: none; }

/* Cell items (placed lessons / quizzes) */
.ci {
  border-radius: 4px; padding: .18rem .3rem;
  display: flex; align-items: center; gap: .22rem;
  cursor: grab; user-select: none;
  min-height: 28px; font-size: .73rem;
}
.ci.is-dragging { opacity: .4; cursor: grabbing; }
.ci-lesson { background: var(--blue-pale); border: 1px solid var(--blue-light); }
.ci-quiz   { background: #fef3cd; border: 1px solid #e6ac00; }
.ci-num    { font-weight: 700; color: var(--blue); font-size: .7rem; white-space: nowrap; flex-shrink: 0; }
.ci-lbl    { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .7rem; }
.ci-q-badge{
  background: #e6ac00; color: #fff; font-weight: 700;
  font-size: .62rem; padding: .05rem .22rem; border-radius: 2px; flex-shrink: 0;
}
.ci-x {
  background: none; border: none; cursor: pointer; font-size: .8rem;
  color: var(--muted); padding: 0; line-height: 1; opacity: .55; flex-shrink: 0;
}
.ci-x:hover { color: #c0392b; opacity: 1; }

/* ── Learning Targets in Lesson Editor ───────────────────────────────────── */
/* "On dashboard" badge — marks fields students see on the lesson dashboard */
.le-dash-badge {
  display: inline-block; vertical-align: middle;
  font-size: .62rem; font-weight: 700; letter-spacing: .03em;
  text-transform: uppercase;
  color: #1d6f42; background: #e3f5ea;
  border: 1px solid #b6e0c6; border-radius: 999px;
  padding: .08rem .42rem; margin-left: .25rem;
}
.le-dash-legend {
  font-size: .82rem; color: var(--muted, #667);
  margin: .35rem 0 1rem;
}

.le-lt-list {
  display: flex; flex-direction: column; gap: .3rem;
  margin: .3rem 0 .5rem;
}
.le-lt-item {
  display: flex; align-items: flex-start; gap: .5rem; cursor: pointer;
  padding: .25rem .4rem; border-radius: 4px; font-size: .88rem;
}
.le-lt-item:hover { background: var(--blue-pale); }
.le-lt-item input[type=checkbox] { margin-top: .15rem; flex-shrink: 0; cursor: pointer; }
.le-lt-seq  { font-weight: 700; color: var(--blue); white-space: nowrap; }
.le-lt-label{ flex: 1; }

.le-lt-add {
  display: flex; gap: .45rem; margin-top: .4rem; align-items: center;
}

/* ── Lessons Index ───────────────────────────────────────────────────────── */
.li-course { margin-bottom: 1.25rem; }
.li-course summary { list-style: none; }
.li-course summary::-webkit-details-marker { display: none; }

.li-course-hdr {
  font-size: 1.05rem; font-weight: 700; color: #fff;
  background: var(--blue); padding: .5rem .85rem;
  border-radius: var(--radius); cursor: pointer;
  display: flex; align-items: center; gap: .4rem;
  user-select: none;
}
.li-course-hdr::before { content: '\25BE'; font-size: .8rem; transition: transform .15s; }
.li-course:not([open]) .li-course-hdr::before { transform: rotate(-90deg); }

.li-unit { margin: .5rem 0 .25rem 0; }
.li-unit summary { list-style: none; }
.li-unit summary::-webkit-details-marker { display: none; }

.li-unit-hdr {
  font-size: .82rem; font-weight: 700; color: var(--blue);
  background: var(--blue-pale); padding: .35rem .75rem;
  border-radius: var(--radius); cursor: pointer;
  display: flex; align-items: center; gap: .35rem;
  user-select: none;
}
.li-unit-hdr::before { content: '\25BE'; font-size: .68rem; color: var(--blue-light); transition: transform .15s; }
.li-unit:not([open]) .li-unit-hdr::before { transform: rotate(-90deg); }

.li-unit-body { margin-top: .3rem; }

.li-lesson-row { display: flex !important; align-items: center; gap: .75rem; }
.li-lesson-num { min-width: 2.8rem; text-align: right; flex-shrink: 0; }
.li-lesson-meta { margin-left: auto; font-size: .75rem; white-space: nowrap; }

/* ── Lesson Editor ───────────────────────────────────────────────────────── */
.le-breadcrumb { font-size:.8rem; color:var(--muted); margin-bottom:.5rem; }
.le-breadcrumb a { color:var(--blue); text-decoration:none; }
.le-breadcrumb a:hover { text-decoration:underline; }

.le-hero { display:flex; align-items:center; gap:1rem; margin-bottom:1.25rem; }
.le-num  { font-size:1.3rem; font-weight:700; color:var(--blue); }
.le-saved{ background:#e8f5e9; color:#2e7d32; padding:.2rem .7rem;
  border-radius:var(--radius); font-size:.82rem; font-weight:600; }

.le-form { }

/* Two-column layout */
.le-cols {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 860px) { .le-cols { grid-template-columns: 1fr; } }

.le-left  { display: flex; flex-direction: column; gap: .85rem; min-width: 0; }
.le-right { display: flex; flex-direction: column; gap: 1rem;   min-width: 0; }

/* Right-column cards */
.le-right-card {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow);
}
.le-right-card-hdr {
  background: var(--blue-pale); padding: .45rem .75rem;
  font-size: .82rem; font-weight: 700; color: var(--blue);
  border-bottom: 1px solid var(--border);
}
.le-right-card-body { padding: .75rem; display: flex; flex-direction: column; gap: .6rem; }

.le-field { display:flex; flex-direction:column; gap:.25rem; }
.le-field label { font-size:.8rem; font-weight:600; color:var(--muted); }
.le-field-inline { flex-direction: row; align-items: center; gap: .75rem; }
.le-field-inline label { white-space: nowrap; }
.le-hint { font-weight:400; font-style:italic; }

.le-input {
  padding:.4rem .6rem; font-size:.9rem;
  border:1px solid var(--border); border-radius:var(--radius);
  width:100%;
}
.le-input:focus { outline:2px solid var(--blue-light); border-color:transparent; }
.le-input-title { font-size:1.05rem; font-weight:600; }
.le-input-sm    { max-width:120px; }

.le-ta {
  padding:.4rem .6rem; font-size:.88rem; font-family:inherit;
  border:1px solid var(--border); border-radius:var(--radius);
  resize:vertical; width:100%; line-height:1.5;
}
.le-ta:focus { outline:2px solid var(--blue-light); border-color:transparent; }
.le-ta-sm { rows:2; }
.le-ta-lg { min-height:160px; }

.le-quick-row { display:flex; gap:.75rem; align-items:flex-start; flex-wrap:wrap; }
.le-quick-row .le-field { flex:1; min-width:120px; }

.le-two-col { display:grid; grid-template-columns:1fr 1fr; gap:.75rem; }
@media (max-width:700px) { .le-two-col { grid-template-columns:1fr; } }

.le-save-row { display:flex; align-items:center; gap:1rem; margin-top:.5rem; }
.le-cancel { color:var(--muted); font-size:.88rem; text-decoration:none; }
.le-cancel:hover { color:var(--blue); }

/* Files section */
.le-files-section { margin-top:2rem; padding-top:1.5rem; border-top:2px solid var(--border); }
.le-files-section h3 { font-size:1rem; color:var(--blue); margin-bottom:.85rem; }

.le-files-list { display:flex; flex-direction:column; gap:.4rem; margin-bottom:1rem; }
.le-file-row {
  display:flex; align-items:center; gap:.7rem; padding:.45rem .6rem;
  background:#fff; border:1px solid var(--border); border-radius:var(--radius);
  font-size:.85rem;
}
.le-file-type {
  padding:.15rem .5rem; border-radius:3px; font-size:.7rem; font-weight:700;
  text-transform:uppercase; white-space:nowrap;
}
.le-ft-handout     { background:var(--blue-pale); color:var(--blue); }
.le-ft-answer_key  { background:#e8f5e9; color:#2e7d32; }
.le-ft-supplemental{ background:#fef3cd; color:#7a5a00; }
.le-ft-other       { background:#f5f5f5; color:var(--muted); }

.le-file-link { flex:1; color:var(--blue); text-decoration:none; }
.le-file-link:hover { text-decoration:underline; }
.le-file-orig { color:var(--muted); font-size:.75rem; }

.le-file-del {
  background:none; border:none; cursor:pointer;
  color:var(--muted); font-size:.88rem; opacity:.6;
}
.le-file-del:hover { color:#c0392b; opacity:1; }

.le-upload-form { margin-top:.75rem; }
.le-upload-row { display:flex; gap:.5rem; align-items:center; flex-wrap:wrap; }
.le-select {
  padding:.38rem .5rem; font-size:.85rem;
  border:1px solid var(--border); border-radius:var(--radius);
}
.le-select-full { width: 100%; font-size: .88rem; }
.le-file-input { font-size:.82rem; }

/* ── Planning Page ───────────────────────────────────────────────────────── */
.plan-day-strip {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.6rem 1rem; border-radius: var(--radius);
  margin-bottom: 1rem; font-size: 0.92rem;
}
.plan-meets      { background: #e8f5e9; border: 1px solid #a5d6a7; }
.plan-no-period  { background: #fff3e0; border: 1px solid #ffcc80; }
.plan-no-school  { background: #f5f5f5; border: 1px solid #ddd; }
.plan-meets-label    { color: #2e7d32; font-weight: 600; }
.plan-no-period-label{ color: #e65100; font-weight: 600; }
.plan-no-school-label{ color: var(--muted); font-weight: 600; }
.plan-hint { color: var(--muted); font-size: 0.82rem; }

.plan-grid {
  display: flex; flex-direction: column; gap: 1.25rem;
}
@media (max-width: 800px) { .plan-grid { grid-template-columns: 1fr; } }

/* Lesson list */
.plan-lesson-list {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  margin-bottom: 0.9rem;
}
.plan-lesson-row {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.55rem 0.8rem; border-bottom: 1px solid #eef;
  cursor: pointer; transition: background 0.1s;
}
.plan-lesson-row:last-child { border-bottom: none; }
.plan-lesson-row:hover:not(.plan-lesson-taken) { background: var(--blue-pale); }
.plan-lesson-current { background: #e8f0fe !important; }
.plan-lesson-next    { background: #f0f8f0; }
.plan-lesson-taken   { opacity: 0.5; cursor: default; }
.plan-lesson-num  { font-weight: 700; color: var(--blue); min-width: 2rem; font-size: 0.85rem; }
.plan-lesson-label{ flex: 1; font-size: 0.88rem; }
.plan-lesson-tag {
  font-size: 0.72rem; padding: 0.1rem 0.4rem;
  border-radius: 3px; white-space: nowrap;
}
.plan-tag-current { background: #c7d9f5; color: #1a4a8a; }
.plan-tag-taken   { background: #e0e0e0; color: #555; }
.plan-tag-next    { background: #c8e6c9; color: #1b5e20; }

/* Assignment note */
.plan-note-row { margin-bottom: 0.8rem; }
.plan-note-label { display: block; font-size: 0.82rem; font-weight: 600;
  color: var(--muted); margin-bottom: 0.3rem; }
.plan-note-input {
  width: 100%; padding: 0.45rem 0.6rem; font-size: 0.9rem;
  border: 1px solid var(--border); border-radius: var(--radius);
}
.plan-note-input:focus { outline: 2px solid var(--blue-light); border-color: transparent; }

/* Buttons */
.plan-buttons { display: flex; gap: 0.6rem; }
.btn-primary {
  background: var(--blue); color: #fff; border: none;
  padding: 0.45rem 1.2rem; border-radius: var(--radius);
  font-size: 0.9rem; cursor: pointer;
}
.btn-primary:hover { background: var(--blue-light); }
.btn-danger {
  background: #fff; color: #c0392b; border: 1px solid #c0392b;
  padding: 0.45rem 1rem; border-radius: var(--radius);
  font-size: 0.9rem; cursor: pointer;
}
.btn-danger:hover { background: #fdecea; }

.plan-blocked {
  background: #fff3e0; border: 1px solid #ffcc80;
  border-radius: var(--radius); padding: 1rem;
  color: #e65100;
}

/* Sidebar schedule */
.plan-sidebar {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0.9rem;
}
.plan-sidebar h3 {
  font-size: 0.9rem; color: var(--blue);
  margin-bottom: 0.75rem; padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}
/* Horizontal scrolling row list for wide screens */
.plan-sched-list {
  display: flex; flex-wrap: wrap; gap: 0.4rem;
}
.plan-sched-row {
  display: flex; flex-direction: column; gap: 0.1rem;
  padding: 0.45rem 0.7rem; border-radius: 4px;
  text-decoration: none; color: var(--text);
  border: 1px solid var(--border); background: #fafafa;
  min-width: 160px; flex: 0 0 auto;
}
.plan-sched-row:hover { background: var(--blue-pale); border-color: var(--blue-light); }
.plan-sched-active { background: #e8f0fe !important; border-color: var(--blue) !important; }
.plan-sched-date {
  font-size: 0.75rem; color: var(--muted);
  display: flex; align-items: center; gap: 0.3rem;
}
.plan-sched-type {
  display: inline-block; padding: 0.05rem 0.3rem;
  border-radius: 3px; font-size: 0.68rem; font-weight: 700; color: #fff;
}
.plan-sched-lesson { font-size: 0.83rem; }
.plan-sched-note { display: block; font-size: 0.72rem; color: var(--muted); margin-top: 0.1rem; }

/* ── Announcements page ──────────────────────────────────────────────────── */
.ann-h1 { font-size: 1.7rem; font-weight: 800; color: var(--blue); margin-bottom: 1rem; }
.ann-layout { display: grid; grid-template-columns: 360px 1fr; gap: 1.5rem; align-items: start; }

.ann-form {
  background: var(--white); border: 1px solid var(--border); border-radius: 12px;
  padding: 1.2rem 1.3rem; box-shadow: var(--shadow);
  position: sticky; top: 1rem;
}
.ann-form-hdr {
  font-size: 1.05rem; font-weight: 700; color: var(--blue);
  margin-bottom: 1rem; display: flex; justify-content: space-between; align-items: center;
}
.ann-cancel { font-size: 0.8rem; font-weight: 600; }
.ann-field { margin-bottom: 1rem; }
.ann-field > label {
  display: block; font-size: 0.78rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; color: var(--muted); margin-bottom: 0.4rem;
}
.ann-field textarea, .ann-field input[type=date], .ann-field input[type=number] {
  width: 100%; border: 1px solid var(--border); border-radius: 8px;
  padding: 0.5rem 0.65rem; font-size: 0.95rem; font-family: inherit; color: var(--text);
}
.ann-classes { display: flex; flex-direction: column; gap: 0.35rem; }
.ann-class {
  display: flex; align-items: center; gap: 0.55rem; cursor: pointer;
  padding: 0.4rem 0.55rem; border-radius: 8px; font-size: 0.92rem;
  border: 1px solid var(--blue-pale);
}
.ann-class:hover { background: var(--blue-pale); }
.ann-class input { width: auto; cursor: pointer; }

.ann-field-row { display: flex; gap: 0.9rem; }
.ann-field-row .ann-field { flex: 1; }
.ann-field-row .ann-field-sm { flex: 0 0 9rem; }
.ann-date-row { display: flex; flex-direction: column; gap: 0.4rem; }
.ann-now-btn {
  border: 1px solid var(--blue-light); background: var(--blue-pale); color: var(--blue);
  border-radius: 8px; padding: 0.35rem 0.6rem; font-size: 0.82rem; font-weight: 600;
  cursor: pointer; font-family: inherit;
}
.ann-now-btn:hover { background: #dde8ff; }
.ann-lessons-row { display: flex; align-items: center; gap: 0.5rem; }
.ann-lessons-row input { width: 4.5rem; }
.ann-hint { font-size: 0.85rem; color: var(--muted); }

.ann-submit {
  width: 100%; background: var(--blue); color: #fff; border: none; border-radius: 8px;
  padding: 0.6rem; font-size: 0.95rem; font-weight: 700; cursor: pointer;
  font-family: inherit; margin-top: 0.3rem; transition: background .15s;
}
.ann-submit:hover { background: var(--blue-light); }

.ann-list-hdr {
  font-size: 0.8rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); margin-bottom: 0.7rem;
}
.ann-list-hdr-sub { margin-top: 1.6rem; }
.ann-ro {
  font-size: 0.62rem; background: #ddd; color: #555; border-radius: 999px;
  padding: 0.08rem 0.45rem; margin-left: 0.3rem; vertical-align: middle;
}
.ann-empty { color: var(--muted); font-style: italic; }

.ann-card {
  background: var(--white); border: 1px solid var(--border); border-radius: 12px;
  padding: 1rem 1.15rem; margin-bottom: 0.8rem; box-shadow: var(--shadow);
}
.ann-card-editing { border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue-pale); }
.ann-card-text { font-size: 1.02rem; color: var(--text); margin-bottom: 0.55rem; line-height: 1.4; }
.ann-card-meta { display: flex; gap: 0.45rem; flex-wrap: wrap; margin-bottom: 0.55rem; }
.ann-meta-pill {
  font-size: 0.74rem; font-weight: 600; color: var(--blue);
  background: var(--blue-pale); border-radius: 999px; padding: 0.12rem 0.6rem;
}
.ann-card-classes { display: flex; gap: 0.35rem; flex-wrap: wrap; margin-bottom: 0.7rem; }
.ann-chip {
  font-size: 0.7rem; font-weight: 700; color: #fff; background: var(--blue-light);
  border-radius: 6px; padding: 0.1rem 0.45rem;
}
.ann-card-actions { display: flex; align-items: center; gap: 0.8rem; }
.ann-edit { font-size: 0.85rem; font-weight: 700; }
.ann-delete {
  background: none; border: none; color: #c0392b; font-size: 0.85rem; font-weight: 700;
  cursor: pointer; padding: 0; font-family: inherit;
}
.ann-delete:hover { text-decoration: underline; }
.ann-card-quiz { background: #fafbff; border-style: dashed; }

@media (max-width: 760px) { .ann-layout { grid-template-columns: 1fr; } }

/* ── New-lesson button (planner) ─────────────────────────────────────────── */
.pln-new-drag { cursor: grab; user-select: none; display: flex; align-items: center; justify-content: center; gap: .4rem; }
.pln-new-drag:active { cursor: grabbing; }
.pln-new-hint { font-size: .68rem; font-weight: 500; opacity: .75; }
.pln-new-full { display: inline-block; margin-top: .35rem; font-size: .72rem; color: var(--muted); }

/* ── New-lesson modal ────────────────────────────────────────────────────── */
.nl-overlay {
  position: fixed; inset: 0; background: rgba(26,26,46,0.45);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 3rem 1rem; z-index: 1000; overflow-y: auto;
}
.nl-overlay[hidden] { display: none; }
.nl-modal {
  background: var(--white); border-radius: 14px; width: 100%; max-width: 560px;
  box-shadow: 0 12px 48px rgba(0,0,0,0.30); overflow: hidden;
}
.nl-hdr {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 1.1rem 1.4rem; border-bottom: 1px solid var(--blue-pale); background: var(--blue-pale);
}
.nl-title { font-size: 1.2rem; font-weight: 800; color: var(--blue); }
.nl-sub { font-size: .82rem; color: var(--muted); margin-top: .2rem; }
.nl-x {
  background: none; border: none; font-size: 1.6rem; line-height: 1; color: var(--muted);
  cursor: pointer; padding: 0 .2rem;
}
.nl-x:hover { color: var(--text); }
.nl-body { padding: 1.2rem 1.4rem; }
.nl-field { margin-bottom: .85rem; }
.nl-field > label {
  display: block; font-size: .74rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; color: var(--muted); margin-bottom: .3rem;
}
.nl-req { color: #c0392b; }
.nl-dash {
  font-size: .58rem; font-weight: 800; text-transform: uppercase; letter-spacing: .03em;
  color: #1d6f42; background: #e3f5ea; border: 1px solid #b6e0c6;
  border-radius: 999px; padding: .04rem .4rem; margin-left: .25rem;
}
.nl-field input[type=text], .nl-field input[type=url], .nl-field input[type=number],
.nl-field select, .nl-field textarea {
  width: 100%; border: 1px solid var(--border); border-radius: 8px;
  padding: .45rem .6rem; font-size: .92rem; font-family: inherit; color: var(--text);
}
.nl-row { display: flex; gap: .8rem; }
.nl-grow { flex: 1; }
.nl-num { flex: 0 0 6.5rem; }
.nl-targets {
  display: flex; flex-direction: column; gap: .3rem;
  max-height: 130px; overflow-y: auto;
  border: 1px solid var(--blue-pale); border-radius: 8px; padding: .5rem .6rem;
}
.nl-target { display: flex; align-items: flex-start; gap: .45rem; font-size: .88rem; cursor: pointer; }
.nl-target input { margin-top: .2rem; }
.nl-tseq { font-weight: 700; color: var(--blue); }
.nl-muted { color: var(--muted); font-style: italic; font-size: .82rem; margin: 0; }
.nl-actions { display: flex; justify-content: flex-end; gap: .7rem; margin-top: 1.1rem; }
.nl-cancel-btn {
  background: none; border: 1px solid var(--border); border-radius: 8px;
  padding: .5rem 1rem; font-size: .9rem; font-weight: 600; cursor: pointer; font-family: inherit; color: var(--muted);
}
.nl-submit {
  background: var(--blue); color: #fff; border: none; border-radius: 8px;
  padding: .5rem 1.2rem; font-size: .9rem; font-weight: 700; cursor: pointer; font-family: inherit;
}
.nl-submit:hover { background: var(--blue-light); }
.nl-submit:disabled { opacity: .6; cursor: default; }

/* ── Standards index (collapsible by course / unit) ──────────────────────── */
.std-course { margin-bottom: 1rem; }
.std-course-hdr {
  display: flex; align-items: center; gap: .55rem; cursor: pointer; list-style: none;
  font-size: 1.15rem; font-weight: 700; color: var(--blue);
  border-bottom: 2px solid var(--blue-pale); padding: .35rem 0;
}
.std-course-hdr::-webkit-details-marker { display: none; }
.std-course-name { flex: 1; }

.std-unit { margin: .55rem 0 .55rem .35rem; }
.std-unit-hdr {
  display: flex; align-items: center; gap: .5rem; cursor: pointer; list-style: none;
  font-size: .92rem; font-weight: 600; color: var(--muted); padding: .3rem 0;
}
.std-unit-hdr::-webkit-details-marker { display: none; }
.std-unit-name { flex: 1; }

.std-caret {
  flex-shrink: 0; width: .65rem; color: var(--blue-light);
  transition: transform .15s; display: inline-block;
}
.std-caret::before { content: '▸'; font-size: .8rem; }
details[open] > summary > .std-caret { transform: rotate(90deg); }

.std-count {
  flex-shrink: 0; background: var(--blue-pale); color: var(--blue);
  font-size: .72rem; font-weight: 700; border-radius: 999px; padding: .05rem .5rem;
}
.std-count-sm { background: #eef1f6; color: var(--muted); font-size: .68rem; }

.std-unit .std-list { margin-left: 1.15rem; }
