:root {
  --primary: #0d6efd;
  --primary-dark: #0b5ed7;
  --page: #f6f7fb;
  /* Solid page background fixes the "column" */
  --card-bg: #ffffff;
  --radius: 16px;
  --transition: 0.25s ease;
}

/* Reset & base */
* {
  box-sizing: border-box;
}

html {
  height: 100%;
}

body {
  min-height: 100svh;
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--page);
  display: grid;
  place-items: center;
  /* centers the card */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---------- Card ---------- */
.card {
  width: 100%;
  max-width: 420px;
  padding: 32px 28px 36px;
  background: var(--card-bg);
  /* solid white, no frosted blur */
  border-radius: var(--radius);
  box-shadow: 0 12px 30px rgba(16, 24, 40, 0.08);
  text-align: center;
  animation: fade-in 0.45s ease both;
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.logo {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--primary);
}

.subtitle {
  font-size: 0.95rem;
  color: #6b7280;
  margin-bottom: 24px;
}

/* ---------- Form ---------- */
.field {
  position: relative;
  margin-bottom: 14px;
}

.field input, 
.field select { /* Applied to select as well for consistency */
  width: 100%;
  padding: 12px 16px; /* Slightly more compact */
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #ffffff; /* ✨ NEW: White background is cleaner */
  font-size: 0.95rem;
  color: #1f2937;
  outline: none;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03); /* ✨ NEW: Subtle depth */
}

/* Fix for the password eye icon padding if needed, usually handled by specific class, 
   but this keeps the general inputs clean */
.field input:focus,
.field select:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.1); /* ✨ NEW: Soft glow ring */
}

.field input:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.12);
}

.toggle-password {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  border: none;
  background: none;
  cursor: pointer;
  font-size: 1rem;
  color: #9ca3af;
  padding: 2px 6px;
  border-radius: 8px;
}

.toggle-password:hover {
  color: var(--primary);
}

/* ---------- Button ---------- */
.btn {
  width: 100%;
  padding: 14px;
  margin-top: 6px;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  background: var(--primary);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: background var(--transition), transform 0.05s ease;
}

.btn:hover,
.btn:focus-visible {
  background: var(--primary-dark);
}

.btn:active {
  transform: translateY(1px);
}

/* ---------- Messages ---------- */
#message {
  margin-top: 14px;
  font-size: 0.93rem;
  font-weight: 500;
  min-height: 1.2em;
}

.error {
  color: #d52731;
}

.success {
  color: #269f53;
}

/* ---------- Logout button ---------- */
/* Tiny logout icon (top-left of the page) */
.logout-icon {
  position: fixed;
  top: 12px;
  left: 12px;
  width: 26px;
  height: 26px;
  padding: 0;
  border: none;
  border-radius: 9999px;
  display: grid;
  place-items: center;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(16, 24, 40, 0.12);
  transition: background var(--transition), transform 0.05s ease;
  z-index: 1000;
}

.logout-icon i {
  font-size: 14px;
  /* slightly larger than before */
  line-height: 1;
}

.logout-icon:hover {
  background: var(--primary-dark);
}

.logout-icon:active {
  transform: translateY(1px);
}


/* ---------- Floating Action Button (Bottom Left) ---------- */
.fab-btn {
  position: fixed;
  bottom: 24px;
  left: 24px;
  /* Bottom Left as requested */
  width: 56px;
  height: 56px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(13, 110, 253, 0.4);
  font-size: 1.5rem;
  cursor: pointer;
  display: none;
  /* Hidden by default until logged in */
  place-items: center;
  transition: transform 0.2s ease, background 0.2s;
  z-index: 100;
}

.fab-btn:hover {
  background: var(--primary-dark);
  transform: scale(1.05);
}

/* ---------- Modal Overlay ---------- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  /* Dimmed background */
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  /* Hidden by default */
  place-items: center;
  padding: 20px;
}

.modal-overlay.open {
  display: grid;
  animation: fade-in 0.2s ease forwards;
}

/* ---------- Modal Card ---------- */
.modal-card {
  width: 100%;
  max-width: 900px; /* Wide layout */
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  position: relative;
  overflow: hidden; /* Important for rounding corners */
  display: flex;
  flex-direction: column;
}

/* --- The Main Container --- */
.two-cols {
  display: grid;
  grid-template-columns: 300px 1fr; /* Fixed Sidebar (300px) | Rest of space (1fr) */
  min-height: 400px; /* Ensure it has some height */
}

/* --- Left Column (Student Info) --- */
/* --- Left Column (Student Info) --- */
.col-left {
  background: #f8faff; /* ✨ NEW: Very soft blue tint instead of gray */
  padding: 24px 28px;
  border-right: 1px solid #edf2f7;
}

/* --- Right Column (Class Info) --- */
.col-right {
  background: #ffffff; /* White Background */
  padding: 24px;
}

/* Mobile: Stack them vertically */
@media (max-width: 768px) {
  .two-cols {
    grid-template-columns: 1fr;
  }
  .col-left {
    border-right: none;
    border-bottom: 1px solid #e5e7eb;
  }
}

/* Footer area for the button */
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #e5e7eb;
  background: #fff;
  text-align: right;
}


/* On mobile phones, stack them back to one column */
@media (max-width: 768px) {
  .two-cols {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

/* Ensure the border line only shows on mobile/stacked view */
.form-section {
  padding-bottom: 0;
  margin-bottom: 0;
  border: none; /* No divider needed for side-by-side */
}

/* --- New Header Style --- */
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
}

/* --- Remove default padding from body so we can style columns --- */
.modal-body {
  padding: 0; 
  overflow-y: auto;
  max-height: 85vh;
}

/* --- Section Dividers --- */
.form-section {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px dashed #e5e7eb;
}

.form-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.section-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
  color: var(--primary); /* ✨ NEW: Blue brand color */
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0.9;
}

/* --- Grid Layouts --- */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
  color: #111;
}

.close-icon {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: #666;
  padding: 4px;
}

/* ---------- Form Elements ---------- */
.input-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #4b5563;
  margin-bottom: 6px;
  text-align: left;
}

/* 2 columns */
.row-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px; /* Increased gap slightly for better breathing room */
}

/* NEW: 3 columns for Date/Time row */
.row-trio {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr; /* Date gets slightly more space */
  gap: 12px;
}

/* Fix for Select Dropdowns to match Inputs */
.field select {
  width: 100%;
  padding: 14px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #f9fafb;
  font-size: 0.95rem;
  outline: none;
  /* Remove default arrow in some browsers to look cleaner */
  appearance: none; 
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  cursor: pointer;
}

/* Nice Day of Week Checkboxes */
.week-days {
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.week-days label {
  cursor: pointer;
}

/* Hide actual checkbox */
.week-days input {
  display: none;
}

/* Style the span to look like a badge */
.week-days span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px; /* ✨ NEW: Softer corners */
  background: #ffffff; /* ✨ NEW: White bg */
  border: 1px solid #e5e7eb; /* ✨ NEW: Subtle border */
  color: #6b7280;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.week-days span:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: #f0f7ff;
}

/* When checked */
.week-days input:checked+span {
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 6px rgba(13, 110, 253, 0.3);
}



/* ==============================
   NEW: Students page + cards UI
   ============================== */

.students-page {
  position: fixed;
  inset: 0;
  padding: 18px 18px 110px;
  /* extra bottom space for FAB */
  overflow: auto;
  display: none;
  /* show only after login */
  background: var(--page);
}

.students-topbar {
  max-width: 1100px;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.students-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #111827;
}

.students-subtitle {
  margin-top: 4px;
  font-size: 0.95rem;
  color: #6b7280;
}

.students-status {
  max-width: 1100px;
  margin: 0 auto 14px;
  font-size: 0.95rem;
  color: #6b7280;
}

.students-grid {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  /* Exactly 2 columns (50% each) */
  grid-template-columns: 1fr 1fr;
  /* Bigger gap for a cleaner look */
  gap: 24px;
}

/* Include this to ensure it switches to 1 column on mobile phones */
@media (max-width: 600px) {
  .students-grid {
    grid-template-columns: 1fr;
  }
}

.student-card {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 10px 26px rgba(16, 24, 40, 0.07);
  border: 1px solid rgba(229, 231, 235, 0.9);
  padding: 16px 16px 14px;
  transition: transform 0.12s ease, box-shadow 0.2s ease;
}

.student-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(16, 24, 40, 0.10);
}

.student-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: #111827;
  margin: 0 0 8px;
}

.student-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #374151;
  font-size: 0.85rem;
  font-weight: 700;
}

.badge.primary {
  background: rgba(13, 110, 253, 0.12);
  color: #0b5ed7;
}

.days-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.day-pill {
  width: 38px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #f9fafb;
  border: 1px solid #eef2f7;
  color: #374151;
  font-weight: 800;
  font-size: 0.85rem;
}

/* Modern Compact Card Design */
.student-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  border: 1px solid #f0f2f5;
  display: flex;
  flex-direction: column;
  gap: 12px; /* Consistent spacing */
  position: relative;
  transition: all 0.2s ease;
}

.student-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.1);
  border-color: #dbeafe; /* Subtle blue highlight */
}

/* --- Row 1: Top (Avatar + Name) --- */
.card-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.student-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0d6efd, #0043a8);
  color: white;
  font-size: 1.1rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.top-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.student-name {
  font-size: 1rem;
  font-weight: 700;
  color: #111827;
  line-height: 1.3;
  margin: 0;
}

.class-badge-inline {
  font-size: 0.8rem;
  color: #6b7280;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 5px;
}
.class-badge-inline i { color: var(--primary); font-size: 0.75rem; }

/* --- Row 2: Meta (Date & Time) --- */
.card-mid {
  display: flex;
  gap: 8px;
}

.meta-pill {
  flex: 1; /* Stretch to fill space evenly */
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  padding: 8px;
  border-radius: 8px;
  font-size: 0.8rem;
  color: #4b5563;
  font-weight: 600;
}
.meta-pill i { color: #9ca3af; }

/* --- Row 3: Days (Fixed 7 Columns) --- */
.card-bot {
  display: grid;
  grid-template-columns: repeat(7, 1fr); /* Forces 7 equal columns */
  gap: 4px;
  margin-top: 6px;
}

.day-pill {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 6px 0; /* Center vertically */
  border-radius: 6px;
  text-align: center;
  transition: all 0.2s;
  cursor: default;
}

/* Style for Active Days (Student learns today) */
.day-pill.active {
  background: #eff6ff;
  color: var(--primary);
  border: 1px solid rgba(13, 110, 253, 0.2);
  font-weight: 800;
}

/* Style for Inactive Days (Hidden but keeps the space) */
.day-pill.inactive {
  visibility: hidden; /* Makes it invisible */
  pointer-events: none; /* Ensures mouse passes through it */
}

/* --- Action Buttons (Hover Overlay) --- */
.card-actions {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 6px;
  opacity: 0; /* Hidden by default */
  transform: translateY(-5px);
  pointer-events: none;
  transition: all 0.2s ease;
  z-index: 10;
}

.student-card:hover .card-actions {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.action-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px; /* Square with rounded corners looks more modern */
  border: none;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.btn-edit { background: #fff; color: var(--primary); border: 1px solid #eef2f7; }
.btn-edit:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

.btn-delete { background: #fff; color: #ef4444; border: 1px solid #fef2f2; }
.btn-delete:hover { background: #ef4444; color: #fff; border-color: #ef4444; }


/* --- Assign Button (Moved to Header) --- */
.btn-assign {
  position: static; 
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 6px 16px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  
  /* ✅ Hidden by default */
  opacity: 0; 
  pointer-events: none; /* Cannot click while hidden */
  transition: opacity 0.2s ease; /* Smooth fade in */
  
transform: none;
  box-shadow: none;
  
  /* ✅ Keep it close to the name (Don't push to far right) */
  margin-left: 4px; 
}

/* ✅ Show button when hovering the card */
.student-card:hover .btn-assign {
  opacity: 1;
  pointer-events: auto;
}

.btn-assign:hover {
  background: var(--primary-dark);
}

.btn-assign:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

/* --- Autocomplete Suggestions --- */
.suggestions-list {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  display: none; /* Hidden initially */
  margin-top: 4px;
}

.suggestion-item {
  padding: 10px 14px;
  font-size: 0.95rem;
  color: #374151;
  cursor: pointer;
  border-bottom: 1px solid #f3f4f6;
  transition: background 0.1s;
}

.suggestion-item:last-child {
  border-bottom: none;
}

.suggestion-item:hover {
  background: #f0f7ff;
  color: var(--primary);
}

/* ==============================
   NEW: Modern "Soft" Assign Modal
   ============================== */

/* 1. Card Container - Rounded */
/* 1. Card Container - Rounded */
.assign-modern-card {
  max-width: 440px;
  width: 90%;
  /* We keep overflow visible so the search dropdown can float outside */
  overflow: visible; 
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

/* FIX: Manually round the top of the header so it doesn't cover the card corners */
.assign-modern-card .modal-header {
  border-radius: 24px 24px 0 0; /* Matches the card top */
  background: #fff; /* White background blends better than gray */
  border-bottom: none; /* Removes the separator line for a cleaner look */
  padding-top: 28px;
}

/* FIX: Manually round the bottom of the footer */
.assign-modern-card .modal-footer {
  border-radius: 0 0 24px 24px; /* Matches the card bottom */
  padding-bottom: 28px;
}

.assign-modern-card .modal-body {
  padding: 24px 32px;
}

.assign-section {
  margin-bottom: 28px;
}

/* 2. Modern Labels (Small & Uppercase) */
.modern-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 800;
  color: #9ca3af; /* Light grey text */
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}

/* 3. Search Input (Icon Inside) */
.modern-search {
  position: relative;
  display: flex;
  align-items: center; /* Vertically center icon */
}

.modern-search .search-icon {
  position: absolute;
  left: 14px; /* Fixed position inside left */
  z-index: 10;
  color: #9ca3af;
  font-size: 0.9rem;
}

.modern-search input {
  width: 100%;
  padding-left: 40px; /* Make room for the icon so text doesn't overlap */
  height: 48px;
  background: #f3f4f6;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 0.95rem;
  color: #1f2937;
  transition: all 0.2s ease;
}

.modern-search input:focus {
  background: #fff;
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(13, 110, 253, 0.1);
}

.modern-search .search-icon {
  left: 16px;
  color: #9ca3af;
}

/* 4. Days as Circles */
.days-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.assign-pill input { display: none; }

.assign-pill span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%; /* Circle */
  background: #f3f4f6;
  color: #6b7280;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.assign-pill input:checked + span {
  background: var(--primary);
  color: #fff;
  transform: scale(1.1);
  box-shadow: 0 4px 10px rgba(13, 110, 253, 0.3);
}

/* 5. Horizontal Dept Cards */
.dept-grid-modern {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.dept-option-modern input { display: none; }

.dept-card-modern {
  display: flex;
  align-items: center;
  padding: 12px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.icon-box {
  width: 32px;
  height: 32px;
  background: #eff6ff;
  color: var(--primary);
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 0.9rem;
  margin-right: 10px;
}

.dept-text {
  font-weight: 600;
  color: #374151;
  font-size: 0.9rem;
}

.check-mark {
  margin-left: auto;
  color: var(--primary);
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.2s ease;
}

/* Active State for Dept */
.dept-option-modern input:checked + .dept-card-modern {
  border-color: var(--primary);
  background: #eff6ff; /* Very light blue tint */
  box-shadow: 0 4px 12px rgba(13, 110, 253, 0.15);
}

.dept-option-modern input:checked + .dept-card-modern .check-mark {
  opacity: 1;
  transform: scale(1);
}

/* 6. Footer Button */
.assign-modern-card .modal-footer {
  padding: 0 32px 32px;
  border: none;
}

.modern-btn {
  height: 50px;
  font-size: 1rem;
  letter-spacing: 0.5px;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(13, 110, 253, 0.25);
}
.modern-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(13, 110, 253, 0.3);
}

/* Assignment Badge Styling */
.assigned-badge {
  background: #f0fdf4; /* Light green background */
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 8px; /* Space between badges */
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.assigned-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: #166534; /* Dark green text */
  font-weight: 700;
  word-break: break-all; /* Safety for long emails */
}

.assigned-row.sub {
  font-size: 0.75rem;
  color: #15803d;
  font-weight: 500;
}

.assigned-row i {
  font-size: 0.8rem;
  opacity: 0.8;
}


/* --- NEW: Teacher Assignment Cards --- */
.assigned-badge {
  /* Default Gray/Blue */
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  /* border-left removed */
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Color Variant: TTKB (Green/Teal) */
.assigned-badge.style-ttkb {
  background: #f0fdf4;
  border-color: #bbf7d0;
  /* border-left-color removed */
}

/* Color Variant: Breakout (Orange/Purple) */
.assigned-badge.style-breakout {
  background: #fff7ed;
  border-color: #ffedd5;
  /* border-left-color removed */
}

.teacher-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 700;
  color: #1e293b;
}

.teacher-header i {
  color: #64748b;
  font-size: 0.85rem;
}

.assigned-badge.style-ttkb .teacher-header { color: #14532d; }
.assigned-badge.style-ttkb .teacher-header i { color: #16a34a; }

.assigned-badge.style-breakout .teacher-header { color: #7c2d12; }
.assigned-badge.style-breakout .teacher-header i { color: #ea580c; }

.assignment-details {
  font-size: 0.8rem;
  color: #475569;
  font-weight: 500;
  padding-left: 22px; /* Indent to align with text above */
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Small bullet dot separator */
.dot-sep {
  width: 4px;
  height: 4px;
  background: #cbd5e1;
  border-radius: 50%;
  display: inline-block;
}


/* --- NEW: Department Mini Badges --- */
.dept-mini-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  margin-right: 4px; /* Space between multiple badges */
  line-height: 1.4;
}

/* Style for TTKB (Green) */
.dept-mini-badge.badge-ttkb {
  background: #ffffff;
  color: #15803d; /* Dark Green */
  border: 1px solid #86efac;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* Style for Breakout (Orange) */
.dept-mini-badge.badge-breakout {
  background: #ffffff;
  color: #c2410c; /* Dark Orange */
  border: 1px solid #fdba74;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* Fallback for others */
.dept-mini-badge.badge-default {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #cbd5e1;
}

/* --- NEW: Day Mini Badges --- */
.day-mini-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 6px;
  background: #f1f5f9; /* Solid Light Gray Background */
  color: #475569;      /* Dark Slate Text */
  border: 1px solid #cbd5e1; /* Subtle Border */
  font-size: 0.7rem;
  font-weight: 700;
  margin-right: 0;
  line-height: 1.4;
  /* Distinct from Dept badges which are white with colored borders */
}


/* --- Comment Button (Bottom Left) --- */
.btn-comment {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: #f3f4f6;
  color: #4b5563;
  border: 1px solid #e5e7eb;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  opacity: 0;
  transform: translateY(5px);
  transition: all 0.2s ease;
  z-index: 10;
}

.student-card:hover .btn-comment {
  opacity: 1;
  transform: translateY(0);
}

.btn-comment:hover {
  background: #e5e7eb;
  color: #111;
}

/* --- Comment Drawer (Slide Down) --- */
.comment-drawer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
  background: #f9fafb;
  border-radius: 12px;
  margin-top: 10px;
}

.comment-drawer.open {
  max-height: 400px; /* Allow it to grow */
  border: 1px solid #e5e7eb;
  overflow-y: auto; /* Scroll if too long */
}

.comment-box {
  padding: 12px;
}

.comment-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
  max-height: 150px;
  overflow-y: auto;
}

.comment-item {
  font-size: 0.8rem;
  background: #fff;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid #eee;
}

.comment-author {
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--primary);
  margin-bottom: 2px;
}

.comment-input-area {
  display: flex;
  gap: 6px;
}

.comment-input-area input {
  flex: 1;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.85rem;
}

.btn-send-comment {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 0 12px;
  cursor: pointer;
  font-size: 0.8rem;
}


/* --- Paste at the bottom of style.css --- */

/* Hide ONLY the Report button when drawer is open (Keep Assign visible) */
.student-card.editing-comments .btn-comment {
  display: none;
}


/* --- NEW: Teacher Instruction Notice --- */
.teacher-instruction {
  margin-top: 12px;
  padding: 10px 12px;
  background: #f8fafc;       /* Soft slate background */
  border: 1px dashed #cbd5e1; /* Dashed border for "note" style */
  border-radius: 8px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.teacher-instruction i {
  color: var(--primary);
  font-size: 0.85rem;
  margin-top: 2px;
  flex-shrink: 0;
}

.teacher-instruction span {
  font-size: 0.75rem;
  color: #475569;
  font-weight: 500;
  line-height: 1.4;
  text-align: left;
}


/* --- Student Note Section --- */
.student-note {
  margin-top: 12px;
  padding: 10px 12px;
  background: #fffbeb; /* Soft yellow background */
  border: 1px solid #fde68a; /* Yellow border */
  border-radius: 8px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.student-note i {
  color: #d97706; /* Darker amber icon */
  font-size: 0.85rem;
  margin-top: 3px;
  flex-shrink: 0;
}

.student-note span {
  font-size: 0.85rem;
  color: #92400e; /* Dark amber text */
  font-weight: 500;
  line-height: 1.4;
  white-space: pre-wrap; /* Keeps line breaks if you type them */
}


/* --- NEW: Contact Alert Badge (Softer Design) --- */
.alert-badge {
  margin: 8px 0;  /* ✅ FIXED: Reduced margin (was 20px) to close the white gap */
  padding: 20px;
  background: #fff7ed; 
  border: 1px solid #ffedd5; 
  border-radius: 16px; 
  color: #c2410c; 
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  animation: fade-in 0.4s ease;
}

/* Remove the old border-left and update the icon style */
.alert-badge i {
  font-size: 1.5rem;
  color: #ea580c; /* Slightly brighter orange icon */
  background: #ffffff; /* White circle behind the icon to make it pop */
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(234, 88, 12, 0.15); /* Soft shadow for depth */
}


/* ---------- Custom Alert Popup ---------- */
#customAlertOverlay {
  z-index: 9999; /* Ensure it appears above everything else */
}

.alert-card {
  max-width: 320px;
  padding: 30px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.alert-icon {
  font-size: 3rem;
  color: var(--primary);
  margin-bottom: 16px;
}

.alert-message {
  font-size: 1rem;
  color: #374151;
  margin-bottom: 24px;
  line-height: 1.5;
  font-weight: 500;
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}


/* --- Nested Comments & Replies --- */
.comment-item {
  position: relative;
  font-size: 0.85rem;
  background: #fff;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #eee;
  margin-bottom: 8px;
  transition: background 0.2s;
}

/* Indent replies */
.comment-reply {
  margin-left: 24px;
  border-left: 2px solid #e5e7eb;
  background: #fdfdfd;
}

.comment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.comment-author {
  font-weight: 700;
  color: var(--primary);
  font-size: 0.8rem;
}

.comment-date {
  font-size: 0.7rem;
  color: #9ca3af;
  margin-left: 8px;
  font-weight: 400;
}

/* --- Comment Action Buttons (Reply & Delete) --- */
.btn-reply-trigger,
.btn-delete-comment {
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 4px;
  opacity: 0; /* Hidden by default */
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px; /* Good click area */
}

/* Specific Styles for Reply */
.btn-reply-trigger { 
  color: #6b7280; 
  font-size: 0.75rem; 
  font-weight: 600; 
}

/* Specific Styles for Delete */
.btn-delete-comment { 
  color: #9ca3af; 
  font-size: 0.85rem; 
}

/* Hover Colors */
.btn-reply-trigger:hover { background: #f3f4f6; color: var(--primary); }
.btn-delete-comment:hover { background: #fee2e2; color: #ef4444; }

/* ✅ IMPORTANT: Show BOTH buttons when hovering the comment row */
.comment-item:hover .btn-reply-trigger,
.comment-item:hover .btn-delete-comment {
  opacity: 1;
}
.nested-reply-box {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #eee;
  display: none;
  gap: 6px;
}

.nested-reply-box.open {
  display: flex;
}

.nested-reply-box input {
  flex: 1;
  padding: 6px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.8rem;
}