/* ============================================================
   DIU CPC Python, Data Science & Machine Learning Course 
   Attendance System — CSS Stylesheet
   ============================================================ */

/* ---------- CSS Custom Properties ---------- */
:root {
  /* Brand Accent Colors */
  --python-yellow: hsl(48, 95%, 55%);
  --ds-cyan: hsl(190, 95%, 50%);
  --ml-violet: hsl(265, 90%, 65%);

  --blue-400: hsl(213, 94%, 68%);
  --blue-500: hsl(217, 91%, 60%);
  --blue-600: hsl(221, 83%, 53%);
  --cyan-400: hsl(187, 92%, 69%);
  --cyan-500: hsl(188, 86%, 53%);

  /* Dark Theme Surfaces */
  --bg-base: hsl(222, 30%, 7%);
  --bg-surface: hsl(222, 24%, 11%);
  --bg-card: hsl(222, 22%, 13%);
  --bg-input: hsl(222, 20%, 16%);
  --bg-checkbox: hsla(222, 20%, 16%, 0.6);
  --bg-header: rgba(12, 16, 26, 0.88);

  --border-color: hsl(222, 20%, 20%);
  --border-focus: hsl(265, 90%, 65%);

  --text-primary: hsl(220, 20%, 96%);
  --text-secondary: hsl(220, 12%, 72%);
  --text-muted: hsl(220, 10%, 52%);

  --success: hsl(142, 76%, 42%);
  --danger: hsl(0, 78%, 56%);
  --warning: hsl(38, 92%, 52%);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.55);
  --shadow-glow: 0 0 45px hsla(265, 90%, 65%, 0.2);

  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: 0.15s ease;
}

/* Light Theme (Day Mode) Overrides */
:root[data-theme="light"] {
  --bg-base: #f4f6fb;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-input: #f8fafc;
  --bg-checkbox: rgba(226, 232, 240, 0.8);
  --bg-header: rgba(255, 255, 255, 0.94);

  --border-color: #cbd5e1;
  --border-focus: #7c3aed;

  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;

  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 16px 40px rgba(15, 23, 42, 0.12);
  --shadow-glow: 0 0 35px rgba(124, 58, 237, 0.12);

  /* High-Contrast Colors for Day Mode */
  --python-yellow: #b45309;
  --ds-cyan: #0284c7;
  --ml-violet: #6d28d9;
}

:root[data-theme="light"] .bg-grid {
  background-image:
    linear-gradient(to right, rgba(203, 213, 225, 0.5) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(203, 213, 225, 0.5) 1px, transparent 1px);
}

:root[data-theme="light"] .attendance-table tr:hover {
  background: rgba(241, 245, 249, 0.9);
}

:root[data-theme="light"] .info-card,
:root[data-theme="light"] .form-card,
:root[data-theme="light"] .table-card {
  background: #ffffff;
  border-color: #cbd5e1;
}

:root[data-theme="light"] .form-input {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
}

:root[data-theme="light"] .form-input:focus {
  background: #ffffff;
  border-color: #7c3aed;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

:root[data-theme="light"] .diff-pill {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #334155;
}

:root[data-theme="light"] .diff-pill:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
}

:root[data-theme="light"] .diff-pill.selected {
  background: #7c3aed;
  color: #ffffff;
  border-color: #6d28d9;
}

:root[data-theme="light"] .badge-batch {
  background: rgba(245, 158, 11, 0.14);
  color: #b45309;
}

:root[data-theme="light"] .badge-dept {
  background: rgba(14, 165, 233, 0.14);
  color: #0369a1;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* ---------- Background Effects ---------- */
.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(to right, hsla(222, 20%, 20%, 0.35) 1px, transparent 1px),
    linear-gradient(to bottom, hsla(222, 20%, 20%, 0.35) 1px, transparent 1px);
  background-size: 44px 44px;
  pointer-events: none;
  z-index: 0;
}

.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.16;
}

.bg-glow-1 {
  width: 650px;
  height: 650px;
  background: radial-gradient(circle, var(--ml-violet), transparent 70%);
  top: -250px;
  right: -150px;
}

.bg-glow-2 {
  width: 550px;
  height: 550px;
  background: radial-gradient(circle, var(--ds-cyan), transparent 70%);
  bottom: -200px;
  left: -120px;
}

.bg-glow-3 {
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, var(--python-yellow), transparent 70%);
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* ---------- Container ---------- */
.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 1.5rem;
  position: relative;
  z-index: 1;
}

/* ---------- Header ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-header);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-shrink: 0;
}

.logo-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-pulse {
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  background: radial-gradient(circle, hsla(265, 90%, 65%, 0.4), transparent 70%);
  animation: pulse 2.8s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50% { opacity: 0.85; transform: scale(1.2); }
}

.logo-img {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: contain;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 0 12px hsla(265, 90%, 65%, 0.5));
  transition: filter var(--transition);
}

.logo-img:hover {
  filter: drop-shadow(0 0 18px hsla(190, 95%, 50%, 0.7));
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.brand-tagline {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.header-center {
  flex: 1;
  display: flex;
  justify-content: center;
}

.course-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: hsl(142, 76%, 70%);
  background: hsla(142, 76%, 36%, 0.15);
  border: 1px dashed hsla(142, 76%, 36%, 0.45);
  padding: 0.4rem 1rem;
  border-radius: 100px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: hsl(142, 76%, 50%);
  box-shadow: 0 0 8px hsl(142, 76%, 50%);
  animation: blink 1.6s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.header-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.live-clock {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ds-cyan);
  letter-spacing: 0.05em;
}

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

.theme-toggle {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius-sm);
  transition: transform var(--transition), background var(--transition);
}

.theme-toggle:hover {
  transform: scale(1.08);
  background: var(--bg-card);
}

/* ---------- Main & Hero Section ---------- */
.main {
  padding-top: 2rem;
  padding-bottom: 3rem;
}

.fade-up {
  animation: fadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.hero-section {
  margin-bottom: 2.5rem;
}

.hero-top-bar {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.8rem;
  flex-wrap: wrap;
}

.open-all-tag {
  background: linear-gradient(135deg, hsla(48, 95%, 55%, 0.18), hsla(190, 95%, 50%, 0.18));
  border: 1px solid hsla(48, 95%, 55%, 0.4);
  color: var(--python-yellow);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.3rem 0.85rem;
  border-radius: 100px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.org-tag {
  background: hsla(265, 90%, 65%, 0.15);
  border: 1px solid hsla(265, 90%, 65%, 0.35);
  color: var(--ml-violet);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.3rem 0.85rem;
  border-radius: 100px;
  letter-spacing: 0.04em;
}

.hero-header-block {
  margin-bottom: 1.8rem;
}

.hero-title {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(2rem, 4.5vw, 3.4rem);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 0.6rem;
}

.title-python {
  color: var(--python-yellow);
  text-shadow: 0 0 25px hsla(48, 95%, 55%, 0.3);
}

.gradient-text-ds {
  background: linear-gradient(135deg, var(--ds-cyan), hsl(200, 90%, 65%));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.gradient-text-ml {
  background: linear-gradient(135deg, var(--ml-violet), hsl(290, 85%, 70%));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 780px;
  font-weight: 500;
}

/* Course Pillars */
.course-pillars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.2rem;
  margin-bottom: 2rem;
}

.pillar-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.2rem 1.4rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.pillar-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.pillar-python:hover { border-color: hsla(48, 95%, 55%, 0.5); }
.pillar-ds:hover { border-color: hsla(190, 95%, 50%, 0.5); }
.pillar-ml:hover { border-color: hsla(265, 90%, 65%, 0.5); }

.pillar-icon {
  font-size: 2rem;
  line-height: 1;
}

.pillar-title {
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  margin-bottom: 0.25rem;
}

.pillar-python .pillar-title { color: var(--python-yellow); }
.pillar-ds .pillar-title { color: var(--ds-cyan); }
.pillar-ml .pillar-title { color: var(--ml-violet); }

.pillar-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* Info Grid: Class Details & Instructor */
.hero-info-grid {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 1.4rem;
  margin-bottom: 2rem;
}

@media (max-width: 900px) {
  .hero-info-grid {
    grid-template-columns: 1fr;
  }
}

.info-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.info-card-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.2rem;
}

.info-card-header h4 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.info-icon {
  font-size: 1.3rem;
}

.info-details-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  background: var(--bg-surface);
  padding: 0.8rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.item-icon {
  font-size: 1.4rem;
}

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

.item-value {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--ds-cyan);
}

.instructor-card {
  border-left: 4px solid var(--ml-violet);
  background: linear-gradient(135deg, var(--bg-card), hsla(265, 90%, 65%, 0.04));
}

.instructor-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--ml-violet);
  background: hsla(265, 90%, 65%, 0.15);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  margin-bottom: 0.4rem;
}

.instructor-name {
  font-family: 'Outfit', sans-serif;
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.3rem;
}

.instructor-role {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 1.1rem;
  line-height: 1.4;
}

.instructor-achievements {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.achievement-badge {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  background: var(--bg-surface);
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.achieve-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

/* Stats Row */
.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.2rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stat-icon {
  font-size: 2.2rem;
}

.stat-value {
  display: block;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--python-yellow);
  line-height: 1.2;
}

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

/* ---------- Form Section ---------- */
.form-section {
  margin-bottom: 3rem;
}

.form-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2.2rem;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.form-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--python-yellow), var(--ds-cyan), var(--ml-violet));
}

.form-card-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.form-header-icon {
  width: 50px;
  height: 50px;
  background: hsla(265, 90%, 65%, 0.15);
  border: 1px solid hsla(265, 90%, 65%, 0.3);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
}

.form-card-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-primary);
}

.form-card-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Attendance Form Layout */
.attendance-form {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.2rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-label {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.label-icon {
  font-size: 1rem;
}

.opt-tag {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 400;
}

.form-input {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.8rem 1rem;
  font-family: inherit;
  font-size: 0.92rem;
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

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

.form-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px hsla(265, 90%, 65%, 0.2);
}

.form-input.error {
  border-color: var(--danger) !important;
}

.form-input.success {
  border-color: var(--success) !important;
}

.form-select {
  cursor: pointer;
}

.form-error {
  font-size: 0.75rem;
  color: var(--danger);
  min-height: 1rem;
}

/* Feedback Section */
.feedback-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.4rem;
}

.feedback-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.2rem;
}

.feedback-toggle-left {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.feedback-toggle-icon {
  font-size: 1.4rem;
}

.feedback-toggle-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.req-star {
  color: var(--danger);
}

.feedback-toggle-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.feedback-body {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

/* Star Rating */
.star-rating {
  display: flex;
  gap: 0.4rem;
}

.star {
  background: none;
  border: none;
  font-size: 1.8rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: transform var(--transition-fast), color var(--transition-fast);
}

.star:hover, .star.active {
  color: var(--python-yellow);
  transform: scale(1.15);
}

.star-label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
}

/* Difficulty Pills */
.difficulty-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.diff-pill {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
  border-radius: 100px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.diff-pill:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.diff-pill.selected {
  background: hsla(190, 95%, 50%, 0.2);
  border-color: var(--ds-cyan);
  color: var(--ds-cyan);
}

.feedback-textarea {
  resize: vertical;
}

.char-count {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: right;
  margin-top: 0.2rem;
}

/* Checkbox */
.checkbox-group {
  margin-top: 0.4rem;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-secondary);
  user-select: none;
}

.checkbox-input {
  display: none;
}

.checkbox-custom {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-color);
  border-radius: 4px;
  background: var(--bg-input);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
  transition: all var(--transition);
}

.checkbox-input:checked + .checkbox-custom {
  background: var(--ds-cyan);
  border-color: var(--ds-cyan);
}

.checkbox-input:checked + .checkbox-custom::after {
  content: '✓';
  color: #000;
  font-weight: 900;
  font-size: 0.85rem;
}

/* Submit Button */
.btn-submit {
  position: relative;
  background: linear-gradient(135deg, hsl(265, 90%, 65%), hsl(221, 83%, 53%));
  border: none;
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 1.05rem;
  padding: 1rem 2rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  overflow: hidden;
  box-shadow: 0 4px 20px hsla(265, 90%, 65%, 0.35);
  transition: transform var(--transition), box-shadow var(--transition);
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px hsla(265, 90%, 65%, 0.5);
}

.btn-shimmer {
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  transform: skewX(-20deg);
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0% { left: -100%; }
  20%, 100% { left: 200%; }
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 1000;
  background: var(--bg-card);
  border: 1px solid var(--success);
  border-radius: var(--radius-md);
  padding: 1rem 1.4rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-lg);
  transform: translateY(120px);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast-icon {
  font-size: 1.6rem;
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
}

/* ---------- Table Section ---------- */
.table-section {
  margin-top: 3rem;
}

.table-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2rem;
  box-shadow: var(--shadow-lg);
}

.table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.table-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
}

.table-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.table-actions {
  display: flex;
  gap: 0.8rem;
}

.btn-action {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all var(--transition);
}

.btn-action:hover {
  background: var(--bg-surface);
  border-color: var(--ds-cyan);
}

.btn-danger {
  color: var(--danger);
}

.btn-danger:hover {
  border-color: var(--danger);
  background: hsla(0, 78%, 56%, 0.1);
}

.search-bar {
  position: relative;
  margin-bottom: 1.4rem;
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.search-input {
  width: 100%;
  padding-left: 2.8rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding-top: 0.8rem;
  padding-bottom: 0.8rem;
  color: var(--text-primary);
  outline: none;
}

.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.attendance-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.84rem;
}

.attendance-table th {
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-weight: 700;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.attendance-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
}

.attendance-table tr:hover {
  background: hsla(222, 20%, 20%, 0.4);
}

.name-cell {
  font-weight: 600;
  color: var(--text-primary);
}

.sync-badge {
  display: inline-block;
  margin-left: 0.5rem;
  font-size: 0.68rem;
  padding: 0.15rem 0.5rem;
  border-radius: 100px;
  background: hsla(142, 76%, 36%, 0.15);
  color: hsl(142, 76%, 60%);
  font-weight: 600;
}

.badge-pill {
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-batch {
  background: hsla(48, 95%, 55%, 0.15);
  color: var(--python-yellow);
}

.badge-dept {
  background: hsla(190, 95%, 50%, 0.15);
  color: var(--ds-cyan);
}

.delete-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  opacity: 0.7;
  transition: opacity var(--transition);
}

.delete-btn:hover {
  opacity: 1;
}

.table-empty {
  display: none;
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
}

.table-empty.show {
  display: block;
}

.empty-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 0.5rem;
}

.sheet-section {
  margin-top: 3rem;
}

.sheet-sync-status {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.35rem 0.75rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.sheet-sync-status.ok {
  color: var(--success);
  background: hsla(142, 76%, 42%, 0.12);
  border-color: hsla(142, 76%, 42%, 0.3);
}

.sheet-sync-status.error {
  color: var(--danger);
  background: hsla(0, 78%, 56%, 0.12);
  border-color: hsla(0, 78%, 56%, 0.3);
}

.info-details-row {
  flex-direction: row !important;
  flex-wrap: wrap;
  gap: 1rem;
}

.info-details-row .info-item {
  flex: 1;
  min-width: 180px;
}

.footer-link-instructor {
  color: var(--ml-violet) !important;
  border-bottom: 1px dashed currentColor;
  padding-bottom: 0.1rem;
}

.footer-link-instructor:hover {
  color: var(--python-yellow) !important;
  border-color: currentColor;
}

/* ---------- Footer ---------- */
.footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  padding: 2.5rem 0;
  margin-top: 4rem;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.footer-logo-img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
}

.footer-name {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 1rem;
}

.footer-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.footer-center {
  text-align: center;
}

.footer-course {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--python-yellow);
}

.footer-instructor {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
}

.footer-copy {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.footer-copy a {
  color: var(--ds-cyan);
  text-decoration: none;
}

.footer-links {
  display: flex;
  gap: 1.2rem;
}

.footer-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color var(--transition);
}

.footer-link:hover {
  color: var(--ds-cyan);
}

/* ============================================================
   MOBILE RESPONSIVENESS (<992px, <768px, <480px)
   ============================================================ */
@media (max-width: 992px) {
  .container {
    padding: 0 1.25rem;
  }

  .hero-title {
    font-size: 2.3rem;
  }

  .hero-stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
  }

  .stat-card {
    padding: 0.9rem 0.75rem;
    flex-direction: column;
    text-align: center;
    gap: 0.4rem;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }

  /* Header Mobile Layout */
  .header-inner {
    flex-wrap: wrap;
    justify-content: space-between;
    padding: 0.7rem 0.85rem;
    gap: 0.6rem;
  }

  .header-center {
    order: 3;
    width: 100%;
    text-align: center;
    margin-top: 0.1rem;
  }

  .course-badge {
    font-size: 0.74rem;
    padding: 0.25rem 0.65rem;
    display: inline-flex;
    white-space: normal;
    text-align: center;
    line-height: 1.3;
  }

  .header-brand {
    gap: 0.5rem;
  }

  .logo-img {
    width: 34px;
    height: 34px;
  }

  .brand-name {
    font-size: 1.05rem;
  }

  .brand-tagline {
    font-size: 0.65rem;
  }

  .live-clock {
    font-size: 0.78rem;
    padding: 0.25rem 0.55rem;
  }

  .theme-toggle {
    width: 36px;
    height: 36px;
    font-size: 1.05rem;
  }

  .date-display {
    display: none;
  }

  /* Hero Section Mobile Layout */
  .hero {
    padding: 2rem 0 1rem;
  }

  .hero-top-bar {
    flex-direction: column;
    gap: 0.4rem;
    align-items: center;
  }

  .open-all-tag, .org-tag {
    font-size: 0.7rem;
    padding: 0.25rem 0.65rem;
  }

  .hero-title {
    font-size: 1.85rem;
    line-height: 1.25;
    margin: 0.8rem 0;
  }

  .hero-subtitle {
    font-size: 0.9rem;
    padding: 0 0.5rem;
  }

  .course-pillars {
    grid-template-columns: 1fr;
    gap: 0.85rem;
    margin-bottom: 1.8rem;
  }

  .pillar-card {
    padding: 1rem 1.1rem;
  }

  .pillar-title {
    font-size: 1.05rem;
  }

  .pillar-desc {
    font-size: 0.8rem;
  }

  .info-details-row {
    flex-direction: column !important;
    gap: 0.85rem;
  }

  .info-details-row .info-item {
    min-width: 100%;
    padding: 0.6rem 0.8rem;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
  }

  .hero-stats {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .stat-card {
    flex-direction: row;
    text-align: left;
    padding: 1rem 1.25rem;
    gap: 1rem;
  }

  .stat-value {
    font-size: 1.25rem;
  }

  /* Form Mobile Layout */
  .form-card {
    padding: 1.35rem 1rem;
    border-radius: var(--radius-lg);
  }

  .form-header-title {
    font-size: 1.25rem;
  }

  .form-header-subtitle {
    font-size: 0.8rem;
  }

  .form-row {
    flex-direction: column;
    gap: 1.1rem;
  }

  .form-group {
    width: 100%;
  }

  /* Prevent iOS input zoom by ensuring 16px font-size */
  .form-input, .form-select {
    font-size: 16px !important;
    min-height: 48px;
    padding: 0.75rem 0.9rem;
  }

  .difficulty-pills {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
  }

  .diff-pill {
    min-height: 48px;
    padding: 0.7rem 0.4rem;
    font-size: 0.82rem;
    text-align: center;
    justify-content: center;
    border-radius: var(--radius-sm);
  }

  .star-rating {
    gap: 0.5rem;
    justify-content: center;
  }

  .star {
    font-size: 2.2rem;
    padding: 0.3rem;
    min-width: 48px;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .checkbox-label {
    gap: 0.75rem;
    font-size: 0.84rem;
  }

  .btn-submit {
    width: 100%;
    min-height: 52px;
    justify-content: center;
    padding: 0.9rem;
    font-size: 1rem;
  }

  /* Table Mobile Layout */
  .table-card {
    padding: 1.1rem 0.85rem;
    border-radius: var(--radius-lg);
  }

  .table-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .table-title {
    font-size: 1.2rem;
  }

  .table-actions {
    width: 100%;
    justify-content: space-between;
    gap: 0.5rem;
  }

  .btn-action {
    flex: 1;
    justify-content: center;
    padding: 0.6rem 0.75rem;
    font-size: 0.8rem;
  }

  .search-input {
    font-size: 16px !important;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
  }

  .table-wrapper {
    -webkit-overflow-scrolling: touch;
  }

  .attendance-table th,
  .attendance-table td {
    padding: 0.65rem 0.55rem;
    font-size: 0.76rem;
  }

  /* Footer Mobile Layout */
  .footer {
    padding: 2rem 0 1.5rem;
    margin-top: 2.5rem;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
    gap: 1.25rem;
  }

  .footer-brand {
    flex-direction: column;
    gap: 0.6rem;
  }

  .footer-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.85rem;
  }

  .footer-link {
    font-size: 0.8rem;
  }

  /* Toast Notification Mobile */
  .toast {
    left: 0.85rem;
    right: 0.85rem;
    bottom: 1rem;
    transform: translateY(120px);
    max-width: none;
    width: auto;
    padding: 0.85rem 1.1rem;
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 1.55rem;
  }

  .difficulty-pills {
    grid-template-columns: 1fr;
  }

  .diff-pill {
    width: 100%;
  }

  .brand-name {
    font-size: 0.95rem;
  }

  .brand-tagline {
    display: none;
  }
}


