:root {
  --bg: #fff;
  --bg-alt: #f9f9f9;
  --border: #e1e1e1;
  --text: #333;
  --badge-radius: 4px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: sans-serif;
  background: var(--bg-alt);
  color: var(--text);
  padding: 2rem;
}
.container {
  max-width: 1024px;
  margin: auto;
  background: var(--bg);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
header {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
header h1 { font-size: 1.25rem; }
.controls {
  display: flex;
  gap: .5rem;
}
.controls input,
.controls select {
  padding: .4rem .6rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
}
.controls button {
  background: #4a90e2;
  color: #fff;
  border: none;
  padding: .4rem .8rem;
  border-radius: 4px;
  cursor: pointer;
}
.table-wrapper { overflow-x: auto; }
.row {
  display: grid;
  grid-template-columns: 60px 100px 1fr 120px 140px 120px 1fr 80px;
  align-items: center;
  padding: .75rem 1rem;
  gap: .5rem;
  border-bottom: 1px solid var(--border);
}
.row.header {
  background: var(--bg-alt);
  font-weight: 500;
}
.cell { font-size: .9rem; }
.badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: var(--badge-radius);
  font-size: .75rem;
  font-weight: 500;
}
.badge.done { background: #daf5da; color: #27632a; }
.badge.not  { background: #f8d7da; color: #842029; }
.badge.Assignment { background: #f8d8d5; color: #842029; }
.badge[class~="Exam/Quiz"] { background: #e2e3e5; color: #41464b; }
.badge.Project  { background: #d1ecf1; color: #0c5460; }
.badge.Seminar  { background: #fff3cd; color: #664d03; }
.badge.Forum    { background: #e2e3e5; color: #41464b; }
.badge.Other    { background: #e9ecef; color: #495057; }
.tag { background: #e0e0e0; color: #333; margin-right: 4px; border-radius: 4px; padding: 2px 6px; font-size: .8rem; }
.actions button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
}
footer {
  padding: .75rem 1rem;
  background: var(--bg-alt);
  font-size: .9rem;
}
.modal.hidden { display: none; }
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal-content {
  background: var(--bg);
  padding: 1.5rem;
  border-radius: 6px;
  width: 90%; max-width: 400px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  z-index: 1001;
}
.modal-content h2 { margin-bottom: 1rem; font-size: 1.1rem; }
.modal-content label { display: block; margin-bottom: 1rem; font-size: .9rem; }
.modal-content input,
.modal-content select,
.modal-content textarea {
  width: 100%;
  padding: .5rem;
  margin-top: .25rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
}
.modal-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1rem; }
.modal-actions button {
  padding: .4rem .8rem;
  border-radius: 4px;
  border: none;
  cursor: pointer;
}
#btnCancel { background: #6c757d; color: #fff; }
#btnSubmit { background: #198754; color: #fff; }