@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700&family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
  --primary: #004D40;
  --primary-dark: #00695C;
  --primary-light: #00897B;
  --secondary: #4DB6AC;
  --accent: #E0F2F1;
  --bg: #F1F5F9;
  --surface: #FFFFFF;
  --surface-hover: #F8FAFC;
  --border: #E2E8F0;
  --border-light: #F1F5F9;
  --text: #0F172A;
  --text-secondary: #64748B;
  --text-muted: #94A3B8;
  --present: #10B981;
  --present-bg: #D1FAE5;
  --present-border: #6EE7B7;
  --late: #F59E0B;
  --late-bg: #FEF3C7;
  --late-border: #FCD34D;
  --absent: #EF4444;
  --absent-bg: #FEE2E2;
  --absent-border: #FCA5A5;
  --success: #10B981;
  --error: #EF4444;
  --info: #3B82F6;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.08);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 999px;
}

::selection {
  background: var(--primary);
  color: white;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ===== APP SHELL ===== */
.app-shell {
  max-width: 720px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 16px 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.92);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.app-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.title-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--primary);
  color: white;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 700;
}

.header-date {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.app-main {
  flex: 1;
  padding: 20px;
  padding-bottom: 90px;
}

/* ===== TAB BAR ===== */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 720px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  display: flex;
  padding: 6px 8px 10px;
  z-index: 100;
}

.tab-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  color: var(--text-muted);
}

.tab-btn.active {
  color: var(--primary);
  background: var(--primary-light);
}

.tab-btn:hover:not(.active) {
  background: var(--border-light);
}

.tab-icon {
  font-size: 1.2rem;
}

.tab-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ===== SECTIONS ===== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
}

.sub-heading {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-secondary);
}

.badge {
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

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

.btn-secondary {
  background: var(--surface);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--surface-hover);
  border-color: var(--text-muted);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.78rem;
}

.btn-full {
  width: 100%;
  padding: 14px;
  font-size: 0.95rem;
}

.btn-icon {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.15s ease;
  background: transparent;
}

.btn-edit:hover { background: var(--primary-light); }
.btn-delete:hover { background: var(--absent-bg); }
.btn-save { background: var(--present-bg); color: var(--present); }
.btn-cancel { background: var(--absent-bg); color: var(--absent); }

/* ===== INPUTS ===== */
.input-field {
  padding: 10px 14px;
  font-family: inherit;
  font-size: 0.88rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  transition: all 0.2s ease;
  outline: none;
  width: 100%;
}

.input-field:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.input-field::placeholder {
  color: var(--text-muted);
}

.input-sm {
  padding: 8px 10px;
  font-size: 0.82rem;
}

select.input-field {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394A3B8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

/* ===== FORMS ===== */
.add-student-form {
  margin-bottom: 20px;
}

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

.input-name {
  flex: 2;
}

.input-id {
  flex: 1;
}

.edit-row {
  display: flex;
  gap: 6px;
  align-items: center;
  width: 100%;
}

.input-id-sm {
  max-width: 100px;
}

/* ===== STUDENT LIST ===== */
.student-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.student-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  animation: slideIn 0.35s ease both;
  transition: box-shadow 0.2s ease;
}

.student-card:hover {
  box-shadow: var(--shadow-sm);
}

.student-info-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.student-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.student-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.student-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
}

.student-id-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.student-actions {
  display: flex;
  gap: 4px;
}

/* ===== ATTENDANCE VIEW ===== */
.attendance-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border: 1px solid var(--border);
  animation: slideIn 0.4s ease both;
}

.stat-card:nth-child(1) { animation-delay: 0s; }
.stat-card:nth-child(2) { animation-delay: 0.08s; }
.stat-card:nth-child(3) { animation-delay: 0.16s; }

.stat-present { border-left: 3px solid var(--present); }
.stat-late { border-left: 3px solid var(--late); }
.stat-absent { border-left: 3px solid var(--absent); }

.stat-number {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
}

.stat-present .stat-number { color: var(--present); }
.stat-late .stat-number { color: var(--late); }
.stat-absent .stat-number { color: var(--absent); }

.stat-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ===== PROGRESS BAR ===== */
.progress-bar-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.progress-bar {
  flex: 1;
  height: 8px;
  background: var(--border-light);
  border-radius: var(--radius-full);
  display: flex;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  transition: width 0.5s ease;
}

.present-fill {
  background: var(--present);
  border-radius: var(--radius-full) 0 0 var(--radius-full);
}

.late-fill {
  background: var(--late);
}

.progress-text {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* ===== ATTENDANCE CONTROLS ===== */
.attendance-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.filter-btn:hover:not(.active) {
  background: var(--surface-hover);
}

.filter-count {
  background: rgba(255, 255, 255, 0.2);
  padding: 1px 6px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
}

.filter-btn.active .filter-count {
  background: rgba(255, 255, 255, 0.25);
}

/* ===== ATTENDANCE LIST ===== */
.attendance-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.attendance-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  animation: slideIn 0.3s ease both;
  transition: box-shadow 0.15s ease;
}

.attendance-row:hover {
  box-shadow: var(--shadow-sm);
}

.attendance-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1.5px solid;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.status-badge:hover {
  transform: scale(1.04);
}

.status-present {
  background: var(--present-bg);
  color: var(--present);
  border-color: var(--present-border);
}

.status-late {
  background: var(--late-bg);
  color: var(--late);
  border-color: var(--late-border);
}

.status-absent {
  background: var(--absent-bg);
  color: var(--absent);
  border-color: var(--absent-border);
}

/* ===== CHECK-IN ===== */
.checkin-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.mode-toggle {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.toggle-btn {
  flex: 1;
  padding: 10px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  background: transparent;
  color: var(--text-secondary);
}

.toggle-btn.active {
  background: var(--primary);
  color: white;
  box-shadow: var(--shadow-sm);
}

/* Teacher view */
.teacher-checkin {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.qr-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  text-align: center;
  animation: slideIn 0.4s ease both;
}

.checkin-heading {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.checkin-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.qr-display {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.qr-image {
  width: 220px;
  height: 220px;
  border-radius: var(--radius-md);
  border: 2px solid var(--border-light);
}

.qr-placeholder {
  width: 220px;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 0.85rem;
}

.code-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 8px;
}

.code-label {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.code-value {
  font-family: 'Space Grotesk', monospace;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.15em;
  background: var(--primary-light);
  padding: 6px 18px;
  border-radius: var(--radius-sm);
}

.code-note {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Settings */
.settings-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  animation: slideIn 0.4s ease both;
  animation-delay: 0.1s;
}

.settings-section .checkin-heading {
  margin-bottom: 16px;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
}

.setting-row + .setting-row {
  border-top: 1px solid var(--border-light);
}

.setting-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.input-time, .input-minutes {
  width: auto;
  max-width: 120px;
  text-align: center;
}

/* Student check-in */
.student-checkin {
  animation: slideIn 0.4s ease both;
}

.checkin-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
}

.checkin-card .checkin-sub {
  margin-bottom: 24px;
}

.checkin-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.select-student {
  padding: 14px;
  font-size: 0.95rem;
}

.input-code {
  text-align: center;
  font-family: 'Space Grotesk', monospace;
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  padding: 16px;
}

/* Messages */
.message {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  animation: slideIn 0.3s ease both;
}

.message-success {
  background: var(--present-bg);
  color: var(--present);
  border: 1px solid var(--present-border);
}

.message-error {
  background: var(--absent-bg);
  color: var(--absent);
  border: 1px solid var(--absent-border);
}

.message-info {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary);
}

/* ===== HISTORY ===== */
.history-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.history-filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* Overview */
.stats-summary {
  animation: slideIn 0.4s ease both;
}

.overview-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.overview-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  animation: slideIn 0.3s ease both;
}

.overview-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.overview-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.overview-detail {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

.overview-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.rate-bar {
  width: 60px;
  height: 6px;
  background: var(--border-light);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.rate-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.5s ease;
}

.rate-good { background: var(--present); }
.rate-ok { background: var(--late); }
.rate-low { background: var(--absent); }

.rate-text {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  min-width: 36px;
  text-align: right;
}

.text-good { color: var(--present); }
.text-ok { color: var(--late); }
.text-low { color: var(--absent); }

/* Records */
.records-list {
  animation: slideIn 0.4s ease both;
}

.record-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 4px;
  animation: slideIn 0.3s ease both;
}

.record-left {
  display: flex;
  flex-direction: column;
}

.record-name {
  font-weight: 600;
  font-size: 0.88rem;
}

.record-date {
  font-size: 0.72rem;
  color: var(--text-muted);
}

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

.status-pill {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
}

.record-method {
  font-size: 0.85rem;
}

/* ===== EMPTY & LOADING ===== */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  animation: slideIn 0.5s ease both;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  opacity: 0.6;
}

.empty-text {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.empty-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.loading-container {
  padding: 20px 0;
}

@keyframes pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.7; }
}

.skeleton-block {
  background: var(--border);
  border-radius: var(--radius-sm);
  animation: pulse 1.5s infinite ease-in-out;
}

.skeleton-title {
  height: 28px;
  width: 60%;
  margin-bottom: 16px;
}

.skeleton-row {
  height: 56px;
  width: 100%;
  margin-bottom: 8px;
}

.skeleton-stat {
  height: 80px;
  width: 100%;
}

.skeleton-qr {
  height: 220px;
  width: 220px;
  margin: 20px auto;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
  .app-main {
    padding: 14px;
    padding-bottom: 84px;
  }

  .form-row {
    flex-wrap: wrap;
  }

  .input-name, .input-id {
    flex: 1 1 100%;
  }

  .form-row .btn {
    width: 100%;
  }

  .attendance-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-group {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  .history-filters {
    grid-template-columns: 1fr;
  }

  .code-value {
    font-size: 1.3rem;
  }

  .qr-image, .qr-placeholder {
    width: 180px;
    height: 180px;
  }

  .stat-number {
    font-size: 1.5rem;
  }

  .overview-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .overview-right {
    width: 100%;
    justify-content: flex-end;
  }

  .rate-bar {
    flex: 1;
  }
}
```

<!-- WALKTHROUGH_SCRIPT:
[
  {"step": 1, "narration": "Welcome to your Attendance Tracker! This is your daily attendance view where you can see who's present, late, or absent at a glance.", "view": "teacher", "highlight_selector": ".stats-grid", "wait_for": "tap_to_continue"},
  {"step": 2, "narration": "First, let's add students to your class roster. Tap the Roster tab at the bottom.", "view": "teacher", "highlight_selector": ".tab-btn:nth-child(3)", "wait_for": "user_interaction"},
  {"step": 3, "narration": "Type a student's name and optionally an ID, then tap Add. You can add as many students as you need.", "view": "teacher", "highlight_selector": ".add-student-form", "wait_for": "user_interaction"},
  {"step": 4, "narration": "Now go to the Today tab. You'll see all your students listed. Tap any status badge to cycle through Present, Late, and Absent.", "view": "teacher", "highlight_selector": ".attendance-list", "wait_for": "user_interaction"},
  {"step": 5, "narration": "For self-service check-in, tap the Check In tab. In Teacher View, you'll see a QR code and daily code students can use.", "view": "teacher", "highlight_selector": ".qr-section", "wait_for": "tap_to_continue"},
  {"step": 6, "narration": "Switch to Student Check-In mode. Students select their name, enter today's code, and tap Check In. They're automatically marked present or late based on your class time settings.", "view": "student", "highlight_selector": ".checkin-card", "wait_for": "tap_to_continue"},
  {"step": 7, "narration": "The History tab shows attendance trends, per-student rates, and lets you export records to CSV. You can filter by date or student.", "view": "teacher", "highlight_selector": ".history-container", "wait_for": "tap_to_continue"}
]
-->

.auth-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin-bottom: 20px;
}

.auth-card-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
  margin-bottom: 4px;
}

.auth-card-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3px;
}

.auth-card-sub {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.student-auth-label {
  font-size: 0.72rem;
  color: var(--primary);
}

.student-auth-muted {
  color: var(--text-muted);
}

.input-auth-sm {
  max-width: 150px;
}

@media (max-width: 640px) {
  .auth-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .input-auth-sm {
    max-width: 100%;
  }
}

.teacher-auth-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
}

.teacher-auth-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
  margin-bottom: 4px;
}

.teacher-auth-name {
  font-size: 0.92rem;
  font-weight: 700;
}

.teacher-auth-info {
  min-width: 0;
}

.teacher-auth-actions {
  flex-shrink: 0;
}

.checkin-card .message,
.teacher-checkin .message {
  margin-top: 0;
}

@media (max-width: 640px) {
  .teacher-auth-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .teacher-auth-actions {
    width: 100%;
  }

  .teacher-auth-actions .btn {
    width: 100%;
  }
}

.history-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

.badge-expired { background: var(--absent-bg); color: var(--absent); }
.badge-active { background: var(--present-bg); color: var(--present); }

.timer-status-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.timer-status-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.timer-status-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  font-weight: 700;
}

.timer-status-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  text-align: right;
}

@media (max-width: 640px) {
  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .history-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .history-actions .btn {
    flex: 1 1 auto;
  }

  .timer-status-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .timer-status-meta {
    text-align: left;
  }
}

.history-view {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.history-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.history-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.history-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.history-row-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.history-student {
  font-weight: 600;
}

.history-meta {
  font-size: 0.9rem;
  opacity: 0.8;
}

.history-status {
  text-transform: capitalize;
  font-weight: 600;
}

.history-status.status-present {
  color: #2ecc71;
}

.history-status.status-absent {
  color: #ff6b6b;
}

.history-status.status-late {
  color: #f39c12;
}

.history-charts {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.history-chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  animation: slideIn 0.35s ease both;
}

.history-chart-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.chart-caption {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.history-chart {
  width: 100%;
  height: 240px;
}

@media (max-width: 640px) {
  .history-chart {
    height: 220px;
  }

  .history-chart-header {
    flex-direction: column;
    align-items: flex-start;
  }
}
