:root {
  --bg: #eef4f6;
  --surface: #ffffff;
  --surface-alt: #f2f8f9;
  --border: #d3e3e7;
  --text: #0f2a30;
  --muted: #5c7982;
  --accent: #1f7a8c;
  --accent-dark: #0b3d42;
  --accent-light: #4fb3bf;
  --blue: #2c6693;
  --success: #1f8a70;
  --warning: #c9862b;
  --progress: linear-gradient(90deg, var(--blue), var(--accent-light));
  --meter-track: #d3e9ec;
  --sidebar-width: 232px;
  --shadow-sm: 0 1px 2px rgba(11, 61, 66, 0.06), 0 1px 4px rgba(11, 61, 66, 0.08);
  --shadow-md: 0 4px 14px rgba(11, 61, 66, 0.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.app-shell {
  display: flex;
  align-items: flex-start;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--accent-dark), #0a2e33);
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar .brand {
  font-weight: 700;
  font-size: 1.02rem;
  color: #fff;
  text-decoration: none;
  margin-bottom: 1.5rem;
  display: block;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-bottom: 1.25rem;
}

.sidebar-nav a {
  color: #cfe8ec;
  text-decoration: none;
  padding: 0.5rem 0.6rem;
  border-radius: 7px;
  font-size: 0.89rem;
}

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

.sidebar-child {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-top: 1rem;
  margin-top: 0.25rem;
  flex: 1;
}

.sidebar-child select#child-switcher {
  width: 100%;
  margin-bottom: 0.75rem;
  padding: 0.45rem 0.5rem;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-weight: 600;
  font-size: 0.88rem;
}

.sidebar-child-nav { display: flex; flex-direction: column; gap: 0.1rem; }

.sidebar-child-nav a {
  color: #cfe8ec;
  text-decoration: none;
  padding: 0.45rem 0.6rem;
  border-radius: 7px;
  font-size: 0.86rem;
}

.sidebar-child-nav a:hover { background: rgba(255, 255, 255, 0.09); color: #fff; }
.sidebar-child-nav a.active { background: rgba(255, 255, 255, 0.18); color: #fff; font-weight: 600; }

.sidebar-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-top: 0.75rem;
  margin-top: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  gap: 0.5rem;
}

.sidebar-footer a { color: #cfe8ec; text-decoration: none; }
.sidebar-footer a:hover { color: #fff; }
.sidebar-footer .muted { color: #9fc3c9; }

.app-main {
  flex: 1;
  min-width: 0;
  padding: 2rem 2.25rem 1rem;
  max-width: 1200px;
}

@media (max-width: 820px) {
  .app-shell { flex-direction: column; }
  .sidebar {
    width: 100%;
    height: auto;
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
  }
  .sidebar .brand { margin-bottom: 0; }
  .sidebar-nav { flex-direction: row; flex-wrap: wrap; margin-bottom: 0; }
  .sidebar-child {
    border-top: none;
    padding-top: 0;
    margin-top: 0;
    flex-basis: 100%;
    order: 3;
  }
  .sidebar-child-nav { flex-direction: row; flex-wrap: wrap; }
  .sidebar-footer { border-top: none; padding-top: 0; margin-top: 0; margin-left: auto; }
  .app-main { padding: 1.25rem; }
}

h1 { margin-top: 0; }

.muted { color: var(--muted); font-size: 0.9em; }

.error {
  background: #fdecea;
  color: #9b2c2c;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  border: 1px solid #f3c2c2;
}

.success {
  background: #e9f7f0;
  color: #1f6b4d;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  border: 1px solid #b9e6cf;
}

.auth-box {
  max-width: 380px;
  margin: 2rem auto;
  background: var(--surface);
  padding: 1.5rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}

form label {
  display: block;
  margin-bottom: 0.9rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.field-label {
  font-size: 0.9rem;
  margin: 0 0 0.3rem;
}

.cascading-select {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 0.9rem;
}

.cascading-select label { flex: 1; margin-bottom: 0; }
.cascading-select select { width: 100%; }

form input[type="text"],
form input[type="email"],
form input[type="password"],
form input[type="date"] {
  display: block;
  width: 100%;
  margin-top: 0.3rem;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 1rem;
  color: var(--text);
  background: var(--surface);
}

button, .link-button {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0.5rem 0.9rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
}

button:hover, .link-button:hover { background: var(--accent-dark); }

.link-button {
  background: transparent;
  color: #9b2c2c;
  padding: 0.3rem 0.4rem;
}

form.inline {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
}

.child-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.child-card h2 a { color: var(--accent-dark); text-decoration: none; }

.progress-bar {
  background: var(--meter-track);
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
  margin: 0.6rem 0 0.3rem;
}

.progress-bar-fill {
  background: var(--progress);
  height: 100%;
}

.child-card-links { font-size: 0.85rem; }
.child-card-links a { color: var(--accent); text-decoration: none; }
.child-card-links a:hover { text-decoration: underline; }

.domain-list {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.25rem 1rem;
  font-size: 0.9rem;
}

.curriculum-controls {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.curriculum-controls input[type="search"] {
  flex: 1 1 260px;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.9rem;
}

.curriculum-controls button {
  background: var(--surface);
  color: var(--accent-dark);
  border: 1px solid var(--border);
  font-size: 0.82rem;
  padding: 0.4rem 0.7rem;
}

.curriculum-controls button:hover { background: var(--surface-alt); }

details.domain {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 0.6rem;
  padding: 0 0.9rem;
}

details.domain summary {
  cursor: pointer;
  padding: 0.65rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--accent-dark);
  list-style: none;
}

details.domain summary::-webkit-details-marker { display: none; }
details.domain summary::before {
  content: '▸';
  margin-right: 0.5rem;
  color: var(--accent);
  display: inline-block;
  transition: transform 0.1s;
}
details.domain[open] summary::before { transform: rotate(90deg); }
details.domain summary .domain-name { flex: 1; }
details.domain summary .domain-pct { font-weight: 400; font-size: 0.8rem; }

.category { margin: 0.5rem 0 1rem 1.4rem; }
.category h3 { margin: 0.6rem 0 0.35rem; font-size: 0.85rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.02em; }

.items { list-style: none; padding: 0; margin: 0; }

.item {
  border-bottom: 1px solid var(--border);
}
.item:last-child { border-bottom: none; }

.item-toggle {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  padding: 0.4rem 0.2rem;
  cursor: pointer;
  color: var(--text);
  font-size: 0.88rem;
}

.item-toggle:hover { background: var(--surface-alt); }

.item-name { flex: 1; }

.stage-pill {
  font-size: 0.7rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  color: #fff;
  white-space: nowrap;
  flex-shrink: 0;
}

.stage-pill.stage-not_started { background: var(--muted); }
.stage-pill.stage-learning    { background: var(--blue); }
.stage-pill.stage-practicing  { background: var(--accent-light); color: var(--text); }
.stage-pill.stage-applying    { background: var(--accent); }
.stage-pill.stage-teaching    { background: var(--warning); }
.stage-pill.stage-reflected   { background: var(--success); }

.item-edit {
  padding: 0.5rem 0.2rem 0.75rem;
  background: var(--surface-alt);
  border-radius: 0 0 6px 6px;
}

.item-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.item-form select {
  padding: 0.3rem 0.4rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  font-size: 0.85rem;
}

.item-form input[type="text"] {
  flex: 1 1 160px;
  padding: 0.3rem 0.4rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  font-size: 0.85rem;
}

.item-form button {
  font-size: 0.82rem;
  padding: 0.3rem 0.6rem;
}

.admin-list { list-style: none; padding: 0; }
.admin-list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.domain-editor {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.name-input-lg { font-weight: 700; font-size: 1.05rem; }

.category-editor {
  margin: 0.75rem 0 0.75rem 0.75rem;
  padding-left: 0.75rem;
  border-left: 2px solid var(--accent-light);
  background: var(--surface-alt);
  border-radius: 0 6px 6px 0;
}

.item-editor-list { list-style: none; padding: 0; margin: 0.5rem 0; }
.item-editor-list li {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding: 0.25rem 0;
}

.row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.5rem; }

.add-category-form { margin-top: 0.75rem; }

.site-footer {
  text-align: center;
  padding: 1.5rem;
  color: var(--muted);
  font-size: 0.85rem;
}

/* Resources attached to a curriculum item */
.resource-list {
  list-style: none;
  margin: 0.4rem 0 0;
  padding: 0 0 0 0.25rem;
  font-size: 0.85rem;
}

.resource-list li { margin-bottom: 0.2rem; }
.resource-list a { color: var(--accent); }

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

.resource-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
}

.resource-form h3 { margin-top: 0; font-size: 1rem; color: var(--accent-dark); }
.resource-form textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.5rem;
  font-family: inherit;
}

/* Journal */
.journal-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
  max-width: 520px;
  margin-bottom: 1.5rem;
}

.journal-form select,
.journal-form textarea {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
  font-size: 1rem;
}

.journal-entry {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent-light);
  border-radius: 8px;
  padding: 0.9rem 1.1rem;
  margin-bottom: 0.75rem;
}

/* Portfolio */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
}

.portfolio-item {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
}

.portfolio-item img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
  background: var(--surface-alt);
}

.portfolio-file-icon {
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  background: var(--surface-alt);
}

.portfolio-caption {
  padding: 0.5rem 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.85rem;
}

/* Weekly schedule */
.week-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.week-nav a { color: var(--accent); text-decoration: none; }

.week-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.week-day {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem;
  min-height: 100px;
}

.week-day h3 { margin: 0 0 0.5rem; font-size: 0.85rem; color: var(--accent-dark); }
.week-day ul { list-style: none; padding: 0; margin: 0; }
.week-day li {
  border-left: 3px solid var(--border);
  padding: 0.3rem 0.5rem;
  margin-bottom: 0.4rem;
  font-size: 0.82rem;
  background: var(--surface-alt);
  border-radius: 0 4px 4px 0;
}

.week-day li.stage-learning    { border-left-color: var(--blue); }
.week-day li.stage-practicing  { border-left-color: var(--accent-light); }
.week-day li.stage-applying    { border-left-color: var(--accent); }
.week-day li.stage-teaching    { border-left-color: var(--warning); }
.week-day li.stage-reflected   { border-left-color: var(--success); }

/* Reports */
.report-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.report-controls form { display: flex; gap: 0.75rem; align-items: end; }
.report-controls label { font-size: 0.85rem; color: var(--muted); }
.report-controls input[type="date"] { display: block; margin-top: 0.2rem; }

.report {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: var(--shadow-sm);
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.report-table th, .report-table td {
  text-align: left;
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid var(--border);
}

.report-table th { color: var(--accent-dark); }

.records-breadcrumb { margin: 0; font-size: 0.9rem; }

.records-year-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.75rem;
}

.records-year-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  color: var(--text);
  text-decoration: none;
}

.records-year-card:hover { border-color: var(--accent); }

.records-year-card-title { font-weight: 600; margin-bottom: 0.35rem; }
.records-year-card-stats { font-size: 0.85rem; }
.records-year-card-alltime { border-style: dashed; }

/* Per-child dashboard */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.dashboard-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.dashboard-card h2 { margin-top: 0; font-size: 1.05rem; color: var(--accent-dark); }

.dashboard-list { list-style: none; padding: 0; margin: 0 0 0.5rem; font-size: 0.88rem; }
.dashboard-list li { padding: 0.3rem 0; border-bottom: 1px solid var(--border); }
.dashboard-list li:last-child { border-bottom: none; }

/* Year plan */
.year-switcher {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.year-switcher a {
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  text-decoration: none;
  color: var(--text);
  font-size: 0.85rem;
  background: var(--surface);
}

.year-switcher a.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.year-switcher a.active .muted { color: #d8ebee; }

.add-year-details {
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
}

.add-year-details summary {
  cursor: pointer;
  color: var(--accent);
}

/* Year Plan — domain > category > item browse/plan tree */
.year-plan-tree { display: flex; flex-direction: column; gap: 0.5rem; }

.year-plan-domain {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.25rem 0.75rem 0.5rem;
}

.year-plan-domain > summary {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0;
  font-weight: 600;
}

.year-plan-category {
  margin: 0.75rem 0 0.35rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.year-plan-items { list-style: none; padding: 0; margin: 0 0 0.25rem; }

.year-plan-item {
  border-bottom: 1px solid var(--border);
  border-left: 4px solid transparent;
  padding-left: 0.5rem;
  transition: background-color 0.9s ease;
}

.year-plan-item.just-updated { background-color: var(--surface-alt); }

#assign-work-toast {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 100;
  background: var(--text);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  font-size: 0.88rem;
  box-shadow: var(--shadow-sm);
  opacity: 0;
  transform: translateY(0.5rem);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

#assign-work-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.year-plan-item:last-child { border-bottom: none; }

/* Color-coded by actual progress stage, same vocabulary as .stage-pill */
.year-plan-item.stage-learning    { border-left-color: var(--blue); }
.year-plan-item.stage-practicing  { border-left-color: var(--accent-light); }
.year-plan-item.stage-applying    { border-left-color: var(--accent); }
.year-plan-item.stage-teaching    { border-left-color: var(--warning); }
.year-plan-item.stage-reflected   { border-left-color: var(--success); }

.year-plan-item-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.85rem;
  padding: 0.5rem 0;
  font-size: 0.88rem;
}

.year-plan-item.is-planned .year-plan-item-row { background: transparent; }

.year-plan-toggle {
  width: 1.15rem;
  height: 1.15rem;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}

.year-plan-toggle.is-on {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.year-plan-item-name { flex: 1; min-width: 10rem; }

.year-plan-target select { font-size: 0.85rem; }

.year-plan-add-assignment {
  margin-left: auto;
  background: none;
  border: 1px solid var(--accent);
  color: var(--accent-dark);
  border-radius: 6px;
  padding: 0.2rem 0.55rem;
  font-size: 0.78rem;
  cursor: pointer;
  white-space: nowrap;
}
.year-plan-add-assignment:hover { background: var(--surface-alt); }

.year-plan-item-assignments {
  padding: 0 0 0.5rem 2rem;
  font-size: 0.85rem;
}

.year-plan-item-assignments .admin-list { margin: 0; }

dialog.assign-modal {
  border: none;
  border-radius: 10px;
  padding: 1.25rem;
  max-width: 480px;
  width: 90vw;
  box-shadow: var(--shadow-sm);
}
dialog.assign-modal::backdrop { background: rgba(15, 42, 48, 0.5); }
dialog.assign-modal h3 { margin-top: 0; }
dialog.assign-modal label { display: block; margin-bottom: 0.6rem; }
dialog.assign-modal input, dialog.assign-modal select {
  display: block;
  width: 100%;
  margin-top: 0.2rem;
  padding: 0.4rem;
  border: 1px solid var(--border);
  border-radius: 6px;
}
dialog.assign-modal .modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

/* Grades */
.grade-form { max-width: 420px; }
.grade-inputs-row { display: flex; gap: 0.6rem; }
.grade-inputs-row label { flex: 1; }
.grade-inputs-row input { width: 100%; padding: 0.5rem; border: 1px solid var(--border); border-radius: 6px; }

/* Instructor assignment (dashboard card) */
.assign-instructor-form {
  display: flex;
  gap: 0.4rem;
  margin: 0.6rem 0;
  flex-wrap: wrap;
}

.assign-instructor-form select,
.assign-instructor-form input[type="text"] {
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.85rem;
}

.assign-instructor-form select { flex: 1 1 140px; }
.assign-instructor-form input[type="text"] { flex: 1 1 110px; }

/* Stat tiles */
.stat-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.1rem 1.25rem;
  box-shadow: var(--shadow-sm);
}

.stat-tile .stat-label {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0 0 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.stat-tile .stat-value {
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--accent-dark);
  line-height: 1.1;
}

.stat-tile .stat-sub {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.3rem;
}

/* Progress ring (SVG donut) */
.progress-ring-wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.progress-ring { width: 104px; height: 104px; flex-shrink: 0; }
.progress-ring-track { fill: none; stroke: var(--meter-track); stroke-width: 10; }
.progress-ring-fill {
  fill: none;
  stroke: var(--accent);
  stroke-width: 10;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
}
.progress-ring-text {
  font-size: 1.3rem;
  font-weight: 700;
  fill: var(--accent-dark);
  font-family: inherit;
  text-anchor: middle;
  dominant-baseline: middle;
}

/* Quick actions */
.quick-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.quick-actions a, .quick-actions button {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  font-size: 0.85rem;
}

.quick-action-secondary {
  background: var(--surface);
  color: var(--accent-dark);
  border: 1px solid var(--border);
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
}

.quick-action-secondary:hover { background: var(--surface-alt); }

/* AI Aid panel */
.ai-aid-panel textarea {
  width: 100%;
  padding: 0.6rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
}

.ai-aid-response {
  background: var(--surface-alt);
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  padding: 0.8rem 1rem;
  margin-top: 0.75rem;
  font-size: 0.9rem;
  white-space: pre-wrap;
}

.ai-aid-setup-note {
  font-size: 0.85rem;
  color: var(--muted);
  background: var(--surface-alt);
  border-radius: 8px;
  padding: 0.75rem 1rem;
}

.ai-aid-response hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0.6rem 0;
}

.ai-aid-response code, .ai-aid-setup-note code {
  background: var(--surface);
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
  font-size: 0.85em;
}

/* Quick lesson form (dashboard) */
.quick-lesson-form { display: flex; flex-direction: column; gap: 0.6rem; }
.quick-lesson-form input[type="text"],
.quick-lesson-form input[type="url"],
.quick-lesson-form select.lesson-type-select,
.quick-lesson-form textarea,
.quick-lesson-form input[type="file"] {
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.9rem;
}


.print-only { display: none; }

@media print {
  .sidebar, .no-print, .site-footer { display: none !important; }
  .print-only { display: inline; }
  body { background: #fff; }
  .app-shell { display: block; }
  .app-main { max-width: 100%; padding: 0; }
  .report { border: none; padding: 0; box-shadow: none; }
}

/* Kid learning view — friendlier, bigger, simpler */
.learn-view { max-width: 640px; }

.learn-greeting { font-size: 2rem; margin-bottom: 0.1rem; }
.learn-sub { color: var(--muted); margin-top: 0; margin-bottom: 1.5rem; font-size: 1.05rem; }

.learn-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.learn-card-today {
  border: 2px solid var(--accent);
  box-shadow: var(--shadow-md);
}

.learn-card-date {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.learn-card-title { font-size: 1.4rem; margin: 0.3rem 0 0.5rem; }
.learn-card-stage { margin: 0 0 0.75rem; }

.learn-resource-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  font-size: 0.95rem;
}

.learn-resource-list li { margin-bottom: 0.4rem; }

.learn-advance-btn {
  font-size: 1.05rem;
  padding: 0.75rem 1.25rem;
  border-radius: 10px;
  width: 100%;
}

.learn-done {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--success);
}

/* Shared checkbox lists (event roster picker, calendar type filters) */
.checkbox-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  margin: 0.4rem 0 0.9rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.88rem;
  font-weight: 400;
}

/* Event type badges (events.php list + detail) */
.event-type-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  color: #fff;
  white-space: nowrap;
}

.event-type-badge.event-type-project    { background: var(--blue); }
.event-type-badge.event-type-field_trip { background: var(--accent); }
.event-type-badge.event-type-meetup     { background: var(--warning); }
.event-type-badge.event-type-other      { background: var(--muted); }

/* Shared calendar */
.calendar-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.calendar-nav a { color: var(--accent); text-decoration: none; }

.calendar-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.calendar-filters label { font-size: 0.88rem; color: var(--muted); }
.calendar-filters select { display: block; margin-top: 0.2rem; }
.calendar-filters .checkbox-list { margin: 0; }
.calendar-filters button { font-size: 0.85rem; padding: 0.4rem 0.8rem; }

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.calendar-day-header {
  background: var(--accent-dark);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  text-align: center;
  padding: 0.4rem 0;
}

.calendar-day {
  background: var(--surface);
  min-height: 96px;
  padding: 0.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.calendar-day-outside { background: var(--surface-alt); }
.calendar-day-outside .calendar-day-number { color: var(--muted); }

.calendar-day-today { box-shadow: inset 0 0 0 2px var(--accent); }

.calendar-day-number { font-size: 0.8rem; font-weight: 600; color: var(--accent-dark); }

.calendar-pill {
  display: block;
  font-size: 0.72rem;
  padding: 0.15rem 0.4rem;
  border-radius: 5px;
  color: #fff;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-pill-schedule   { background: var(--accent-light); color: var(--text); }
.calendar-pill-project    { background: var(--blue); }
.calendar-pill-field_trip { background: var(--accent); }
.calendar-pill-meetup     { background: var(--warning); }
.calendar-pill-other      { background: var(--muted); }

@media (max-width: 820px) {
  .calendar-grid { grid-template-columns: repeat(7, minmax(38px, 1fr)); }
  .calendar-day { min-height: 60px; font-size: 0.8rem; }
  .calendar-pill { font-size: 0.62rem; }
}

/* Course Work — excel-style report table */
.table-scroll {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
}

.coursework-table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.coursework-table th, .coursework-table td {
  text-align: left;
  padding: 0.5rem 0.7rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.coursework-table th {
  color: var(--accent-dark);
  background: var(--surface-alt);
  position: sticky;
  top: 0;
}

.coursework-table td:nth-child(5) { white-space: normal; min-width: 160px; }
.coursework-table tbody tr:hover { background: var(--surface-alt); }
.coursework-table a { color: var(--accent); text-decoration: none; }
.coursework-table a:hover { text-decoration: underline; }
