:root {
  --bg: #0f172a;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #f97316;
  --accent-hover: #ea580c;
  --accent-light: rgba(249, 115, 22, 0.1);
  --card: #111827;
  --border: #1f2937;
}

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

html, body {
  height: 100%;
}

body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji";
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 16px;
}

.site-header {
  border-bottom: 1px solid var(--border);
  background: rgba(2, 6, 23, 0.4);
  backdrop-filter: blur(8px);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
}

.site-title {
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  color: var(--accent);
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
  position: relative;
}

.logo-icon::before {
  content: '📚';
  font-size: 1.5rem;
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--accent), #ff8c42);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-email {
  color: var(--muted);
  font-size: 0.9rem;
}

.site-nav {
  display: flex;
  gap: 16px;
}

.site-nav a {
  color: var(--text);
  text-decoration: none;
  opacity: 0.9;
}

.site-nav a:hover {
  opacity: 1;
}

.hero {
  padding: 80px 0 48px;
  background: linear-gradient(180deg, rgba(249, 115, 22, 0.08), rgba(249, 115, 22, 0) 60%);
}

.hero h2 {
  font-size: 2rem;
  margin-bottom: 8px;
}

.hero p {
  color: var(--muted);
  max-width: 60ch;
  margin-bottom: 16px;
}

.section {
  padding: 48px 0;
  border-top: 1px solid var(--border);
}

.stack {
  display: grid;
  gap: 16px;
}

.inline-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: end;
}

.inline-form label {
  margin: 0;
}

.card-list {
  display: grid;
  gap: 8px;
  list-style: none;
}

.card-list.small li, .card-list li {
  border: 1px solid var(--border);
  background: var(--card);
  padding: 12px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.grid.two {
  display: grid;
  gap: 24px;
}

@media (min-width: 900px) {
  .grid.two {
    grid-template-columns: 1fr 1fr;
  }
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}

table.marks {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

table.marks th, table.marks td {
  border-bottom: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
}

table.marks th {
  background: rgba(249, 115, 22, 0.08);
}

table.marks input[type="number"] {
  width: 90px;
}

.statistics {
  margin-top: 32px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.stats-filters {
  display: grid;
  gap: 12px;
  margin-bottom: 24px;
}

.stats-filters label {
  margin: 0;
}

.stats-display {
  display: grid;
  gap: 24px;
}

.stat-card {
  border: 1px solid var(--border);
  background: var(--card);
  padding: 16px;
  border-radius: 8px;
}

.stat-card h5 {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
}

.stats-table th,
.stats-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.stats-table th {
  background: rgba(249, 115, 22, 0.08);
  font-weight: 600;
}

.grade-bar {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 4px;
}

.grade-bar-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.3s;
}

.auth-view {
  padding: 48px 0;
}

.auth-card {
  max-width: 480px;
}

.auth-divider {
  text-align: center;
  margin: 20px 0;
  position: relative;
}

.auth-divider::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: var(--border);
}

.auth-divider span {
  position: relative;
  background: var(--bg);
  padding: 0 12px;
  color: var(--muted);
}

.student-login-link {
  text-align: center;
  margin-top: 16px;
}

.student-login-link a {
  color: var(--accent);
  text-decoration: none;
}

.student-login-link a:hover {
  text-decoration: underline;
}

.student-code {
  font-family: monospace;
  font-size: 0.9rem;
  background: var(--card);
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
  display: inline-block;
  margin-left: 8px;
}

.copy-code-btn {
  padding: 4px 8px;
  font-size: 0.85rem;
  margin-left: 8px;
}

.notifications-section, .ai-predictions, .behavior-section {
  margin-top: 32px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.notifications-list {
  display: grid;
  gap: 8px;
}

.notification-item {
  padding: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.notification-item.urgent {
  border-color: #fca5a5;
  background: rgba(252, 165, 165, 0.1);
}

.notification-item.warning {
  border-color: #fcd34d;
  background: rgba(252, 211, 77, 0.1);
}

.notification-icon {
  font-size: 1.5rem;
}

.risk-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
}

.risk-high {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

.risk-medium {
  background: rgba(245, 158, 11, 0.2);
  color: #fcd34d;
}

.risk-low {
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
}

.behavior-comment-item {
  padding: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 8px;
  margin-bottom: 8px;
}

.behavior-comment-date {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 4px;
}

.behavior-comment-text {
  margin-top: 8px;
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.classroom-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.classroom-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(249, 115, 22, 0.15);
  border-color: var(--accent);
}

.classroom-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.classroom-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.classroom-card-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.classroom-stat-item {
  text-align: center;
  padding: 12px;
  background: rgba(249, 115, 22, 0.05);
  border-radius: 8px;
}

.classroom-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  display: block;
}

.classroom-stat-label {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 4px;
}

.classroom-card-risk {
  margin-top: 12px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
}

.reminders-widget {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 32px;
}

.reminders-widget h3 {
  margin-bottom: 16px;
  color: var(--accent);
}

.reminders-list-dashboard {
  display: grid;
  gap: 8px;
}

.reminder-item-dashboard {
  padding: 12px;
  background: rgba(249, 115, 22, 0.05);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-left: 3px solid var(--accent);
}

.reminder-item-dashboard.urgent {
  background: rgba(239, 68, 68, 0.1);
  border-left-color: #ef4444;
}

.reminder-item-dashboard.warning {
  background: rgba(245, 158, 11, 0.1);
  border-left-color: #f59e0b;
}

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

/* New Feature Sections */
.attendance-section, .grade-weighting-section, .calendar-section,
.student-notes-section, .excel-section, .submission-section,
.progress-graphs-section, .grade-categories-section, .rubrics-section,
.student-groups-section, .seating-chart-section, .announcements-section,
.grade-curves-section, .backup-section, .terms-section, .standards-section {
  margin-top: 32px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.calendar-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 16px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  background: var(--card);
}

.calendar-day {
  aspect-ratio: 1;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 8px;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s;
  background: var(--bg);
}

.calendar-day:hover {
  background: rgba(249, 115, 22, 0.1);
}

.calendar-day.has-event {
  background: rgba(249, 115, 22, 0.2);
  border-color: var(--accent);
}

.calendar-day-header {
  font-weight: 600;
  background: rgba(249, 115, 22, 0.1);
  border: none;
}

.seating-chart-container {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  min-height: 300px;
}

.seat {
  padding: 12px;
  border: 2px solid var(--border);
  border-radius: 6px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--bg);
}

.seat:hover {
  border-color: var(--accent);
  transform: scale(1.05);
}

.seat.occupied {
  background: rgba(249, 115, 22, 0.1);
  border-color: var(--accent);
}

.progress-bar {
  height: 20px;
  background: var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin: 8px 0;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  transition: width 0.3s;
}

.rubric-criterion {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
  background: var(--card);
}

.group-member {
  display: inline-block;
  padding: 4px 8px;
  background: rgba(249, 115, 22, 0.1);
  border-radius: 4px;
  margin: 2px;
  font-size: 0.85rem;
}

.announcement-item {
  padding: 12px;
  border-left: 3px solid var(--accent);
  background: var(--card);
  border-radius: 4px;
  margin-bottom: 8px;
}

.announcement-item.high {
  border-left-color: #f59e0b;
}

.announcement-item.urgent {
  border-left-color: #ef4444;
}

.standard-badge {
  display: inline-block;
  padding: 4px 8px;
  background: rgba(249, 115, 22, 0.1);
  border-radius: 4px;
  font-size: 0.85rem;
  margin: 2px;
}

@media (max-width: 768px) {
  .calendar-grid {
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    padding: 4px;
  }
  
  .calendar-day {
    padding: 4px;
    font-size: 0.8rem;
  }
  
  .seating-chart-container {
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
  }
}

.muted {
  color: var(--muted);
  margin-bottom: 12px;
}

.error {
  color: #fca5a5;
  margin-top: 8px;
}

form {
  display: grid;
  gap: 12px;
  max-width: 560px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 0.95rem;
}

input, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--accent);
  color: white;
  font-weight: 600;
  cursor: pointer;
}

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

.button-secondary {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

.button-secondary:hover {
  background: rgba(148, 163, 184, 0.1);
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  color: var(--muted);
  text-align: center;
}

@media (min-width: 768px) {
  .hero h2 {
    font-size: 2.5rem;
  }
}

@media (max-width: 768px) {
  .site-header .container {
    flex-wrap: wrap;
    gap: 12px;
  }
  
  .site-nav {
    order: 3;
    width: 100%;
    justify-content: center;
  }
  
  .auth-controls {
    flex-direction: column;
    gap: 8px;
  }
  
  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  
  .detail-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .grid.two {
    grid-template-columns: 1fr;
  }
  
  .inline-form {
    grid-template-columns: 1fr;
  }
  
  .stat-grid {
    grid-template-columns: 1fr;
  }
  
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  
  .table-wrap {
    overflow-x: auto;
  }
  
  .calendar-grid {
    font-size: 0.8rem;
  }
  
  .seating-chart-container {
    grid-template-columns: repeat(auto-fit, minmax(50px, 1fr));
  }
  
  .seat {
    padding: 8px;
    font-size: 0.85rem;
  }
}


