* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #0f1117;
  color: #e4e6eb;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }

/* Nav */
.nav-bar {
  display: flex;
  justify-content: center;
  gap: 4px;
  padding: 12px 16px;
  background: #1a1d27;
  border-bottom: 1px solid #2a2d35;
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-link {
  padding: 6px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #8b8fa3;
  transition: all 0.2s;
}
.nav-link:hover { color: #e4e6eb; background: #22252e; }
.nav-link.active { color: #60a5fa; background: #1e293b; }

/* Header */
.header {
  text-align: center;
  margin: 20px 16px 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid #2a2d35;
}
.header h1 {
  font-size: 24px;
  font-weight: 700;
  background: linear-gradient(135deg, #60a5fa, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 4px;
}
.header .subtitle { color: #8b8fa3; font-size: 13px; }
.header .date { color: #60a5fa; font-size: 15px; font-weight: 600; margin-top: 4px; }

.refresh-info {
  text-align: center;
  color: #4b5060;
  font-size: 11px;
  margin-bottom: 16px;
  padding: 0 16px;
}
.refresh-info .live { color: #34d399; }

/* Summary */
.summary-bar {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 0 16px 20px;
  flex-wrap: wrap;
}
.summary-stat {
  text-align: center;
  padding: 10px 16px;
  background: #1a1d27;
  border-radius: 10px;
  border: 1px solid #2a2d35;
  min-width: 90px;
}
.summary-stat .number { font-size: 24px; font-weight: 700; }
.summary-stat .label { font-size: 10px; color: #8b8fa3; text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px; }
.color-done { color: #34d399; }
.color-pending { color: #fbbf24; }
.color-total { color: #60a5fa; }
.color-pct { color: #a78bfa; }

/* Student cards */
.students-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}
.student-card {
  background: #1a1d27;
  border-radius: 12px;
  padding: 14px;
  border: 1px solid #2a2d35;
  transition: border-color 0.2s;
}
.student-card:hover { border-color: #3a3d45; }
.student-card.all-done { border-color: #22c55e40; }
.student-card.nothing-done { border-color: #ef444440; }
.student-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.student-name { font-size: 17px; font-weight: 600; }
.student-grade { font-size: 12px; color: #8b8fa3; margin-left: 6px; }
.student-pct { font-size: 13px; font-weight: 600; padding: 2px 8px; border-radius: 10px; }
.pct-0 { background: #3b1a1a; color: #f87171; }
.pct-low { background: #3b2e1a; color: #fbbf24; }
.pct-mid { background: #1a3b2e; color: #34d399; }
.pct-100 { background: #1a3b1a; color: #22c55e; }

.progress-bar-outer { width: 100%; height: 5px; background: #2a2d35; border-radius: 3px; margin-bottom: 10px; overflow: hidden; }
.progress-bar-inner { height: 100%; border-radius: 3px; transition: width 0.5s ease; }
.bar-0 { background: #4b5060; width: 0%; }
.bar-low { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.bar-mid { background: linear-gradient(90deg, #10b981, #34d399); }
.bar-100 { background: linear-gradient(90deg, #22c55e, #4ade80); }

.assignment-list { list-style: none; }
.assignment-item { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px solid #22252e; font-size: 13px; }
.assignment-item:last-child { border-bottom: none; }
.assignment-icon { font-size: 14px; flex-shrink: 0; }
.assignment-label { flex: 1; }
.assignment-done { color: #34d399; text-decoration: line-through; opacity: 0.7; }
.assignment-pending { color: #e4e6eb; }
.assignment-by { font-size: 10px; color: #6b7280; text-transform: uppercase; }

.internet-badge { display: inline-block; padding: 2px 7px; border-radius: 8px; font-size: 10px; font-weight: 600; margin-left: 6px; }
.internet-earned { background: #1a3b1a; color: #4ade80; }
.internet-blocked { background: #3b1a1a; color: #f87171; }
.override-badge { display: inline-block; padding: 2px 7px; border-radius: 8px; font-size: 10px; font-weight: 600; margin-left: 4px; background: #3b2e1a; color: #fbbf24; }

/* Chores */
.chores-container { max-width: 800px; margin: 0 auto; padding: 0 16px; }
.chores-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.chore-card { background: #1a1d27; border-radius: 10px; padding: 14px; border: 1px solid #2a2d35; }
.chore-area { font-size: 15px; font-weight: 600; color: #60a5fa; margin-bottom: 4px; }
.chore-assigned { font-size: 13px; color: #8b8fa3; }
.laundry-section { margin-top: 24px; }
.laundry-section h2 { font-size: 16px; color: #a78bfa; margin-bottom: 12px; }

/* History */
.history-filters { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; padding: 0 16px; margin-bottom: 20px; }
.filter-btn { padding: 5px 12px; border-radius: 8px; font-size: 12px; color: #8b8fa3; background: #1a1d27; border: 1px solid #2a2d35; }
.filter-btn:hover { color: #e4e6eb; }
.filter-btn.active { color: #60a5fa; border-color: #60a5fa; }
.history-container { max-width: 800px; margin: 0 auto; padding: 0 16px; }
.history-container h2 { font-size: 16px; color: #a78bfa; margin: 20px 0 12px; }
.history-chart { display: flex; flex-direction: column; gap: 4px; }
.history-row { display: flex; align-items: center; gap: 8px; }
.history-date { font-size: 12px; color: #8b8fa3; width: 50px; text-align: right; flex-shrink: 0; }
.history-bar-outer { flex: 1; height: 18px; background: #1a1d27; border-radius: 4px; overflow: hidden; }
.history-bar-inner { height: 100%; border-radius: 4px; transition: width 0.3s; min-width: 2px; }
.history-pct { font-size: 12px; font-weight: 600; width: 35px; text-align: right; }
.history-count { font-size: 11px; color: #6b7280; width: 40px; }

/* Student detail */
.student-detail-grid { display: flex; justify-content: center; gap: 16px; padding: 0 16px; margin-bottom: 24px; flex-wrap: wrap; }
.detail-card { text-align: center; padding: 16px 24px; background: #1a1d27; border-radius: 12px; border: 1px solid #2a2d35; min-width: 120px; }
.detail-number { font-size: 32px; font-weight: 700; }
.detail-label { font-size: 11px; color: #8b8fa3; text-transform: uppercase; margin-top: 4px; }
.categories-section { max-width: 800px; margin: 0 auto 24px; padding: 0 16px; }
.categories-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.category-card { background: #1a1d27; border-radius: 10px; padding: 12px; border: 1px solid #2a2d35; }
.category-name { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.category-stats { font-size: 12px; color: #8b8fa3; margin-top: 4px; }

/* Footer */
.footer { text-align: center; color: #4b5060; font-size: 11px; margin: 28px 0 16px; padding: 16px; border-top: 1px solid #2a2d35; }
.error-msg { text-align: center; padding: 40px; color: #f87171; font-size: 16px; }

/* Mobile tweaks */
@media (max-width: 480px) {
  .students-grid { grid-template-columns: 1fr; }
  .summary-stat { min-width: 70px; padding: 8px 10px; }
  .summary-stat .number { font-size: 20px; }
  .header h1 { font-size: 20px; }
  .detail-card { min-width: 90px; padding: 12px 16px; }
  .detail-number { font-size: 24px; }
}
