/* GuardRAIl Teacher Dashboard - Modern EdTech Design */
/* Inspired by: Google Classroom, Canvas, Schoology, Seesaw, ClassDojo */

/* Design tokens are loaded via <link> tag in dashboard.html */

/* === RESET === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* === BASE === */
body {
  font-family: var(--font-family);
  background: var(--color-background-alt);
  color: var(--color-foreground);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
}

#root {
  min-height: 100vh;
}

/* === AUTH PAGE === */
.auth-container {
  max-width: 420px;
  margin: 4rem auto;
  padding: var(--space-8);
  background: var(--color-card);
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-border-subtle);
  box-shadow: var(--shadow-lg);
}

.auth-title {
  margin-bottom: var(--space-6);
  text-align: center;
  font-size: 24px;
  font-weight: var(--font-weight-bold);
  color: var(--color-foreground);
  letter-spacing: var(--letter-spacing-tight);
}

.auth-tabs {
  margin-bottom: var(--space-5);
  display: flex;
  gap: var(--space-2);
  justify-content: center;
}

.auth-tab {
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--color-border);
  background: var(--color-background);
  color: var(--color-foreground-muted);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  font-family: var(--font-family);
  transition: all var(--transition-base);
}

.auth-tab.active {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

.auth-tab:hover:not(.active) {
  background: var(--color-background-alt);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.auth-tab:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.auth-form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.auth-label {
  display: block;
  font-size: 11px;
  font-weight: var(--font-weight-semibold);
  color: var(--color-foreground-muted);
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-wide);
}

.auth-input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--color-background-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-foreground);
  font-size: var(--font-size-base);
  font-family: var(--font-family);
  transition: all var(--transition-base);
}

.auth-input:focus {
  outline: none;
  background: var(--color-background);
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-lighter);
}

.auth-input::placeholder {
  color: var(--color-foreground-subtle);
}

.auth-error {
  padding: var(--space-3) var(--space-4);
  background: var(--color-error-light);
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--color-error);
  font-weight: var(--font-weight-medium);
}

.auth-message {
  padding: var(--space-3) var(--space-4);
  background: var(--color-secondary-light);
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--color-secondary);
  font-weight: var(--font-weight-medium);
}

.auth-button {
  width: 100%;
  padding: var(--space-3) var(--space-5);
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  font-family: var(--font-family);
  cursor: pointer;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-sm);
}

.auth-button:hover:not(:disabled) {
  background: var(--color-primary-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.auth-button:active:not(:disabled) {
  background: var(--color-primary-active);
  transform: translateY(0);
}

.auth-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.auth-button:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* === APP SHELL (Bento reference: sidebar + main) === */
.app-shell {
  display: flex;
  min-height: 100vh;
  background: var(--color-background-alt);
}

.app-sidebar {
  width: 240px;
  min-width: 240px;
  background: var(--color-card);
  border-right: 1px solid var(--color-border-subtle);
  display: flex;
  flex-direction: column;
  padding: var(--space-5) 0;
}

.app-sidebar-logo {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  color: var(--color-foreground);
  letter-spacing: var(--letter-spacing-tight);
  padding: 0 var(--space-5);
  margin-bottom: var(--space-6);
}

.app-sidebar-nav {
  padding: 0 var(--space-3);
  margin-bottom: var(--space-4);
}

.app-sidebar-section-label {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--color-foreground-muted);
  letter-spacing: var(--letter-spacing-wide);
  padding: var(--space-2) var(--space-3);
  margin-bottom: var(--space-1);
}

.app-sidebar-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--color-foreground-muted);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  font-family: var(--font-family);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
  text-align: left;
}

.app-sidebar-item:hover {
  background: var(--color-background-alt);
  color: var(--color-foreground);
}

.app-sidebar-item.active {
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.app-sidebar-item .app-sidebar-icon {
  flex-shrink: 0;
  opacity: 0.9;
  color: currentColor;
}

.app-sidebar-footer {
  margin-top: auto;
  padding: var(--space-4) var(--space-4) 0;
}

.app-sidebar-card {
  background: var(--color-background-alt);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}

.app-sidebar-card-title {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-foreground);
  margin-bottom: var(--space-1);
}

.app-sidebar-card-desc {
  font-size: var(--font-size-xs);
  color: var(--color-foreground-muted);
  line-height: 1.4;
}

.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.app-topbar {
  background: var(--color-card);
  border-bottom: 1px solid var(--color-border-subtle);
  padding: var(--space-3) var(--space-6);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-4);
}

.app-topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.app-topbar-theme {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--color-background-alt);
  color: var(--color-foreground-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.app-topbar-theme:hover {
  background: var(--color-muted);
  color: var(--color-foreground);
}

.app-topbar-feedback {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--color-background-alt);
  color: var(--color-foreground-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.app-topbar-feedback:hover {
  background: var(--color-muted);
  color: var(--color-foreground);
}

.app-topbar-feedback-icon {
  width: 18px;
  height: 18px;
}

.app-topbar-user {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.app-topbar-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
}

.app-topbar-user-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.app-topbar-user-name {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-foreground);
}

.app-topbar-user-email {
  font-size: var(--font-size-xs);
  color: var(--color-foreground-muted);
}

.app-content {
  flex: 1;
  padding: var(--space-6);
  overflow: auto;
}

/* Feedback modal (teacher dashboard) */
.app-feedback-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.app-feedback-modal {
  background: var(--color-background);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-6);
  width: 100%;
  max-width: 420px;
}

.app-feedback-title {
  margin: 0 0 var(--space-4);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--color-foreground);
}

.app-feedback-form label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-foreground-muted);
  margin-bottom: var(--space-1);
}

.app-feedback-input,
.app-feedback-textarea {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  color: var(--color-foreground);
  background: var(--color-background);
  margin-bottom: var(--space-4);
  box-sizing: border-box;
}

.app-feedback-textarea {
  resize: vertical;
  min-height: 80px;
}

.app-feedback-error {
  font-size: var(--font-size-sm);
  color: var(--color-danger, #dc2626);
  margin-bottom: var(--space-3);
}

.app-feedback-actions {
  display: flex;
  gap: var(--space-3);
  justify-content: flex-end;
  margin-top: var(--space-4);
}

.app-feedback-back,
.app-feedback-submit {
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
}

.app-feedback-back {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-foreground-muted);
}

.app-feedback-back:hover:not(:disabled) {
  background: var(--color-muted);
  color: var(--color-foreground);
}

.app-feedback-submit {
  background: var(--color-primary);
  border: none;
  color: white;
}

.app-feedback-submit:hover:not(:disabled) {
  opacity: 0.9;
}

.app-feedback-submit:disabled,
.app-feedback-back:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* === BENTO DASHBOARD === */
.bento-dashboard {
  max-width: 1400px;
  margin: 0 auto;
}

.bento-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-5);
  margin-bottom: var(--space-6);
}

.bento-hero-title {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-foreground);
  letter-spacing: var(--letter-spacing-tight);
  margin-bottom: var(--space-1);
}

.bento-hero-subtitle {
  font-size: var(--font-size-base);
  color: var(--color-foreground-muted);
}

.bento-hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

.bento-hero-classroom {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}

.bento-hero-classroom .dashboard-form-label {
  flex-shrink: 0;
  margin-bottom: 0;
  font-size: var(--font-size-sm);
  color: var(--color-foreground-muted);
}

.bento-hero-classroom .bento-select,
.bento-hero-classroom .dashboard-select {
  width: 200px;
  height: 36px;
  padding: 0 var(--space-3);
  font-size: var(--font-size-sm);
}

.bento-hero-actions .dashboard-button {
  height: 36px;
  padding: 0 var(--space-4);
  font-size: var(--font-size-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.bento-select {
  min-width: 200px;
}

.bento-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

@media (max-width: 900px) {
  .bento-kpi-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 500px) {
  .bento-kpi-row {
    grid-template-columns: 1fr;
  }
}

.bento-kpi-card {
  background: var(--color-card);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-base);
  position: relative;
  overflow: hidden;
}

.bento-kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.bento-kpi-card:nth-child(1)::before { background: var(--color-stat-blue); }
.bento-kpi-card:nth-child(2)::before { background: var(--color-stat-green); }
.bento-kpi-card:nth-child(3)::before { background: var(--color-stat-orange); }
.bento-kpi-card:nth-child(4)::before { background: var(--color-stat-purple); }
.bento-kpi-card:nth-child(5)::before { background: var(--color-stat-pink); }
.bento-kpi-card:nth-child(6)::before { background: var(--color-primary); }
.bento-kpi-card:nth-child(7)::before { background: var(--color-secondary); }
.bento-kpi-card:nth-child(8)::before { background: var(--color-accent); }

.bento-kpi-card:hover {
  box-shadow: var(--shadow-md);
}

.bento-kpi-value {
  font-size: 28px;
  font-weight: var(--font-weight-extrabold);
  color: var(--color-foreground);
  line-height: 1.2;
  margin-bottom: var(--space-1);
}

.bento-kpi-suffix {
  font-size: 0.6em;
  font-weight: var(--font-weight-regular);
  color: var(--color-foreground-muted);
}

.bento-kpi-label {
  font-size: var(--font-size-xs);
  color: var(--color-foreground-muted);
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-wide);
  font-weight: var(--font-weight-semibold);
}

.bento-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: var(--space-6);
  align-items: start;
}

@media (max-width: 1024px) {
  .bento-grid {
    grid-template-columns: 1fr;
  }
}

.bento-main {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.bento-full-width {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  margin-top: var(--space-6);
}

.bento-side {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* Date range card: content height, aligned to top; no extra white space below */
.bento-date-range-card {
  display: flex;
  flex-direction: column;
}

.bento-date-range-card .dashboard-card-title {
  margin-bottom: var(--space-4);
}

.bento-date-range-fields {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: var(--space-4);
  padding: 0;
}

.bento-date-range-fields .dashboard-form-group {
  margin-bottom: 0;
}

.bento-date-range-fields .dashboard-form-label {
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-2);
  font-weight: var(--font-weight-semibold);
}

.bento-date-range-fields .dashboard-input {
  min-height: 56px;
  padding: var(--space-4) var(--space-4);
  font-size: 1.05rem;
  width: 100%;
  box-sizing: border-box;
}

.bento-date-range-clear {
  margin-top: var(--space-2);
  width: 100%;
  min-height: 56px;
  padding: var(--space-4) var(--space-4);
  font-size: 1.05rem;
  font-weight: var(--font-weight-semibold);
}

.bento-card {
  background: var(--color-card);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
}

.bento-card-large {
  padding: var(--space-6);
}

.bento-card .dashboard-card-title {
  margin-bottom: var(--space-4);
}

.bento-chart-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  outline: none;
  overflow: hidden;
}

/* Remove horizontal grid lines at 0% and 100% (bottom and top); hide both lines at 100% */
.bento-chart-svg-container .recharts-cartesian-grid-horizontal line:first-child,
.bento-chart-svg-container .recharts-cartesian-grid-horizontal line:last-child,
.bento-chart-svg-container .recharts-cartesian-grid-horizontal line:nth-last-child(2) {
  display: none;
}

.bento-chart-wrap * {
  outline: none !important;
}

.bento-chart-svg-container {
  position: relative;
  width: 100%;
  height: 220px;
}

.bento-chart-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.bento-chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.bento-chart-header .dashboard-card-title {
  margin-bottom: 0;
}

.bento-chart-metric-select {
  height: 32px;
  padding: 0 var(--space-3);
  font-size: var(--font-size-sm);
  min-width: 140px;
}

/* Tooltip position is set inline from Recharts coordinate */
.bento-chart-tooltip {
  padding: var(--space-2) var(--space-3);
  background: var(--color-foreground);
  color: var(--color-background);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  white-space: nowrap;
  z-index: 10;
  font-size: var(--font-size-xs);
  box-shadow: var(--shadow-md);
  z-index: 10;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.bento-chart-tooltip-date {
  font-weight: var(--font-weight-semibold);
}

.bento-chart-tooltip-rate {
  opacity: 0.9;
}

.bento-chart-empty {
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-foreground-muted);
  font-size: var(--font-size-sm);
}

.bento-chart-grid {
  stroke: var(--color-border-subtle);
  stroke-width: 0.5;
}

.bento-chart-line {
  stroke: var(--color-primary);
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bento-chart-dot {
  fill: var(--color-primary);
}

.bento-chart-labels {
  display: flex;
  justify-content: space-between;
  font-size: var(--font-size-xs);
  color: var(--color-foreground-muted);
}

/* KPI customizer modal */
.kpi-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.kpi-modal {
  background: var(--color-card);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  max-width: 480px;
  width: 90%;
  max-height: 85vh;
  overflow: auto;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--color-border-subtle);
}

.kpi-modal-desc {
  font-size: var(--font-size-sm);
  color: var(--color-foreground-muted);
  margin-bottom: var(--space-4);
}

.kpi-modal-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}

.kpi-modal-item {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.kpi-modal-item:hover {
  background: var(--color-background-alt);
}

.kpi-modal-item-disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.kpi-modal-item-disabled:hover {
  background: transparent;
}

.kpi-modal-item input {
  flex-shrink: 0;
  margin-top: 3px;
}

.kpi-modal-label {
  font-weight: var(--font-weight-medium);
  color: var(--color-foreground);
}

.kpi-modal-description {
  width: 100%;
  font-size: var(--font-size-xs);
  color: var(--color-foreground-muted);
  padding-left: 28px;
}

.kpi-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
}

.bento-card-title-with-icon {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.bento-card-title-icon {
  flex-shrink: 0;
  color: var(--color-foreground-muted);
}

.bento-insights-note {
  font-size: var(--font-size-xs);
  color: var(--color-foreground-muted);
  margin-bottom: var(--space-3);
}

.bento-insights {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* Key Insights section (below chart), card-style tiles like KPIs */
.bento-insights-section {
  width: 100%;
}

.bento-insights-section .dashboard-card-title {
  margin-bottom: var(--space-1);
}

.bento-insights-horizontal {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-4);
}

.bento-insights-horizontal .bento-insight-card {
  min-width: 0;
}

/* Key Insight cards – same treatment as KPI cards: strong card, top bar, clear contrast */
.bento-insight-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-4);
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  font-size: var(--font-size-sm);
  line-height: 1.5;
  transition: box-shadow var(--transition-base), border-color var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.bento-insight-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-border-strong, var(--color-border));
}

.bento-insight-card .bento-insight-icon {
  flex-shrink: 0;
  margin-top: 2px;
}

.bento-insight-card .bento-insight-title {
  color: var(--color-foreground);
  font-weight: var(--font-weight-semibold);
}

.bento-insight-card .bento-insight-text {
  color: var(--color-foreground-muted);
}

/* Variant icon/stat color (no top bar) */
.bento-insight-card.bento-insight-variant-1 .bento-insight-icon,
.bento-insight-card.bento-insight-variant-1 .bento-insight-stat { color: var(--color-stat-blue); }

.bento-insight-card.bento-insight-variant-2 .bento-insight-icon,
.bento-insight-card.bento-insight-variant-2 .bento-insight-stat { color: var(--color-stat-green); }

.bento-insight-card.bento-insight-variant-3 .bento-insight-icon,
.bento-insight-card.bento-insight-variant-3 .bento-insight-stat { color: var(--color-stat-orange); }

.bento-insight-card.bento-insight-variant-4 .bento-insight-icon,
.bento-insight-card.bento-insight-variant-4 .bento-insight-stat { color: var(--color-stat-purple); }
.bento-insight-card.bento-insight-variant-4 {
  border-left: 4px solid var(--color-stat-purple);
  background: linear-gradient(to right, rgba(139, 92, 246, 0.08) 0%, var(--color-card) 15%);
}

/* Legacy .bento-insight-item (if used elsewhere) */
.bento-insight-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--color-background-alt);
  border-radius: var(--radius-md);
  border-left: 4px solid var(--color-primary);
  font-size: var(--font-size-sm);
  line-height: 1.5;
  transition: box-shadow var(--transition-fast);
}

.bento-insight-item:hover {
  box-shadow: var(--shadow-sm);
}

.bento-insight-item .bento-insight-icon {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--color-foreground-muted);
}

.bento-insight-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.bento-insight-title {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-foreground);
  line-height: 1.3;
}

.bento-insight-stat {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-extrabold);
  color: var(--color-foreground);
  letter-spacing: var(--letter-spacing-tight);
  line-height: 1.2;
}

.bento-insight-item .bento-insight-text {
  min-width: 0;
  color: var(--color-foreground-muted);
  font-size: var(--font-size-sm);
  line-height: 1.5;
}

.bento-insight-variant-1 {
  border-left-color: var(--color-stat-blue);
  background: linear-gradient(to right, var(--color-primary-lighter) 0%, var(--color-background-alt) 12%);
}
.bento-insight-variant-1 .bento-insight-icon,
.bento-insight-variant-1 .bento-insight-stat { color: var(--color-stat-blue); }

.bento-insight-variant-2 {
  border-left-color: var(--color-stat-green);
  background: linear-gradient(to right, var(--color-secondary-lighter) 0%, var(--color-background-alt) 12%);
}
.bento-insight-variant-2 .bento-insight-icon,
.bento-insight-variant-2 .bento-insight-stat { color: var(--color-stat-green); }

.bento-insight-variant-3 {
  border-left-color: var(--color-stat-orange);
  background: linear-gradient(to right, var(--color-accent-lighter) 0%, var(--color-background-alt) 12%);
}
.bento-insight-variant-3 .bento-insight-icon,
.bento-insight-variant-3 .bento-insight-stat { color: var(--color-stat-orange); }

.bento-insight-variant-4 {
  border-left-color: var(--color-stat-purple);
  background: linear-gradient(to right, rgba(139, 92, 246, 0.12) 0%, var(--color-background-alt) 12%);
}
.bento-insight-variant-4 .bento-insight-icon,
.bento-insight-variant-4 .bento-insight-stat { color: var(--color-stat-purple); }

.dashboard-trend {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.dashboard-trend-up { color: var(--color-stat-green, #22c55e); }
.dashboard-trend-down { color: var(--color-stat-orange, #e67e22); }
.dashboard-trend-stable { color: var(--color-foreground-muted); }

.bento-installs {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.bento-install-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--color-muted);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  font-family: monospace;
  font-size: var(--font-size-sm);
}

.badge {
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
}

.badge-learning {
  background: hsl(142, 76%, 92%);
  color: hsl(142, 72%, 28%);
  font-weight: 700;
}

.badge-shortcut {
  background: hsl(0, 85%, 92%);
  color: hsl(0, 78%, 28%);
  font-weight: 700;
}

.badge-n/a {
  background: var(--color-muted);
  color: var(--color-foreground-muted);
}

/* Learning rate / rating: same rounded highlight as Type badge, with dynamic color */
.dashboard-metric-badge {
  text-transform: none;
  letter-spacing: 0;
}

/* === DASHBOARD LAYOUT (Classroom / Student pages inside shell) === */
.dashboard-container {
  min-height: 0;
  background: transparent;
}

/* === STUDENT DETAIL PAGE (matches main dashboard aesthetic) === */
.student-detail {
  max-width: 1400px;
  margin: 0 auto;
  min-height: 0;
}

.student-detail-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-5);
  margin-bottom: var(--space-6);
  padding: var(--space-5) var(--space-6);
  background: var(--color-card);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.student-detail-hero-primary {
  background: var(--color-primary);
  border-color: var(--color-primary);
}

.student-detail-back-row {
  margin-bottom: var(--space-4);
  display: flex;
  justify-content: flex-end;
}

.student-detail-hero-main {
  flex: 1;
  min-width: 0;
}

.student-detail-hero-primary .student-detail-title {
  color: white;
  margin-bottom: var(--space-4);
}

.student-detail-title {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: var(--font-weight-bold);
  color: var(--color-foreground);
  letter-spacing: var(--letter-spacing-tight);
  margin-bottom: var(--space-1);
}

.student-detail-hero-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

.student-detail-hero-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  color: white;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: var(--radius-full);
}

.student-detail-hero-pill-icon {
  flex-shrink: 0;
}

.student-detail-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.student-detail-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
}

.student-detail-stats .bento-kpi-card {
  margin-bottom: 0;
}

.student-detail-stats .bento-kpi-card:nth-child(1)::before { background: var(--color-stat-blue); }
.student-detail-stats .bento-kpi-card:nth-child(2)::before { background: hsl(142, 55%, 55%); }
.student-detail-stats .bento-kpi-card:nth-child(3)::before { background: hsl(0, 70%, 65%); }

@media (max-width: 640px) {
  .student-detail-stats {
    grid-template-columns: 1fr;
  }
}

.student-timeline {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.student-timeline-item {
  position: relative;
  padding: var(--space-5);
  padding-top: var(--space-5);
  background: var(--color-background-alt);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  border-left-width: 4px;
  transition: background 0.2s ease;
}

.student-timeline-item-shortcut:hover,
.student-timeline-item-shortcut.student-timeline-guide-expanded {
  background: hsl(0, 50%, 98%);
}

.student-timeline-item-learning:hover {
  background: hsl(142, 45%, 97%);
}

.student-timeline-item-shortcut {
  border-left-color: hsl(0, 70%, 65%);
}

.student-timeline-item-learning {
  border-left-color: hsl(142, 55%, 55%);
}

.student-timeline-rating-pill {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  text-transform: none;
  letter-spacing: 0;
  padding: var(--space-2) var(--space-4);
  font-size: var(--font-size-sm);
}

.student-timeline-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.student-timeline-date-pill {
  display: inline-block;
  padding: var(--space-1) var(--space-3);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--color-foreground-muted);
  background: var(--color-muted);
  border-radius: var(--radius-full);
}

.student-timeline-guide-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-4);
  padding: var(--space-3) var(--space-5);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-bold);
  color: white;
  background: var(--color-primary);
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.student-timeline-guide-toggle:hover {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.student-timeline-guide-log {
  margin-top: var(--space-4);
  padding: var(--space-4);
  background: var(--color-card);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
}

.student-guide-messages {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.student-guide-msg {
  padding: var(--space-3);
  border-radius: var(--radius-md);
  border-left: 4px solid var(--color-border);
}

.student-guide-msg-assistant {
  border-left-color: var(--color-primary);
  background: var(--color-primary-light);
}

.student-guide-msg-user {
  border-left-color: var(--color-secondary);
  background: var(--color-secondary-light);
}

.student-guide-msg-label {
  display: block;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--color-foreground-muted);
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-wide);
  margin-bottom: var(--space-2);
}

.student-guide-msg-content {
  font-size: var(--font-size-sm);
  color: var(--color-foreground);
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}


.student-timeline-prompt {
  font-size: var(--font-size-base);
  font-weight: 500;
  color: var(--color-foreground);
  line-height: 1.6;
  margin-top: var(--space-3);
  padding: var(--space-4);
  background: var(--color-card);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
}

.dashboard-header {
  background: var(--color-primary);
  padding: var(--space-4) var(--space-6);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  box-shadow: var(--shadow-sm);
}

.dashboard-title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: white;
  letter-spacing: var(--letter-spacing-tight);
}

.dashboard-header-actions {
  display: flex;
  gap: var(--space-4);
  align-items: center;
}

.dashboard-user-email {
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  font-weight: var(--font-weight-medium);
}

/* Theme Toggle */
.theme-toggle {
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.05);
}

/* Dashboard Buttons */
.dashboard-button {
  padding: var(--space-2) var(--space-4);
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-foreground);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  font-family: var(--font-family);
  cursor: pointer;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-xs);
  position: relative;
}

.dashboard-button:hover {
  background: var(--color-card-hover);
  border-color: var(--color-border-strong, var(--color-border));
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.dashboard-button:active {
  background: var(--color-card-active);
  transform: translateY(0);
}

.dashboard-button:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
}

.dashboard-button-primary {
  background: var(--color-primary);
  color: white;
  border: none;
  box-shadow: var(--shadow-sm);
}

.dashboard-button-primary:hover {
  background: var(--color-primary-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.dashboard-button-primary:active {
  background: var(--color-primary-active);
  transform: translateY(0);
}

.dashboard-button-success {
  background: var(--color-secondary);
  color: white;
  border: none;
  box-shadow: var(--shadow-sm);
}

.dashboard-button-success:hover {
  background: var(--color-secondary-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.dashboard-button-ghost {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border: none;
  box-shadow: none;
}

.dashboard-button-ghost:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.dashboard-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-6);
  position: relative;
}

.dashboard-controls {
  margin-bottom: var(--space-6);
  display: flex;
  gap: var(--space-4);
  align-items: center;
  flex-wrap: wrap;
}

.dashboard-label {
  font-weight: var(--font-weight-semibold);
  color: var(--color-foreground);
  font-size: 14px;
}

.dashboard-select {
  padding: var(--space-2) var(--space-3);
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-foreground);
  font-size: var(--font-size-sm);
  font-family: var(--font-family);
  min-width: 200px;
  cursor: pointer;
  transition: all var(--transition-base);
}

.dashboard-select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-lighter);
}

.dashboard-select option {
  background: var(--color-card);
  color: var(--color-foreground);
}

/* Custom dropdown (replaces native select) */
.custom-select {
  position: relative;
  min-width: 120px;
}

.custom-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  width: 100%;
  height: 36px;
  padding: 0 var(--space-3);
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-foreground);
  font-size: var(--font-size-sm);
  font-family: var(--font-family);
  cursor: pointer;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
  appearance: none;
}

.custom-select-trigger:hover {
  border-color: var(--color-border-strong);
}

.custom-select-trigger:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--color-primary-lighter);
}

.custom-select-value {
  flex: 1;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-select-chevron {
  flex-shrink: 0;
  color: var(--color-foreground-muted);
  transition: transform var(--transition-fast);
}

.custom-select-open .custom-select-chevron {
  transform: rotate(180deg);
}

.custom-select-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  min-width: 100%;
  max-height: 280px;
  overflow-y: auto;
  margin: 0;
  padding: var(--space-1);
  list-style: none;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 50;
}

.custom-select-option {
  padding: var(--space-2) var(--space-3);
  font-size: var(--font-size-sm);
  color: var(--color-foreground);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

.custom-select-option:hover {
  background: var(--color-background-alt);
}

.custom-select-option-selected {
  background: var(--color-primary-lighter);
  color: var(--color-primary);
  font-weight: var(--font-weight-medium);
}

.custom-select-full {
  width: 100%;
}

.bento-select-wrap {
  width: 200px;
}

.bento-chart-metric-select.custom-select {
  min-width: 140px;
}

.dashboard-input {
  padding: var(--space-2) var(--space-3);
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-foreground);
  font-size: var(--font-size-sm);
  font-family: var(--font-family);
  transition: all var(--transition-base);
}

.dashboard-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-lighter);
}

/* === STATS CARDS (Khan Academy/Quizlet inspired) === */
.dashboard-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-5);
  margin-bottom: var(--space-6);
}

.dashboard-stat-card {
  background: var(--color-card);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  text-align: center;
  transition: all var(--transition-base);
  position: relative;
  overflow: visible;
  box-shadow: var(--shadow-sm);
}

.dashboard-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-border);
  z-index: 10;
}

/* Colored top accent bar (static, no hover tooltip) */
.dashboard-stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.dashboard-stat-card:nth-child(1)::before { background: var(--color-stat-blue); }
.dashboard-stat-card:nth-child(2)::before { background: var(--color-stat-green); }
.dashboard-stat-card:nth-child(3)::before { background: var(--color-stat-orange); }
.dashboard-stat-card:nth-child(4)::before { background: var(--color-stat-purple); }

/* Dashboard Stat Icon */
.dashboard-stat-icon {
  font-size: 28px;
  margin-bottom: var(--space-2);
  display: block;
  transition: transform var(--transition-bounce);
}

.dashboard-stat-card:hover .dashboard-stat-icon {
  transform: scale(1.2) rotate(-5deg);
}

.dashboard-stat-value {
  font-size: 42px;
  font-weight: var(--font-weight-extrabold);
  letter-spacing: -0.03em;
  margin-bottom: var(--space-2);
  line-height: 1;
  color: var(--color-foreground);
}

.dashboard-stat-label {
  font-size: 11px;
  color: var(--color-foreground-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: var(--font-weight-semibold);
}

/* Mini progress bar under stat */
.dashboard-stat-progress {
  margin-top: var(--space-3);
  height: 5px;
  background: var(--color-muted);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.dashboard-stat-progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.6s ease;
}

.dashboard-stat-card:nth-child(1) .dashboard-stat-progress-fill { background: var(--color-stat-blue); }
.dashboard-stat-card:nth-child(2) .dashboard-stat-progress-fill { background: var(--color-stat-green); }
.dashboard-stat-card:nth-child(3) .dashboard-stat-progress-fill { background: var(--color-stat-orange); }
.dashboard-stat-card:nth-child(4) .dashboard-stat-progress-fill { background: var(--color-stat-purple); }

/* === CONTENT CARDS === */
.dashboard-card {
  background: var(--color-card);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin-bottom: var(--space-6);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
}

.dashboard-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-border);
}

.dashboard-card-title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  color: var(--color-foreground);
  margin-bottom: var(--space-5);
  letter-spacing: var(--letter-spacing-tight);
}

.dashboard-card-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.dashboard-form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.dashboard-form-label {
  font-size: 11px;
  font-weight: var(--font-weight-semibold);
  color: var(--color-foreground-muted);
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-wide);
}

.dashboard-form-input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--color-background-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-foreground);
  font-size: var(--font-size-base);
  font-family: var(--font-family);
  transition: all var(--transition-base);
}

.dashboard-form-input:focus {
  outline: none;
  background: var(--color-background);
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-lighter);
}

/* === TABLES === */
.dashboard-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: var(--space-4);
}

.dashboard-table th {
  text-align: left;
  padding: var(--space-3) var(--space-4);
  padding-bottom: calc(var(--space-3) + 4px);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--color-foreground-muted);
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-wide);
  line-height: 1.45;
  border-bottom: 2px solid var(--color-border);
  background: var(--color-background-alt);
  position: sticky;
  top: 0;
  z-index: 10;
}

/* Prevent header text (e.g. "Interaction type" y) from being clipped in scroll container */
.dashboard-table-wrap {
  padding-bottom: 2px;
}
.dashboard-table-wrap thead th {
  box-sizing: border-box;
}

.dashboard-table td {
  padding: var(--space-4);
  font-size: var(--font-size-sm);
  color: var(--color-foreground);
  border-bottom: 1px solid var(--color-border-subtle);
}

.dashboard-table tbody tr {
  transition: background var(--transition-fast);
}

.dashboard-table tbody tr:hover {
  background: var(--color-background-alt);
}

.dashboard-table code {
  background: var(--color-secondary-light);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 13px;
  color: var(--color-secondary);
  font-weight: var(--font-weight-semibold);
}

/* Student Performance & Recent Interactions: even column spacing */
.dashboard-table-performance,
.dashboard-table-interactions {
  table-layout: fixed;
}

.dashboard-table-performance .col-student,
.dashboard-table-interactions .col-student { width: 22%; }
.dashboard-table-performance .col-lr { width: 14%; }
.dashboard-table-performance .col-total { width: 14%; }
.dashboard-table-performance .col-trend { width: 12%; }
.dashboard-table-interactions .col-date { width: 14%; }
.dashboard-table-interactions .col-student { width: 16%; }
.dashboard-table-interactions .col-type { width: 16%; white-space: nowrap; }
.dashboard-table-interactions thead th.col-type {
  padding-bottom: 10px;
  line-height: 1.5;
}
/* Interaction type pills: full width of column, aligned with header */
.dashboard-table-interactions td:nth-child(3) .badge {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  text-align: center;
}
.dashboard-table-interactions .col-rating { width: 6%; white-space: nowrap; }
.dashboard-table-interactions .col-guided { width: 6%; white-space: nowrap; }
.dashboard-table-interactions .col-preview { width: 34%; }
.dashboard-table-preview-cell {
  max-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dashboard-table-performance .col-action { width: 10%; }
.dashboard-table-interactions .col-action { width: 8%; }

/* === LOADING === */
.loading-container {
  padding: var(--space-8);
  text-align: center;
  color: var(--color-foreground-muted);
  font-size: 15px;
}

/* === EMPTY STATE === */
.empty-state {
  text-align: center;
  padding: var(--space-10);
  color: var(--color-foreground-subtle);
  font-size: 14px;
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: var(--space-4);
  opacity: 0.3;
}

.empty-state-title {
  font-size: 18px;
  font-weight: var(--font-weight-semibold);
  color: var(--color-foreground-muted);
  margin-bottom: var(--space-2);
}

/* === LOADING SKELETON === */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--color-muted) 25%,
    var(--color-background-alt) 50%,
    var(--color-muted) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}

.skeleton-stat {
  height: 36px;
  width: 80px;
  margin: 0 auto var(--space-2);
}

.skeleton-text {
  height: 14px;
  width: 60%;
  margin: 0 auto;
}

.skeleton-row {
  height: 48px;
  margin-bottom: var(--space-3);
}

/* === SPINNER === */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* === ENHANCED FOCUS STATES === */
*:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* === SUBTLE PATTERNS === */
.dashboard-content::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    radial-gradient(circle at 1px 1px, var(--color-border) 1px, transparent 0);
  background-size: 24px 24px;
  opacity: 0.2;
  pointer-events: none;
  z-index: 0;
}

.dashboard-content > * {
  position: relative;
  z-index: 1;
}

/* === TABLE ENHANCEMENTS === */
.dashboard-table tr {
  transition: background var(--transition-fast);
}

.dashboard-table tbody tr:hover {
  background: var(--color-primary-light);
}

/* === BADGE STYLES === */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.badge-success {
  background: var(--color-secondary-light);
  color: var(--color-secondary);
}

.badge-warning {
  background: var(--color-accent-light);
  color: var(--color-accent);
}

.badge-error {
  background: var(--color-error-light);
  color: var(--color-error);
}

.badge-info {
  background: var(--color-primary-light);
  color: var(--color-primary);
}

/* === STUDENT CARDS (Google Classroom inspired) === */
.student-card {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  background: var(--color-card);
  border-radius: var(--radius-xl);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  transition: all var(--transition-bounce);
  cursor: pointer;
}

.student-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.student-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: var(--font-weight-bold);
  color: white;
  flex-shrink: 0;
}

.student-avatar.blue { background: linear-gradient(135deg, var(--color-stat-blue) 0%, #818CF8 100%); }
.student-avatar.green { background: linear-gradient(135deg, var(--color-stat-green) 0%, #4ADE80 100%); }
.student-avatar.orange { background: linear-gradient(135deg, var(--color-stat-orange) 0%, #FB923C 100%); }
.student-avatar.purple { background: linear-gradient(135deg, var(--color-stat-purple) 0%, #C084FC 100%); }

.student-info {
  flex: 1;
  min-width: 0;
}

.student-name {
  font-size: 15px;
  font-weight: var(--font-weight-bold);
  color: var(--color-foreground);
  margin-bottom: 2px;
}

.student-meta {
  font-size: 13px;
  color: var(--color-foreground-muted);
}

.student-stats {
  display: flex;
  gap: var(--space-3);
}

.student-stat {
  text-align: center;
}

.student-stat-value {
  font-size: 18px;
  font-weight: var(--font-weight-extrabold);
  color: var(--color-foreground);
}

.student-stat-label {
  font-size: 9px;
  color: var(--color-foreground-subtle);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* === ACHIEVEMENT BADGES (Duolingo inspired) === */
.achievement-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: linear-gradient(135deg, var(--color-streak-light) 0%, #FFF9DB 100%);
  border: 2px solid var(--color-streak);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: var(--font-weight-bold);
  color: #B8860B;
  box-shadow: 0 2px 8px rgba(255, 212, 59, 0.3);
}

.achievement-badge-icon {
  font-size: 16px;
}

/* === CLASSROOM CARD (Canvas style) === */
.classroom-card {
  background: var(--color-card);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  transition: all var(--transition-bounce);
}

.classroom-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.1);
}

.classroom-card-header {
  padding: var(--space-5);
  background: linear-gradient(135deg, var(--color-primary) 0%, #6366F1 100%);
  color: white;
}

.classroom-card-title {
  font-size: 18px;
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-1);
}

.classroom-card-subtitle {
  font-size: 13px;
  opacity: 0.9;
}

.classroom-card-body {
  padding: var(--space-4);
}

.classroom-card-stats {
  display: flex;
  gap: var(--space-4);
}

.classroom-card-stat {
  flex: 1;
  text-align: center;
}

.classroom-card-stat-value {
  font-size: 24px;
  font-weight: var(--font-weight-extrabold);
  color: var(--color-foreground);
}

.classroom-card-stat-label {
  font-size: 11px;
  color: var(--color-foreground-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* === ENCOURAGING EMPTY STATES === */
.empty-state {
  text-align: center;
  padding: var(--space-10);
  color: var(--color-foreground-subtle);
  font-size: 14px;
}

/* OPTIMIZED: Float animation with will-change hint */
.empty-state-icon {
  font-size: 56px;
  margin-bottom: var(--space-4);
  opacity: 0.4;
  animation: float 4s ease-in-out infinite;
  will-change: transform;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.empty-state-title {
  font-size: 20px;
  font-weight: var(--font-weight-bold);
  color: var(--color-foreground-muted);
  margin-bottom: var(--space-2);
}

.empty-state-description {
  max-width: 300px;
  margin: 0 auto var(--space-4);
  line-height: 1.5;
}

/* === CELEBRATION ANIMATION === */
@keyframes celebrate {
  0%, 100% { transform: scale(1); }
  25% { transform: scale(1.1) rotate(-3deg); }
  50% { transform: scale(1.15); }
  75% { transform: scale(1.1) rotate(3deg); }
}

.celebrate {
  animation: celebrate 0.6s ease;
}

/* === PROGRESS RING (Khan Academy style) === */
.progress-ring-container {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.progress-ring {
  transform: rotate(-90deg);
}

.progress-ring-bg {
  fill: none;
  stroke: var(--color-muted);
  stroke-width: 8;
}

.progress-ring-fill {
  fill: none;
  stroke: var(--color-secondary);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.5s ease;
}

.progress-ring-text {
  position: absolute;
  font-size: 14px;
  font-weight: var(--font-weight-extrabold);
  color: var(--color-foreground);
}

/* === CLASSROOM MANAGEMENT (bento-aligned) === */
.bento-dashboard .dashboard-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.classroom-join-code-card {
  margin-bottom: 0;
}

.classroom-join-code-label {
  font-size: var(--font-size-sm);
  color: var(--color-foreground-muted);
  margin-bottom: var(--space-3);
}

.classroom-join-code-strip {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.classroom-join-code-value {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  padding: var(--space-2) var(--space-4);
  background: var(--color-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: ui-monospace, monospace;
  color: var(--color-foreground);
}

.classroom-student-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.classroom-student-list-item {
  padding: var(--space-3) var(--space-4);
  background: var(--color-muted);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
}

.classroom-student-id {
  font-family: ui-monospace, monospace;
  color: var(--color-secondary);
}

.classroom-context-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.classroom-context-header .dashboard-card-title {
  margin-bottom: 0;
}

.classroom-context-actions {
  display: flex;
  gap: var(--space-2);
}

.classroom-form-group {
  margin-bottom: var(--space-6);
}

.classroom-field-desc {
  font-size: var(--font-size-sm);
  color: var(--color-foreground-muted);
  margin-bottom: var(--space-2);
}

.classroom-field-readonly {
  padding: var(--space-3) var(--space-4);
  background: var(--color-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  display: inline-block;
  min-width: 200px;
  color: var(--color-foreground);
}

.classroom-field-readonly-block {
  display: block;
  min-width: 0;
  white-space: pre-wrap;
  min-height: 80px;
}

.classroom-field-placeholder {
  color: var(--color-foreground-muted);
  font-style: italic;
}

.classroom-textarea {
  width: 100%;
  font-family: inherit;
  resize: vertical;
  min-height: 120px;
}

.classroom-select-grade {
  max-width: 300px;
}

.classroom-canvas-card {
  margin-top: 0;
}

.classroom-back-button {
  margin-left: auto;
}

.classroom-create-modal {
  max-width: 400px;
}

.classroom-color-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.classroom-color-swatch {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  border: 2px solid var(--color-border);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.classroom-color-swatch:hover {
  transform: scale(1.08);
  box-shadow: var(--shadow-md);
}

.classroom-color-swatch.selected {
  border-color: var(--color-foreground);
  box-shadow: 0 0 0 2px var(--color-background), 0 0 0 4px var(--color-foreground);
}

.classroom-join-code-header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.classroom-edit-classroom-btn {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
  color: #fff;
  font-size: var(--font-size-sm);
}

.classroom-edit-classroom-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.6);
  color: #fff;
}

.classroom-file-upload-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.classroom-file-input {
  position: absolute;
  width: 0.1px;
  height: 0.1px;
  opacity: 0;
  overflow: hidden;
  z-index: -1;
}

.classroom-upload-label {
  cursor: pointer;
  margin-bottom: 0;
}

.classroom-upload-label:has(+ input:disabled),
.classroom-upload-label[aria-busy="true"] {
  opacity: 0.7;
  pointer-events: none;
}

.classroom-uploaded-list {
  margin-bottom: var(--space-3);
  padding: var(--space-3);
  background: var(--color-muted);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
}

.classroom-uploaded-label {
  display: block;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--color-foreground-muted);
  margin-bottom: var(--space-2);
}

.classroom-uploaded-filenames {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.classroom-uploaded-filename {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
}

.classroom-uploaded-filename-text {
  color: var(--color-foreground);
}

.classroom-uploaded-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-1);
  font-size: var(--font-size-xs);
  color: var(--color-foreground-muted);
  background: none;
  border: none;
  cursor: pointer;
}

.classroom-uploaded-remove:hover {
  color: var(--color-error, #dc2626);
}

.classroom-uploaded-filename-readonly .classroom-uploaded-remove {
  display: none;
}

.classroom-uploaded-empty {
  font-size: var(--font-size-sm);
  color: var(--color-foreground-muted);
  margin: 0;
}

.classroom-additional-text-label {
  font-size: var(--font-size-sm);
  color: var(--color-foreground-muted);
  margin-bottom: var(--space-2);
}

.classroom-save-notification {
  padding: var(--space-3) var(--space-4);
  background: var(--color-stat-green, hsl(142, 45%, 35%));
  color: white;
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  animation: classroomNotifyFade 0.3s ease;
}

@keyframes classroomNotifyFade {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.classroom-remove-student-btn {
  padding: var(--space-2);
  min-width: 36px;
  color: var(--color-foreground-muted);
  border-color: transparent;
}

.classroom-remove-student-btn:hover:not(:disabled) {
  color: var(--color-stat-orange, #e67e22);
  background: var(--color-background-alt);
}

.classroom-remove-student-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
