/* Layout — student explore + dashboards */
.app-shell { max-width: 1280px; margin: 0 auto; padding: 16px 20px; }

.dash-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 1.25rem;
}
.dash-kpi {
  background: var(--brand-surface);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow-soft);
}
.dash-kpi .val { font-size: 1.75rem; font-weight: 700; color: var(--brand-primary-strong); }
.dash-kpi .lbl { font-size: 0.8rem; color: var(--brand-muted); margin-top: 0.2rem; }

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}
.analytics-card {
  background: var(--brand-surface);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem 1rem;
  box-shadow: var(--shadow-soft);
}
.analytics-card-split { grid-column: 1 / -1; }
.analytics-title {
  margin: 0 0 0.65rem;
  font-size: 0.95rem;
  font-weight: 650;
  color: var(--brand-primary-strong);
}
.chart-wrap {
  position: relative;
  height: 240px;
  width: 100%;
}
.chart-wrap-bar { height: 280px; }
.chart-activity-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}
@media (min-width: 900px) {
  .analytics-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.unit-grid {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  width: 100%;
}
.unit-card {
  width: 100%;
  background: var(--brand-surface);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius);
  padding: 1.35rem 1.5rem 1.5rem;
  box-shadow: var(--shadow-soft);
}
.unit-card h3 {
  font-size: 1.65rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--brand-primary-strong);
  margin-bottom: 0.4rem;
}
.unit-card > .subtitle {
  font-size: 0.95rem;
  margin-bottom: 0.85rem;
}
.progress-bar {
  height: 8px;
  background: #e5efe8;
  border-radius: 4px;
  overflow: hidden;
  margin: 0.55rem 0 0.85rem;
}
.progress-bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--brand-accent), var(--brand-primary));
  border-radius: 4px;
  transition: width 0.3s;
}
.exercise-list {
  list-style: none;
  margin-top: 0.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.exercise-list li {
  padding: 0.95rem 1.1rem;
  border: 1px solid var(--brand-border);
  border-radius: 8px;
  background: #f8fcfa;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-size: 1rem;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.exercise-list li:hover {
  border-color: var(--brand-accent);
  background: #fff;
  box-shadow: 0 4px 14px rgba(47, 122, 95, 0.08);
}
.exercise-list li > span:first-child {
  flex: 1;
  min-width: 0;
  font-weight: 500;
  color: var(--brand-text);
  line-height: 1.4;
}
.badge {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  background: #eef2f0;
  color: var(--brand-muted);
  white-space: nowrap;
  flex-shrink: 0;
}
.badge.idle { background: #eef2f0; color: #5f7268; }
.badge.done { background: #e8f5ee; color: var(--brand-primary-strong); }
.badge.active { background: #fff8e6; color: #9a6b00; }

.suggestion-cell { min-width: 240px; vertical-align: top; }
.suggestion-input { min-height: 72px; font-size: 0.9rem; }
.suggestion-item {
  background: #f8fcfa;
  border: 1px solid var(--brand-border);
  border-radius: 6px;
  padding: 0.45rem 0.55rem;
  margin-bottom: 0.4rem;
  font-size: 0.85rem;
  white-space: pre-wrap;
}
.suggestion-item:last-child { margin-bottom: 0; }
.general-suggestion {
  background: var(--brand-surface);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-soft);
}
.general-suggestion h3 {
  margin: 0 0 0.35rem;
  color: var(--brand-primary-strong);
  font-size: 1.05rem;
}

.explore-layout {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(340px, 1.4fr) minmax(240px, 0.9fr);
  gap: 14px;
  align-items: start;
}
@media (max-width: 1000px) {
  .explore-layout { grid-template-columns: 1fr; }
}
.workbook-panel {
  background: #fffef8;
  border: 1px solid #e8e4d4;
  border-radius: var(--radius);
  padding: 1rem;
  max-height: 70vh;
  overflow-y: auto;
  font-size: 0.9rem;
  line-height: 1.5;
  white-space: pre-wrap;
  color: #2a2a2a;
}
.workbook-panel h4 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--brand-muted);
  margin-bottom: 0.5rem;
}
.workbook-answers .entry {
  background: #f8fcfa;
  border: 1px solid var(--brand-border);
  border-left: 3px solid var(--brand-primary);
  border-radius: 6px;
  padding: 0.65rem 0.75rem;
  margin-bottom: 0.5rem;
  font-size: 0.88rem;
}
.workbook-answers .entry .lbl { font-weight: 600; color: var(--brand-primary-strong); font-size: 0.8rem; }
.workbook-answers .entry .txt { margin-top: 0.25rem; white-space: pre-wrap; }

.admin-tabs { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.admin-tab {
  padding: 0.45rem 0.9rem;
  border-radius: 4px;
  border: 1px solid var(--brand-border);
  background: #f7fbf8;
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--brand-muted);
}
.admin-tab.active { background: var(--brand-primary); color: #fff; border-color: var(--brand-primary); }
.admin-panel { display: none; }
.admin-panel.active { display: block; }

.import-html-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  width: 100%;
  margin-bottom: 0.75rem;
}
.import-html-form > .form-control {
  width: 100%;
}
.import-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem 1rem;
  width: 100%;
}
.import-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}
.import-field .form-control,
.import-field select {
  width: 100%;
}
.import-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.exercises-import-block {
  margin-bottom: 1.25rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--brand-border);
}
@media (max-width: 800px) {
  .import-grid { grid-template-columns: 1fr; }
}
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--brand-surface);
  border-radius: var(--radius);
  max-width: 720px;
  width: 100%;
  max-height: 85vh;
  overflow: auto;
  padding: 1.25rem;
  box-shadow: var(--shadow-soft);
}
.modal-box textarea { min-height: 280px; font-family: ui-monospace, monospace; font-size: 0.8rem; }

.nav-links { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
