/* ============================================================
   MEDADMIN — Material Design Professional Theme
   Google-like, elegant, medical context
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Google+Sans:wght@400;500;700&family=Roboto:wght@300;400;500&family=Roboto+Mono:wght@400;500&display=swap');
@import url('https://fonts.googleapis.com/icon?family=Material+Icons+Round');

/* ---------------------------------------------------------------
   CSS Variables — Material You palette
---------------------------------------------------------------- */
:root {
  --md-primary:       #1a73e8;
  --md-primary-dark:  #1557b0;
  --md-primary-light: #e8f0fe;
  --md-secondary:     #137333;
  --md-error:         #d93025;
  --md-warning:       #f9ab00;
  --md-surface:       #ffffff;
  --md-bg:            #f8f9fa;
  --md-sidebar-bg:    #ffffff;
  --md-on-surface:    #202124;
  --md-on-surface-2:  #5f6368;
  --md-on-surface-3:  #9aa0a6;
  --md-divider:       #e8eaed;
  --md-hover:         rgba(26,115,232,.07);
  --md-active:        rgba(26,115,232,.12);

  --md-shadow-1: 0 1px 3px rgba(0,0,0,.12), 0 1px 2px rgba(0,0,0,.08);
  --md-shadow-2: 0 3px 6px rgba(0,0,0,.10), 0 2px 4px rgba(0,0,0,.08);
  --md-shadow-3: 0 10px 30px rgba(0,0,0,.12);

  --sidebar-width: 260px;
  --topbar-height: 64px;
  --radius:    8px;
  --radius-lg: 16px;

  --font-head: 'Google Sans', sans-serif;
  --font-body: 'Roboto', sans-serif;
  --font-mono: 'Roboto Mono', monospace;
}

/* ---------------------------------------------------------------
   Reset
---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--md-bg);
  color: var(--md-on-surface);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
}

/* ---------------------------------------------------------------
   Sidebar
---------------------------------------------------------------- */
.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  position: fixed;
  left: 0; top: 0;
  background: var(--md-sidebar-bg);
  border-right: 1px solid var(--md-divider);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
  transition: transform .3s cubic-bezier(.4,0,.2,1);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--md-divider);
}
.sidebar-logo .logo-icon {
  width: 40px; height: 40px;
  background: var(--md-primary);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-size: 20px;
}
.sidebar-logo .logo-text {
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 700;
  color: var(--md-on-surface);
  line-height: 1.2;
}
.sidebar-logo .logo-sub {
  font-size: 11px;
  color: var(--md-on-surface-2);
  font-weight: 400;
}

.sidebar-section {
  padding: 8px 0;
  border-bottom: 1px solid var(--md-divider);
}
.sidebar-section:last-child { border-bottom: none; }
.sidebar-section-title {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--md-on-surface-3);
  padding: 8px 20px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 20px;
  cursor: pointer;
  border-radius: var(--radius);
  margin: 2px 8px;
  transition: background .15s ease, color .15s ease;
  text-decoration: none;
  color: var(--md-on-surface-2);
  font-size: 13.5px;
  font-weight: 500;
  position: relative;
  user-select: none;
}
.nav-item .material-icons-round { font-size: 20px; }
.nav-item:hover { background: var(--md-hover); color: var(--md-primary); }
.nav-item.active {
  background: var(--md-primary-light);
  color: var(--md-primary);
  font-weight: 600;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 50%; transform: translateY(-50%);
  height: 60%;
  width: 3px;
  background: var(--md-primary);
  border-radius: 0 3px 3px 0;
}

.sidebar-year-badge {
  margin: 12px 16px 8px;
  background: var(--md-primary-light);
  border: 1px solid rgba(26,115,232,.2);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 12px;
  color: var(--md-primary-dark);
}
.sidebar-year-badge .year-label {
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 700;
}

/* ---------------------------------------------------------------
   Main layout
---------------------------------------------------------------- */
.main-wrap {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  height: var(--topbar-height);
  background: var(--md-surface);
  border-bottom: 1px solid var(--md-divider);
  display: flex;
  align-items: center;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 50;
  gap: 16px;
  box-shadow: var(--md-shadow-1);
}
.topbar-title {
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 500;
  color: var(--md-on-surface);
  flex: 1;
}
.topbar-actions { display: flex; align-items: center; gap: 8px; }

.page-content {
  flex: 1;
  padding: 28px;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

/* ---------------------------------------------------------------
   Cards
---------------------------------------------------------------- */
.card {
  background: var(--md-surface);
  border: 1px solid var(--md-divider);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--md-shadow-1);
  transition: box-shadow .2s ease;
}
.card:hover { box-shadow: var(--md-shadow-2); }
.card-title {
  font-family: var(--font-head);
  font-size: 16px;
  font-weight: 600;
  color: var(--md-on-surface);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-title .material-icons-round { color: var(--md-primary); font-size: 20px; }
.card-subtitle {
  font-size: 13px;
  color: var(--md-on-surface-2);
  margin-bottom: 20px;
}

/* ---------------------------------------------------------------
   Buttons
---------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border: none;
  border-radius: 20px;
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s ease;
  text-decoration: none;
  user-select: none;
  white-space: nowrap;
}
.btn .material-icons-round { font-size: 16px; }
.btn-primary {
  background: var(--md-primary);
  color: white;
  box-shadow: 0 1px 3px rgba(26,115,232,.3);
}
.btn-primary:hover {
  background: var(--md-primary-dark);
  box-shadow: 0 2px 8px rgba(26,115,232,.4);
  transform: translateY(-1px);
}
.btn-outlined {
  background: transparent;
  border: 1.5px solid var(--md-primary);
  color: var(--md-primary);
}
.btn-outlined:hover { background: var(--md-primary-light); }
.btn-text {
  background: transparent;
  color: var(--md-primary);
  padding: 8px 12px;
}
.btn-text:hover { background: var(--md-hover); }
.btn-danger {
  background: var(--md-error);
  color: white;
}
.btn-danger:hover { background: #c5221f; }
.btn-success {
  background: var(--md-secondary);
  color: white;
}
.btn-success:hover { background: #0d652d; }
.btn-warning {
  background: var(--md-warning);
  color: #202124;
}
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-icon {
  padding: 8px;
  border-radius: 50%;
  background: transparent;
  color: var(--md-on-surface-2);
}
.btn-icon:hover { background: var(--md-hover); color: var(--md-primary); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none !important; }

/* ---------------------------------------------------------------
   Form inputs
---------------------------------------------------------------- */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--md-on-surface-2);
  margin-bottom: 6px;
  letter-spacing: .3px;
}
.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--md-divider);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--md-on-surface);
  background: var(--md-surface);
  transition: border-color .15s ease, box-shadow .15s ease;
  outline: none;
}
.form-control:focus {
  border-color: var(--md-primary);
  box-shadow: 0 0 0 3px rgba(26,115,232,.12);
}
.form-control.error { border-color: var(--md-error); }
.form-control.success { border-color: var(--md-secondary); }
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }

/* ---------------------------------------------------------------
   Tables
---------------------------------------------------------------- */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--md-divider);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
thead th {
  background: var(--md-bg);
  padding: 12px 16px;
  text-align: left;
  font-family: var(--font-head);
  font-size: 12px;
  font-weight: 600;
  color: var(--md-on-surface-2);
  letter-spacing: .5px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--md-divider);
  white-space: nowrap;
}
tbody tr {
  border-bottom: 1px solid var(--md-divider);
  transition: background .12s ease;
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--md-hover); }
tbody td { padding: 12px 16px; vertical-align: middle; }
tbody tr.highlighted { background: var(--md-primary-light) !important; }

/* ---------------------------------------------------------------
   Chips / Badges
---------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11.5px;
  font-weight: 500;
}
.badge-pending  { background: #fef3cd; color: #856404; }
.badge-validated { background: #d4edda; color: #155724; }
.badge-locked   { background: #cce5ff; color: #004085; }
.badge-error    { background: #f8d7da; color: #721c24; }

/* ---------------------------------------------------------------
   Tabs
---------------------------------------------------------------- */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--md-divider);
  margin-bottom: 24px;
  gap: 0;
}
.tab {
  padding: 12px 20px;
  cursor: pointer;
  font-family: var(--font-head);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--md-on-surface-2);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color .15s, border-color .15s;
  display: flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}
.tab:hover { color: var(--md-primary); }
.tab.active { color: var(--md-primary); border-bottom-color: var(--md-primary); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ---------------------------------------------------------------
   Modal
---------------------------------------------------------------- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(2px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn .2s ease;
}
.modal {
  background: var(--md-surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 760px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--md-shadow-3);
  animation: slideUp .25s cubic-bezier(.4,0,.2,1);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--md-divider);
  position: sticky;
  top: 0;
  background: var(--md-surface);
  z-index: 1;
}
.modal-title {
  font-family: var(--font-head);
  font-size: 17px;
  font-weight: 600;
  color: var(--md-on-surface);
}
.modal-body { padding: 20px 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--md-divider);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: var(--md-bg);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ---------------------------------------------------------------
   Grade input section (student grades editor)
---------------------------------------------------------------- */
.grade-module-card {
  border: 1px solid var(--md-divider);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
  transition: border-color .2s ease;
}
.grade-module-card.module-complete { border-color: var(--md-secondary); }
.grade-module-card.module-error    { border-color: var(--md-error); }

.grade-module-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--md-bg);
  border-bottom: 1px solid var(--md-divider);
  cursor: pointer;
  user-select: none;
}
.grade-module-name {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 14px;
  color: var(--md-on-surface);
  display: flex;
  align-items: center;
  gap: 8px;
}
.grade-module-coef {
  font-size: 12px;
  color: var(--md-on-surface-2);
  background: var(--md-divider);
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 500;
}

.grade-module-body { padding: 16px; }
.grade-type-section { margin-bottom: 16px; }
.grade-type-section:last-child { margin-bottom: 0; }
.grade-type-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--md-on-surface-2);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.grade-type-label.theory { color: var(--md-primary); }
.grade-type-label.practice { color: #e37400; }

.grade-inputs-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.grade-input-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.grade-input-attempt {
  font-size: 10px;
  color: var(--md-on-surface-3);
  font-family: var(--font-mono);
}
.grade-input {
  width: 72px;
  padding: 8px 10px;
  border: 2px solid var(--md-divider);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 500;
  text-align: center;
  outline: none;
  transition: border-color .15s ease, background .15s ease;
  background: var(--md-surface);
}
.grade-input:focus { border-color: var(--md-primary); background: var(--md-primary-light); }
.grade-input.passing { border-color: var(--md-secondary); background: #e6f4ea; color: #137333; }
.grade-input.failing { border-color: #ea8600; background: #fef7e0; color: #e37400; }
.grade-input[disabled] { background: var(--md-bg); color: var(--md-on-surface-3); cursor: not-allowed; }

.grade-add-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 2px dashed var(--md-divider);
  background: transparent;
  color: var(--md-on-surface-3);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  transition: all .15s ease;
  flex-shrink: 0;
}
.grade-add-btn:hover {
  border-color: var(--md-primary);
  color: var(--md-primary);
  background: var(--md-primary-light);
}

/* ---------------------------------------------------------------
   Verification modal — module details
---------------------------------------------------------------- */
.verify-module-row {
  border: 1px solid var(--md-divider);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
}
.verify-module-row.valid   { border-color: #34a853; }
.verify-module-row.invalid { border-color: var(--md-error); }

.verify-module-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--md-bg);
  font-family: var(--font-head);
  font-size: 13.5px;
  font-weight: 600;
}
.verify-module-body {
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.verify-score-block { display: flex; flex-direction: column; gap: 4px; }
.verify-score-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--md-on-surface-2);
}
.verify-notes {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 4px 0;
}
.verify-note-chip {
  padding: 2px 8px;
  border-radius: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  background: var(--md-bg);
  border: 1px solid var(--md-divider);
}
.verify-note-chip.passing { background: #e6f4ea; border-color: #34a853; color: #137333; }
.verify-note-chip.failing { background: #fef3cd; border-color: #ea8600; color: #e37400; }

.verify-avg {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
}
.verify-error-msg {
  color: var(--md-error);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
}

.verify-summary {
  background: var(--md-bg);
  border: 1px solid var(--md-divider);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ---------------------------------------------------------------
   Stats/KPI row
---------------------------------------------------------------- */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--md-surface);
  border: 1px solid var(--md-divider);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-card .stat-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 8px;
  font-size: 20px;
  color: white;
}
.stat-card .stat-value {
  font-family: var(--font-head);
  font-size: 28px;
  font-weight: 700;
  color: var(--md-on-surface);
}
.stat-card .stat-label {
  font-size: 12px;
  color: var(--md-on-surface-2);
  font-weight: 500;
}

/* ---------------------------------------------------------------
   Upload zone
---------------------------------------------------------------- */
.upload-zone {
  border: 2px dashed var(--md-divider);
  border-radius: var(--radius-lg);
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: all .2s ease;
  background: var(--md-surface);
}
.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--md-primary);
  background: var(--md-primary-light);
}
.upload-zone .upload-icon {
  font-size: 48px;
  color: var(--md-on-surface-3);
  margin-bottom: 12px;
  display: block;
}
.upload-zone .upload-title {
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 600;
  color: var(--md-on-surface);
  margin-bottom: 4px;
}
.upload-zone .upload-sub {
  font-size: 12px;
  color: var(--md-on-surface-2);
}

/* ---------------------------------------------------------------
   Student list item
---------------------------------------------------------------- */
.student-row-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-radius: var(--radius);
  transition: background .12s ease;
  cursor: pointer;
  gap: 12px;
  margin: 2px 0;
}
.student-row-item:hover { background: var(--md-hover); }
.student-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--md-primary);
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
}
.student-info { flex: 1; min-width: 0; }
.student-name {
  font-weight: 500;
  font-size: 14px;
  color: var(--md-on-surface);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.student-meta {
  font-size: 12px;
  color: var(--md-on-surface-2);
}

/* ---------------------------------------------------------------
   Ranking table
---------------------------------------------------------------- */
.rank-number {
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 700;
  color: var(--md-on-surface-3);
}
.rank-number.gold   { color: #fbbc04; }
.rank-number.silver { color: #9aa0a6; }
.rank-number.bronze { color: #c1936b; }

.score-value {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--md-primary);
}

/* ---------------------------------------------------------------
   Toast notifications
---------------------------------------------------------------- */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 9999;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: var(--radius);
  background: #323232;
  color: white;
  font-size: 13.5px;
  font-weight: 400;
  box-shadow: var(--md-shadow-3);
  animation: toastIn .25s cubic-bezier(.4,0,.2,1);
  min-width: 260px;
  max-width: 400px;
}
.toast.success { background: #137333; }
.toast.error   { background: var(--md-error); }
.toast.warning { background: #e37400; }
.toast .material-icons-round { font-size: 18px; }

/* ---------------------------------------------------------------
   Loading spinner
---------------------------------------------------------------- */
.spinner {
  width: 24px; height: 24px;
  border: 3px solid var(--md-divider);
  border-top-color: var(--md-primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}

/* ---------------------------------------------------------------
   Progress bar
---------------------------------------------------------------- */
.progress-bar-wrap {
  width: 100%;
  height: 6px;
  background: var(--md-divider);
  border-radius: 3px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--md-primary);
  transition: width .4s ease;
}

/* ---------------------------------------------------------------
   Empty state
---------------------------------------------------------------- */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--md-on-surface-2);
}
.empty-state .material-icons-round {
  font-size: 56px;
  color: var(--md-divider);
  margin-bottom: 12px;
  display: block;
}
.empty-state p { font-size: 14px; }

/* ---------------------------------------------------------------
   Section headers
---------------------------------------------------------------- */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}
.section-title {
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 600;
  color: var(--md-on-surface);
}
.section-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------------------------------------------------------------
   Search bar
---------------------------------------------------------------- */
.search-bar {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.search-bar .material-icons-round {
  position: absolute; left: 12px;
  color: var(--md-on-surface-3);
  font-size: 18px;
  pointer-events: none;
}
.search-bar input {
  padding: 9px 14px 9px 38px;
  border: 1.5px solid var(--md-divider);
  border-radius: 20px;
  font-family: var(--font-body);
  font-size: 13.5px;
  outline: none;
  width: 240px;
  transition: border-color .15s, width .3s;
  background: var(--md-bg);
}
.search-bar input:focus {
  border-color: var(--md-primary);
  background: var(--md-surface);
  width: 300px;
}

/* ---------------------------------------------------------------
   Log entries
---------------------------------------------------------------- */
.log-entry {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--md-divider);
  font-size: 13px;
}
.log-entry:last-child { border-bottom: none; }
.log-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--md-primary);
  margin-top: 5px;
  flex-shrink: 0;
}
.log-time { color: var(--md-on-surface-3); font-family: var(--font-mono); font-size: 11.5px; }
.log-action { font-weight: 500; }
.log-detail { color: var(--md-on-surface-2); font-size: 12px; }

/* ---------------------------------------------------------------
   Print styles
---------------------------------------------------------------- */
@media print {
  .sidebar, .topbar, .no-print { display: none !important; }
  .main-wrap { margin-left: 0; }
  .page-content { padding: 0; max-width: 100%; }
  .card { border: 1px solid #ccc; box-shadow: none; break-inside: avoid; }
  .btn { display: none; }
  body { background: white; }
}

/* ---------------------------------------------------------------
   Animations
---------------------------------------------------------------- */
@keyframes fadeIn   { from { opacity: 0 }         to { opacity: 1 } }
@keyframes slideUp  { from { transform: translateY(20px); opacity: 0 } to { transform: translateY(0); opacity: 1 } }
@keyframes spin     { to { transform: rotate(360deg) } }
@keyframes toastIn  { from { transform: translateX(100%); opacity: 0 } to { transform: translateX(0); opacity: 1 } }

/* ---------------------------------------------------------------
   Responsive
---------------------------------------------------------------- */
@media (max-width: 768px) {
  :root { --sidebar-width: 0px; }
  .sidebar { transform: translateX(-260px); }
  .sidebar.open { transform: translateX(0); width: 260px; }
  .page-content { padding: 16px; }
}

/* ---------------------------------------------------------------
   Misc utilities
---------------------------------------------------------------- */
.text-center { text-align: center; }
.text-muted  { color: var(--md-on-surface-2); }
.text-sm     { font-size: 12px; }
.flex        { display: flex; }
.items-center { align-items: center; }
.gap-2       { gap: 8px; }
.gap-3       { gap: 12px; }
.mt-1        { margin-top: 4px; }
.mt-2        { margin-top: 8px; }
.mt-3        { margin-top: 12px; }
.mt-4        { margin-top: 16px; }
.mb-4        { margin-bottom: 16px; }
.fw-600      { font-weight: 600; }
.font-mono   { font-family: var(--font-mono); }
.w-full      { width: 100%; }
.hidden      { display: none !important; }
.divider     { border: none; border-top: 1px solid var(--md-divider); margin: 16px 0; }

/* ---------------------------------------------------------------
   Suppression flèches +/- des inputs number
---------------------------------------------------------------- */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type="number"] {
    -moz-appearance: textfield;
}

/* ---------------------------------------------------------------
   Bulk grade tab switcher active state
---------------------------------------------------------------- */
.bulk-type-tab.active {
    background: var(--md-primary) !important;
    color: white !important;
}

/* ---------------------------------------------------------------
   Bulk table — locked row style
---------------------------------------------------------------- */
tr.bulk-row-locked td {
    opacity: .7;
}
tr.bulk-row-locked .student-avatar {
    background: var(--md-secondary) !important;
}

/* ---------------------------------------------------------------
   Bulk input — wider for the table
---------------------------------------------------------------- */
.bulk-input {
    width: 90px !important;
}

/* ---------------------------------------------------------------
   Grade delete button (×) next to each note input
---------------------------------------------------------------- */
.grade-input-wrap {
    position: relative;
}
.grade-delete-btn {
    opacity: 0;
    transition: opacity .15s ease;
    vertical-align: middle;
}
.grade-input-wrap:hover .grade-delete-btn {
    opacity: 1;
}
.grade-delete-btn:hover {
    color: var(--md-error) !important;
}

/* ---------------------------------------------------------------
   Sortable table row styles
---------------------------------------------------------------- */
.sortable-row {
    transition: background .12s ease;
}
.sortable-row[draggable="true"] {
    cursor: default;
}
.drag-handle {
    cursor: grab !important;
}
.drag-handle:active {
    cursor: grabbing !important;
}
.sortable-row.drag-over {
    border-top: 2px solid var(--md-primary);
}
