@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@300;400;500;600;700;800;900&display=swap');

:root {
  /* Color System */
  --primary: #4F46E5;
  --primary-hover: #4338CA;
  --primary-glow: rgba(79, 70, 229, 0.15);
  
  --emerald: #059669;
  --emerald-hover: #047857;
  --emerald-soft: #ECFDF5;
  --emerald-glow: rgba(5, 150, 105, 0.2);

  --amber: #D97706;
  --amber-hover: #B45309;
  --amber-soft: #FEF3C7;

  --rose: #E11D48;
  --rose-hover: #BE123C;
  --rose-soft: #FFE4E6;
  
  --bg-gradient: linear-gradient(135deg, #EEF2F6 0%, #E3E8F0 100%);
  --card-bg: rgba(255, 255, 255, 0.85);
  --card-border: rgba(255, 255, 255, 0.5);
  
  --text-primary: #1E293B;
  --text-secondary: #475569;
  --text-muted: #64748B;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 10px 30px -10px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 20px 40px -15px rgba(0, 0, 0, 0.12);
  --shadow-primary: 0 10px 20px -5px rgba(79, 70, 229, 0.3);
  
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font-sans: 'Inter', sans-serif;
  --font-display: 'Outfit', sans-serif;
}

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

body {
  font-family: var(--font-sans);
  background: var(--bg-gradient);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
  padding-bottom: 2rem;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
}

/* Glassmorphism utility */
.glass {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-md);
}


/* App Containers */
.app-container {
  max-width: 1400px;
  margin: 1.5rem auto;
  padding: 0 1.5rem;
  animation: fadeIn 0.4s ease-out;
}

/* Header UI */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding: 1.5rem;
  border-radius: var(--radius-lg);
}

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

.brand-icon {
  background: linear-gradient(135deg, var(--primary) 0%, #6366F1 100%);
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
  box-shadow: var(--shadow-primary);
}

.brand-details h1 {
  font-size: 1.4rem;
  color: var(--text-primary);
  line-height: 1.2;
}

.brand-details span {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #E2E8F0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--primary);
  font-family: var(--font-display);
}

/* Metric Cards Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.metric-card {
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 1.25rem;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.metric-card:hover {
  transform: translateY(-3px);
}

.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
}

.metric-card.primary::before { background: var(--primary); }
.metric-card.success::before { background: var(--emerald); }
.metric-card.warning::before { background: var(--amber); }
.metric-card.danger::before { background: var(--rose); }

.metric-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.metric-card.primary .metric-icon { background: rgba(79, 70, 229, 0.1); color: var(--primary); }
.metric-card.success .metric-icon { background: rgba(5, 150, 105, 0.1); color: var(--emerald); }
.metric-card.warning .metric-icon { background: rgba(217, 119, 6, 0.1); color: var(--amber); }
.metric-card.danger .metric-icon { background: rgba(225, 29, 72, 0.1); color: var(--rose); }

.metric-info h4 {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.metric-info p {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  margin-top: 0.25rem;
}

/* Master-Detail Split Layout (Teacher) */
.dashboard-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 1.5rem;
  position: relative;            /* Anchor for absolute sidebar positioning */
  min-height: 700px;             /* Baseline height constraint */
}

@media (max-width: 1024px) {
  .dashboard-layout {
    grid-template-columns: 1fr;
  }
  .list-panel {
    position: static !important; /* Reset layout flow on mobile */
    width: 100% !important;
    height: 480px !important;
    min-height: auto !important;
  }
  .detail-panel {
    grid-column: 1 !important;   /* Reset column flow on mobile */
  }
}

/* Sidebar panel (Roster & Lists) */
.list-panel {
  position: absolute;            /* Exclude from grid auto-height calculations */
  top: 0;
  bottom: 0;
  left: 0;
  width: 360px;                  /* Match first column width exactly */
  display: flex;
  flex-direction: column;
  min-height: 700px;             /* Baseline baseline height */
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.list-panel-header {
  padding: 1.25rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.list-panel-header h3 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.student-count-tag {
  font-size: 0.75rem;
  background: var(--primary-glow);
  color: var(--primary);
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
  font-weight: 700;
}

.search-wrapper {
  position: relative;
  margin-bottom: 0.75rem;
}

.search-input {
  width: 100%;
  padding: 0.65rem 1rem 0.65rem 2.25rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.9);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  outline: none;
  transition: var(--transition);
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.search-icon-svg {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  width: 16px;
  height: 16px;
}

.filter-tabs {
  display: flex;
  gap: 0.25rem;
  background: #F1F5F9;
  padding: 0.2rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
}

.filter-tab {
  flex: 1;
  text-align: center;
  background: transparent;
  border: none;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 0.55rem 0;
  cursor: pointer;
  border-radius: 6px;
  transition: var(--transition);
}

.filter-tab.active {
  background: white;
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

/* Scrollable Student List */
.roster-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.roster-list::-webkit-scrollbar {
  width: 6px;
}
.roster-list::-webkit-scrollbar-track {
  background: transparent;
}
.roster-list::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 4px;
}

.student-list-item {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.4);
  transition: var(--transition);
}

.student-list-item:hover {
  background: rgba(255, 255, 255, 0.9);
  transform: translateX(3px);
  border-color: rgba(79, 70, 229, 0.15);
}

.student-list-item.selected {
  background: white;
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
  transform: translateX(4px);
}

.student-item-info {
  display: flex;
  flex-direction: column;
}

.student-item-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
}

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

.student-item-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
}

.coin-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.50rem;
  border-radius: 6px;
}

.coin-badge.ok { background: var(--emerald-soft); color: var(--emerald); }
.coin-badge.low { background: var(--amber-soft); color: var(--amber); }
.coin-badge.empty { background: var(--rose-soft); color: var(--rose); }

/* Payment status indicator styles removed as billing simplified to strict coins counter */

/* Detail Panel (Teacher & Student Dashboard) */
.detail-panel {
  grid-column: 2;                /* Position details panel in column 2 of the grid */
  border-radius: var(--radius-lg);
  min-height: 700px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  text-align: center;
  padding: 4rem 2rem;
  flex: 1;
}

.panel-placeholder-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  color: #CBD5E1;
  animation: float 3s ease-in-out infinite;
}

.detail-header {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  background: linear-gradient(to right, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.3));
}

.detail-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.detail-student-meta h2 {
  font-size: 1.5rem;
  color: var(--text-primary);
}

.detail-student-meta p {
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Split content areas in details */
.detail-body {
  padding: 1.5rem;
  flex: 1;
  overflow-y: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 768px) {
  .detail-body {
    grid-template-columns: 1fr;
  }
}

.detail-section-card {
  background: white;
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0, 0, 0, 0.03);
}

.detail-section-card h3 {
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid #F1F5F9;
  padding-bottom: 0.5rem;
}

/* Ledger controls widget */
.ledger-widget {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  padding: 1rem 0;
}

.coin-radial-display {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 8px solid var(--emerald-soft);
  position: relative;
  background: white;
}

.coin-radial-display.low {
  border-color: var(--amber-soft);
}

.coin-radial-display.empty {
  border-color: var(--rose-soft);
}

.coin-count-big {
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 900;
  line-height: 1;
  color: var(--text-primary);
}

.coin-count-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.ledger-actions {
  display: flex;
  gap: 0.75rem;
  width: 100%;
}

.btn {
  flex: 1;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  border: none;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

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

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: var(--shadow-primary);
}

.btn-success {
  background: var(--emerald-soft);
  color: var(--emerald);
  border: 1px solid rgba(5, 150, 105, 0.15);
}

.btn-success:hover {
  background: var(--emerald);
  color: white;
}

.btn-danger {
  background: var(--rose-soft);
  color: var(--rose);
  border: 1px solid rgba(225, 29, 72, 0.15);
}

.btn-danger:hover {
  background: var(--rose);
  color: white;
}

/* History Ledger List */
.ledger-history-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 180px;
  overflow-y: auto;
  margin-top: 0.5rem;
  padding-right: 0.25rem;
}

.ledger-history-item {
  padding: 0.5rem 0.75rem;
  background: #F8FAFC;
  border-radius: 6px;
  font-size: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ledger-history-item span {
  font-weight: 600;
}

.ledger-history-item .deduct { color: var(--rose); }
.ledger-history-item .add { color: var(--emerald); }

.ledger-history-time {
  color: var(--text-muted);
}

/* Homework Submission Inbox items */
.homework-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.homework-card {
  border: 1px solid #E2E8F0;
  border-radius: var(--radius-sm);
  padding: 1rem;
  transition: var(--transition);
}

.homework-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.hw-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.hw-title {
  font-weight: 600;
  font-size: 0.9rem;
}

.hw-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

.hw-badge.submitted { background: var(--amber-soft); color: var(--amber); }
.hw-badge.graded { background: var(--emerald-soft); color: var(--emerald); }

.hw-date {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}


/* Coin Actions Panel */
.tuition-actions-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  background: #F8FAFC;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  align-items: center;
  justify-content: space-between;
}

/* Modal overlays */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.25s ease-out;
}

.modal-content {
  background: white;
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 500px;
  padding: 1.75rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.8);
  animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);

  /* System-wide Scroll Fix additions */
  max-height: calc(100vh - 4rem); /* Ensure decent margins at top/bottom */
  overflow-y: auto;               /* Enable vertical scrollbar inside modal */
  position: relative;             /* Anchor for sticky children */
  display: flex;
  flex-direction: column;
}

.modal-content > * {
  flex-shrink: 0;                 /* Guarantee no direct child is ever squeezed by flexbox */
}

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

  /* Full-bleed sticky additions */
  position: sticky;
  top: -1.75rem; /* Pin to the very top edge of the scroll container */
  background: white;
  z-index: 100;
  margin: -1.75rem -1.75rem 1.25rem -1.75rem; /* Stretch full bleed across the card */
  padding: 1.75rem 1.75rem 0.85rem 1.75rem;   /* Padding matching the card border */
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.modal-header h3 {
  font-size: 1.2rem;
  margin: 0;
}

.modal-close-btn {
  background: #F1F5F9;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.modal-close-btn:hover {
  background: #E2E8F0;
}

.modal-form-group {
  margin-bottom: 1.25rem;
}

.modal-form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.modal-form-group input,
.modal-form-group textarea,
.modal-form-group select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid #CBD5E1;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  outline: none;
}

.modal-form-group input:focus,
.modal-form-group textarea:focus,
.modal-form-group select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Conditional styles for different grading statuses in the review modal */
.modal-content.status-assigned #grade-input {
  background: #F1F5F9 !important;
  color: #94A3B8 !important;
  cursor: not-allowed !important;
  border-color: #CBD5E1 !important;
}

.modal-content.status-submitted #grade-input,
.modal-content.status-submitted #max-grade-input,
.modal-content.status-submitted #feedback-input {
  border: 2px solid var(--amber) !important;
  background: #FFFDF5 !important;
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.12) !important;
}

/* Stylized Premium switch toggle */
.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch .slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #CBD5E1;
  transition: .4s;
  border-radius: 24px;
}

.switch .slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.switch input:checked + .slider {
  background-color: var(--emerald);
}

.switch input:focus + .slider {
  box-shadow: 0 0 1px var(--emerald);
}

.switch input:checked + .slider:before {
  transform: translateX(24px);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;

  /* Full-bleed sticky additions */
  position: sticky;
  bottom: -1.75rem; /* Pin to the very bottom edge of the scroll container */
  background: white;
  z-index: 100;
  margin: 1.5rem -1.75rem -1.75rem -1.75rem; /* Stretch full bleed across the card */
  padding: 0.85rem 1.75rem 1.75rem 1.75rem;   /* Padding matching the card border */
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

/* Student Dashboard Styles */
.student-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 1.5rem;
}

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

.student-balance-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.5rem;
  text-align: center;
  background: linear-gradient(135deg, white 0%, #F8FAFC 100%);
}

.student-balance-panel .radial-glow {
  position: relative;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  border: 12px solid var(--primary-glow);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  background: white;
  box-shadow: var(--shadow-sm);
}

.student-balance-panel .radial-glow.success { border-color: var(--emerald-glow); }
.student-balance-panel .radial-glow.warning { border-color: rgba(217, 119, 6, 0.15); }
.student-balance-panel .radial-glow.danger { border-color: rgba(225, 29, 72, 0.15); }

.student-balance-panel .coins-big {
  font-family: var(--font-display);
  font-size: 3.5rem;
  font-weight: 900;
  color: var(--text-primary);
  line-height: 1;
}

.student-balance-panel .coins-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}

.student-info-strip {
  display: flex;
  gap: 1.5rem;
  width: 100%;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #E2E8F0;
  text-align: left;
}

.student-info-col {
  flex: 1;
}

.student-info-col label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.student-info-col span {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* Homework Submission Drag & Drop Card */
.drag-drop-zone {
  border: 2px dashed #CBD5E1;
  border-radius: var(--radius-md);
  padding: 2rem 1.5rem;
  text-align: center;
  cursor: pointer;
  background: #F8FAFC;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.drag-drop-zone:hover {
  border-color: var(--primary);
  background: var(--primary-glow);
}

.drag-drop-icon {
  font-size: 2.5rem;
  color: var(--text-muted);
}

.preview-uploaded-image {
  max-width: 100%;
  max-height: 150px;
  border-radius: var(--radius-sm);
  margin-top: 1rem;
  box-shadow: var(--shadow-sm);
  display: none;
}

/* Timelines (Feedback/Grades) */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.timeline-item {
  position: relative;
  padding-left: 1.5rem;
  border-left: 2px solid #E2E8F0;
  padding-bottom: 0.5rem;
}

.timeline-item::after {
  content: '';
  position: absolute;
  left: -6px;
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-muted);
  border: 2px solid white;
}

.timeline-item.graded::after {
  background: var(--emerald);
}

.timeline-item.assigned::after {
  background: var(--primary);
}

.timeline-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.25rem;
}

.timeline-item-title {
  font-weight: 600;
  font-size: 0.85rem;
}

.timeline-item-score {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--emerald);
}

.timeline-item-date {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.timeline-item-feedback {
  background: #F8FAFC;
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  font-size: 0.8rem;
  border-left: 3px solid var(--emerald);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes scaleUp {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes scaleDown {
  from { transform: scale(1); opacity: 1; }
  to { transform: scale(0.9); opacity: 0; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
  100% { transform: translateY(0px); }
}

/* Unified Navigation Tabs styling is defined in the header section below */

/* Added by Antigravity AI coding assistant - Premium visual assets & overrides */
.hw-image-thumbnail-container {
  margin-top: 0.5rem;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid #E2E8F0;
  max-width: 150px;
  cursor: pointer;
  transition: var(--transition);
}

.hw-image-thumbnail-container:hover {
  transform: scale(1.03);
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.hw-image-thumbnail {
  width: 100%;
  height: auto;
  display: block;
}

.btn-add-student {
  background: var(--primary-glow);
  color: var(--primary);
  border: 1px solid rgba(79, 70, 229, 0.15);
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

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

.roster-header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}


.class-list-item {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.4);
  transition: var(--transition);
}

.class-list-item:hover {
  background: rgba(255, 255, 255, 0.9);
  transform: translateX(3px);
  border-color: rgba(79, 70, 229, 0.15);
}

.class-list-item.selected {
  background: white;
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
  transform: translateX(4px);
}

.class-item-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.class-item-schedule {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.class-item-count {
  font-size: 0.7rem;
  background: #E2E8F0;
  color: var(--text-secondary);
  padding: 0.1rem 0.4rem;
  border-radius: 10px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: 0.5rem;
}

/* Class Details & Roster Tables */
.class-roster-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.class-roster-table th,
.class-roster-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid #E2E8F0;
  font-size: 0.85rem;
}

.class-roster-table th {
  font-weight: 700;
  color: var(--text-secondary);
  background: #F8FAFC;
}

.class-roster-table tr:hover td {
  background: #F1F5F9;
}

.btn-remove-from-class {
  background: transparent;
  border: none;
  color: var(--rose);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.75rem;
  transition: var(--transition);
}

.btn-remove-from-class:hover {
  text-decoration: underline;
  color: var(--rose-hover);
}

.negative-coin-badge {
  background: var(--rose-soft) !important;
  color: var(--rose) !important;
  font-weight: 700;
  animation: pulseRed 2s infinite;
}

@keyframes pulseRed {
  0% { box-shadow: 0 0 0 0 rgba(225, 29, 72, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(225, 29, 72, 0); }
  100% { box-shadow: 0 0 0 0 rgba(225, 29, 72, 0); }
}

/* Enrollment Intake Checkboxes */
.checkbox-group-row {
  display: flex;
  gap: 1.5rem;
  margin-top: 0.5rem;
  background: #F8FAFC;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid #E2E8F0;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.checkbox-item input {
  width: auto !important;
  margin: 0 !important;
  cursor: pointer;
}

/* Pending Homework Badge Indicator */
.pending-hw-badge {
  font-size: 0.75rem;
  background: var(--primary-glow);
  border: 1px solid rgba(79, 70, 229, 0.2);
  padding: 1px 4px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  animation: pulseIndigo 2s infinite ease-in-out;
}

@keyframes pulseIndigo {
  0% { box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(79, 70, 229, 0); }
  100% { box-shadow: 0 0 0 0 rgba(79, 70, 229, 0); }
}

/* Center-Aligned Segment Switcher inside top brand header */
.header-nav-tabs {
  display: flex;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.15);
  padding: 0.25rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin: 0 auto;
}

.nav-tab {
  background: transparent;
  border: none;
  color: #94A3B8;
  padding: 0.5rem 1.25rem;
  border-radius: 9px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition);
}

.nav-tab:hover {
  color: var(--primary);
  background: rgba(59, 130, 246, 0.08);
}

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

/* Full Width Calendar Board CSS */
.calendar-workspace {
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  box-shadow: var(--shadow-md);
  margin-top: 1rem;
  animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  background: #E2E8F0;
  padding: 6px;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.calendar-weekday {
  background: #F8FAFC;
  text-align: center;
  padding: 0.75rem 0;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 6px;
}

.calendar-cell {
  background: white;
  min-height: 110px;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
}

.calendar-cell:hover {
  background: #F8FAFC;
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.calendar-cell.dimmed {
  background: #F1F5F9;
  color: #94A3B8;
  cursor: not-allowed;
}

.calendar-cell.dimmed:hover {
  transform: none;
  box-shadow: none;
}

.calendar-cell-number {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.calendar-cell.dimmed .calendar-cell-number {
  color: #94A3B8;
}

/* Session blocks color codes */
.session-block {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.25rem 0.4rem;
  border-radius: 4px;
  color: white;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  display: flex;
  flex-direction: column;
  gap: 1px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.session-block:hover {
  transform: scale(1.02);
  filter: brightness(1.05);
}

.session-block.group-class {
  background: linear-gradient(135deg, var(--primary) 0%, #6366F1 100%);
  border-left: 3px solid #312E81;
}

.session-block.one-on-one {
  background: linear-gradient(135deg, #7C3AED 0%, #8B5CF6 100%);
  border-left: 3px solid #4C1D95;
}

.session-block.cancelled {
  background: repeating-linear-gradient(45deg, #F1F5F9, #F1F5F9 8px, #E2E8F0 8px, #E2E8F0 16px) !important;
  color: #94A3B8 !important;
  border-left: 3px solid #94A3B8 !important;
  text-decoration: line-through;
  box-shadow: none;
}
.session-block.cancelled .session-block-time {
  color: #94A3B8 !important;
  text-decoration: line-through;
}

.session-tile-card {
  transition: all 0.2s ease-in-out;
}
.session-tile-card:hover {
  background-color: #EDF2F7 !important;
  border-color: #CBD5E1 !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.session-block-time {
  font-weight: 500;
  opacity: 0.9;
  font-size: 0.6rem;
}

/* Weekend Highlights */
.calendar-cell.weekend {
  background: #FFFBEB; /* soft yellow-ivory tint */
}
.calendar-weekday.weekend-header {
  background: #FEF3C7; /* slightly darker warm yellow tint */
  color: #B45309;
}

/* Today Highlights (Google Calendar Style) */
.calendar-cell.today {
  background: var(--primary-glow) !important;
  box-shadow: inset 0 0 0 2px var(--primary);
}

.calendar-cell-number.is-today {
  background: var(--primary);
  color: white !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 0.8rem;
  box-shadow: var(--shadow-sm);
}

.week-column.today {
  background: rgba(79, 70, 229, 0.02) !important;
  box-shadow: inset 0 0 0 2px var(--primary);
}

.week-column-header.today {
  background: var(--primary-glow) !important;
  border: 1px solid rgba(79, 70, 229, 0.15) !important;
}

.week-column-header.today span:first-child {
  color: var(--primary) !important;
}

.week-column-header.today span:last-child {
  background: var(--primary);
  color: white !important;
  padding: 0.15rem 0.5rem;
  border-radius: 12px;
  font-weight: 700;
}

/* Week View Grid Layout */
.week-view-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  background: #E2E8F0;
  padding: 8px;
  border-radius: var(--radius-md);
}

.week-column {
  background: white;
  border-radius: 6px;
  padding: 0.5rem;
  min-height: 400px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: var(--transition);
}

.week-column.weekend {
  background: #FFFBEB;
}

.week-column-header {
  background: #F8FAFC;
  padding: 0.5rem;
  border-radius: 6px;
  font-weight: 700;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.week-column-header.weekend {
  background: #FEF3C7;
  color: #B45309;
}

.week-column:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.week-sessions-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

/* Day View Timeline List */
.day-view-container {
  background: white;
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: var(--transition);
}

.day-view-container.today {
  background: rgba(79, 70, 229, 0.02) !important;
  box-shadow: inset 0 0 0 2px var(--primary);
}

.day-timeline-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-radius: 8px;
  background: #F8FAFC;
  border-left: 5px solid var(--primary);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  flex-wrap: wrap;
  gap: 1rem;
}

.day-timeline-card:hover {
  transform: translateX(4px);
  background: white;
  box-shadow: var(--shadow-md);
}

.day-timeline-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.day-timeline-info h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.day-timeline-time {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

.day-timeline-actions {
  display: flex;
  gap: 0.5rem;
}

/* Color dot indicator for class names */
.class-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  vertical-align: middle;
  margin-right: 0.35rem;
  box-shadow: var(--shadow-sm);
}

/* Glassmorphic Error Screen and Boot UI */
.error-screen-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  padding: 2rem;
  animation: fadeIn 0.4s ease-out;
}

.error-card {
  max-width: 500px;
  width: 100%;
  padding: 2.5rem;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(225, 29, 72, 0.15);
  box-shadow: var(--shadow-lg);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.error-icon-wrapper {
  width: 70px;
  height: 70px;
  background: var(--rose-soft);
  color: var(--rose);
  font-size: 2.25rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 16px rgba(225, 29, 72, 0.15);
  animation: float 2.5s ease-in-out infinite;
  margin-bottom: 0.5rem;
}

.error-card h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--text-primary);
  font-weight: 800;
}

.error-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.error-code {
  font-family: monospace;
  font-size: 0.75rem;
  background: #F1F5F9;
  color: var(--text-muted);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  max-width: 100%;
  overflow-x: auto;
  white-space: pre-wrap;
  text-align: left;
}

.btn-retry {
  background: linear-gradient(135deg, var(--rose) 0%, #F43F5E 100%);
  color: white;
  border: none;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0.8rem 2rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(225, 29, 72, 0.25);
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.btn-retry:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(225, 29, 72, 0.35);
  background: linear-gradient(135deg, #BE123C 0%, var(--rose) 100%);
}

.btn-retry:active {
  transform: translateY(0);
}

/* ============================================================================
   PREMIUM CUSTOM TOASTS AND CRITICAL MODAL ERROR DIALOGS
   ============================================================================ */

/* Toast Container positioning */
.toast-container {
  position: fixed;
  top: 80px; /* Below the dev sticky toolbar */
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

/* Individual Toast card styling with glassmorphism */
.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: var(--shadow-lg);
  min-width: 320px;
  max-width: 460px;
  font-family: var(--font-sans);
  color: var(--text-primary);
  position: relative;
  overflow: hidden;
  animation: toastSlideIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  transition: opacity 0.3s ease, transform 0.3s ease, margin 0.3s ease;
}

.toast.fade-out {
  animation: toastFadeOut 0.3s ease forwards;
}

/* Status colors and accents */
.toast-success { border-left: 5px solid var(--emerald); }
.toast-success .toast-icon { color: var(--emerald); }

.toast-warning { border-left: 5px solid var(--amber); }
.toast-warning .toast-icon { color: var(--amber); }

.toast-error { border-left: 5px solid var(--rose); }
.toast-error .toast-icon { color: var(--rose); }

.toast-info { border-left: 5px solid var(--primary); }
.toast-info .toast-icon { color: var(--primary); }

/* Elements inside the toast */
.toast-icon {
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.toast-content {
  flex: 1;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
  padding-right: 8px;
}

.toast-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.875rem;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: var(--transition);
  flex-shrink: 0;
}

.toast-close-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-primary);
}

/* Toast Progress bar using keyframe shrink */
.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 100%;
  transform-origin: left;
}

.toast-success .toast-progress { background: rgba(5, 150, 105, 0.2); }
.toast-warning .toast-progress { background: rgba(217, 119, 6, 0.2); }
.toast-error .toast-progress { background: rgba(225, 29, 72, 0.2); }
.toast-info .toast-progress { background: rgba(79, 70, 229, 0.2); }

@keyframes toastSlideIn {
  from {
    transform: translateX(120%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes toastFadeOut {
  from {
    transform: translateX(0) scale(1);
    opacity: 1;
  }
  to {
    transform: translateX(30%) scale(0.9);
    opacity: 0;
  }
}

/* Collapsible Diagnostics Drawer for critical modals */
.diagnostics-drawer {
  margin-top: 1rem;
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: var(--radius-sm);
  background: #F8FAFC;
  overflow: hidden;
  width: 100%;
}

.diagnostics-header {
  padding: 0.6rem 1rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  background: #F1F5F9;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  transition: var(--transition);
}

.diagnostics-header:hover {
  background: #E2E8F0;
  color: var(--text-primary);
}

.diagnostics-body {
  padding: 0.75rem 1rem;
  font-family: monospace;
  font-size: 0.75rem;
  color: var(--rose);
  background: #FFFDFD;
  border-top: 1px solid rgba(0,0,0,0.04);
  max-height: 150px;
  overflow-y: auto;
  white-space: pre-wrap;
}

.modal-content.critical-error {
  border: 1px solid rgba(225, 29, 72, 0.3);
  box-shadow: 0 20px 50px -10px rgba(225, 29, 72, 0.2);
}

.btn-retry-inline {
  background: linear-gradient(135deg, var(--emerald) 0%, #10B981 100%);
  color: white;
  box-shadow: var(--shadow-sm);
}

.btn-retry-inline:hover {
  background: linear-gradient(135deg, var(--emerald-hover) 0%, var(--emerald) 100%);
  box-shadow: var(--shadow-md);
}

.spin-slow {
  animation: spin 1.5s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Premium Session Modal Action Buttons & Grid */
.session-actions-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
}

.session-actions-row {
  display: flex;
  gap: 0.75rem;
  width: 100%;
}

/* Base button styling overrides for modal context to ensure exact symmetry */
.btn-session-primary,
.btn-session-secondary,
.btn-session-warning,
.btn-session-revert,
.btn-session-revert-cancel,
.btn-session-danger {
  width: 100%;
  height: 46px; /* Consistent premium height */
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: var(--font-sans);
}

/* Primary Complete Session: Emerald Glow */
.btn-session-primary {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.2);
}
.btn-session-primary:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  transform: translateY(-1.5px);
  box-shadow: 0 6px 16px rgba(5, 150, 105, 0.3);
}
.btn-session-primary:active {
  transform: translateY(0);
}

/* Secondary Actions (Reschedule/Move): Sleek Outline/Slate */
.btn-session-secondary {
  background: #F8FAFC;
  color: var(--text-primary);
  border: 1px solid #E2E8F0;
}
.btn-session-secondary:hover {
  background: #F1F5F9;
  border-color: #CBD5E1;
  transform: translateY(-1px);
}
.btn-session-secondary:active {
  transform: translateY(0);
}

/* Cancel Action: Soft Coral Warning */
.btn-session-warning {
  background: #FFF5F5;
  color: #E11D48;
  border: 1px solid #FEE2E2;
}
.btn-session-warning:hover {
  background: #FFE4E6;
  border-color: #FDA4AF;
  transform: translateY(-1px);
}
.btn-session-warning:active {
  transform: translateY(0);
}

/* Revert Actions (Undo Complete): Premium Amber Soft */
.btn-session-revert {
  background: #FFFBEB;
  color: #D97706;
  border: 1px solid #FEF3C7;
  box-shadow: 0 2px 6px rgba(217, 119, 6, 0.05);
}
.btn-session-revert:hover {
  background: #FEF3C7;
  border-color: #FDE68A;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(217, 119, 6, 0.1);
}
.btn-session-revert:active {
  transform: translateY(0);
}

/* Revert Cancel: Premium Indigo Soft */
.btn-session-revert-cancel {
  background: #EEF2FF;
  color: var(--primary);
  border: 1px solid #E0E7FF;
}
.btn-session-revert-cancel:hover {
  background: #E0E7FF;
  border-color: #C7D2FE;
  transform: translateY(-1px);
}
.btn-session-revert-cancel:active {
  transform: translateY(0);
}

/* Delete Action: Safe Crimson Outline at bottom */
.btn-session-danger {
  background: transparent;
  color: #EF4444;
  border: 1px solid #FEE2E2;
}
.btn-session-danger:hover {
  background: #FEF2F2;
  border-color: #FCA5A5;
  color: #DC2626;
  transform: translateY(-1px);
}
.btn-session-danger:active {
  transform: translateY(0);
}

/* Nav tabs notification count badge */
.nav-badge {
  background: #EF4444;
  color: white;
  font-size: 0.7rem;
  padding: 0.1rem 0.4rem;
  border-radius: 10px;
  font-weight: 700;
  margin-left: 0.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
  animation: scaleIn 0.3s ease-out;
}

@keyframes scaleIn {
  from { transform: scale(0); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.6; }
  100% { opacity: 1; }
}

/* ============================================================================
   🎒 PREMIUM COIN CHECKOUT & SANDBOX PAYMENTS SYSTEM
   ============================================================================ */

.topup-packages-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  width: 100%;
  margin-top: 0.75rem;
  margin-bottom: 0.75rem;
}

.topup-package-card {
  background: white;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 0.75rem 0.5rem;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

.topup-package-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.topup-package-card.selected {
  border: 2px solid var(--primary) !important;
  background: var(--primary-glow);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.1) !important;
}

.topup-package-card .pkg-coins {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
}

.topup-package-card .pkg-price {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.topup-package-card .pkg-badge {
  font-size: 0.55rem;
  background: var(--amber-soft);
  color: var(--amber);
  padding: 1px 4px;
  border-radius: 4px;
  font-weight: 700;
  margin-top: 0.15rem;
  text-transform: uppercase;
}

.pay-method-toggle {
  display: flex;
  gap: 0.5rem;
  width: 100%;
  margin-bottom: 1rem;
}

.pay-btn-wechat, .pay-btn-alipay {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  border: 1px solid #E2E8F0;
  background: white;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: all 0.15s ease-out;
  color: var(--text-secondary);
}

.pay-btn-wechat:hover {
  border-color: #07C160;
  background: rgba(7, 193, 96, 0.03);
}

.pay-btn-wechat.selected {
  border: 2px solid #07C160 !important;
  background: rgba(7, 193, 96, 0.08) !important;
  color: #07C160 !important;
  box-shadow: 0 4px 10px rgba(7, 193, 96, 0.1);
}

.pay-btn-alipay:hover {
  border-color: #1677FF;
  background: rgba(22, 119, 255, 0.03);
}

.pay-btn-alipay.selected {
  border: 2px solid #1677FF !important;
  background: rgba(22, 119, 255, 0.08) !important;
  color: #1677FF !important;
  box-shadow: 0 4px 10px rgba(22, 119, 255, 0.1);
}

/* Dynamic QR modal styling */
.checkout-qr-box {
  background: #F8FAFC;
  border: 1px solid #CBD5E1;
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin: 1rem 0;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.checkout-timer {
  font-family: monospace;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--rose);
  background: #FFE4E6;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.pay-brand-badge {
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
}
.pay-brand-badge.wechat {
  background: rgba(7, 193, 96, 0.12);
  color: #07C160;
}
.pay-brand-badge.alipay {
  background: rgba(22, 119, 255, 0.12);
  color: #1677FF;
}

/* ============================================================================
   🔑 PREMIUM GLASSMORPHIC LOGIN GATEWAY STYLES
   ============================================================================ */

.login-gateway-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  width: 100vw;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 5000;
  overflow-y: auto;
  padding: 1.5rem;
  background: radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.15) 0%, rgba(168, 85, 247, 0.15) 45%, rgba(236, 72, 153, 0.1) 90%), #0F172A;
  font-family: var(--font-sans);
}

.login-gateway-container::before {
  content: "";
  position: absolute;
  top: -10%;
  left: -10%;
  width: 120%;
  height: 120%;
  background: 
    radial-gradient(circle at 80% 20%, rgba(99, 102, 241, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 20% 80%, rgba(236, 72, 153, 0.1) 0%, transparent 45%);
  z-index: -1;
  pointer-events: none;
  animation: bgPulse 20s infinite alternate ease-in-out;
}

@keyframes bgPulse {
  0% { transform: scale(1) translate(0, 0); }
  50% { transform: scale(1.05) translate(2%, -2%); }
  100% { transform: scale(0.95) translate(-2%, 2%); }
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: rgba(30, 41, 59, 0.7) !important;
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: var(--radius-lg);
  padding: 2.75rem 2.25rem;
  box-shadow: 
    0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 20px 40px -4px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  animation: loginFadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
  color: white;
}

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

.login-header {
  text-align: center;
  margin-bottom: 2.25rem;
}

.login-logo {
  font-size: 3rem;
  margin-bottom: 0.75rem;
  animation: float 3s infinite ease-in-out;
  display: inline-block;
}

.login-header h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.75rem;
  letter-spacing: -0.02em;
  color: white;
  margin: 0 0 0.4rem 0;
  background: linear-gradient(135deg, #FFFFFF 0%, #E2E8F0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-header span {
  font-size: 0.85rem;
  color: #94A3B8;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Sliding Switch Role Toggle */
.role-selector-wrapper {
  margin-bottom: 2rem;
}

.role-selector-bg {
  position: relative;
  display: flex;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 9999px;
  padding: 0.3rem;
  z-index: 1;
}

.role-selector-slider {
  position: absolute;
  top: 0.3rem;
  left: 0.3rem;
  height: calc(100% - 0.6rem);
  width: calc(50% - 0.3rem);
  background: linear-gradient(135deg, var(--primary) 0%, #6366F1 100%);
  border-radius: 9999px;
  z-index: -1;
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.role-selector-bg.teacher-active .role-selector-slider {
  transform: translateX(100%);
  background: linear-gradient(135deg, #A855F7 0%, #8B5CF6 100%);
  box-shadow: 0 4px 12px rgba(168, 85, 247, 0.3);
}

.role-toggle-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: #94A3B8;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.75rem 0;
  cursor: pointer;
  border-radius: 9999px;
  transition: color 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  outline: none;
}

.role-toggle-btn.active {
  color: white !important;
}

/* Floating Input Group */
.input-group {
  position: relative;
  margin-bottom: 1.75rem;
}

.input-group input {
  width: 100%;
  padding: 1.15rem 1rem 0.65rem 1rem;
  background: rgba(15, 23, 42, 0.4) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: white !important;
  outline: none;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.input-group label {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.9rem;
  color: #64748B;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  pointer-events: none;
}

/* Active Floating Label Logic */
.input-group input:focus ~ label,
.input-group input:not(:placeholder-shown) ~ label {
  top: 18%;
  font-size: 0.7rem;
  color: #A5B4FC;
  font-weight: 700;
}

.input-group input:focus {
  border-color: #6366F1 !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15) !important;
  background: rgba(15, 23, 42, 0.6) !important;
}

/* Glowing Border Indicator */
.input-highlight {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: #6366F1;
  transition: all 0.3s ease;
}

.input-group input:focus ~ .input-highlight {
  width: 100%;
  left: 0;
}

.login-gateway-container.teacher-active-theme .input-group input:focus {
  border-color: #A855F7 !important;
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.15) !important;
}

.login-gateway-container.teacher-active-theme .input-highlight {
  background: #A855F7;
}

.login-gateway-container.teacher-active-theme .input-group input:focus ~ label,
.login-gateway-container.teacher-active-theme .input-group input:not(:placeholder-shown) ~ label {
  color: #D8B4FE;
}

/* Login Submit Button */
.btn-login-submit {
  width: 100%;
  padding: 0.95rem;
  background: linear-gradient(135deg, var(--primary) 0%, #6366F1 100%);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
  outline: none;
}

.btn-login-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(99, 102, 241, 0.35);
}

.btn-login-submit:active {
  transform: translateY(0);
}

.login-gateway-container.teacher-active-theme .btn-login-submit {
  background: linear-gradient(135deg, #A855F7 0%, #8B5CF6 100%);
  box-shadow: 0 4px 12px rgba(168, 85, 247, 0.25);
}

.login-gateway-container.teacher-active-theme .btn-login-submit:hover {
  box-shadow: 0 8px 16px rgba(168, 85, 247, 0.35);
}

.login-footer {
  text-align: center;
  margin-top: 1.75rem;
}

.login-footer p {
  font-size: 0.75rem;
  color: #64748B;
  margin: 0;
}

/* Spinner Loader */
.btn-spinner {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.hidden {
  display: none !important;
}

/* Premium Logout Button in Header */
.btn-logout {
  background: rgba(225, 29, 72, 0.1);
  border: 1px solid rgba(225, 29, 72, 0.2);
  color: var(--rose);
  padding: 0.45rem 0.85rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease-out;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  outline: none;
}

.btn-logout:hover {
  background: var(--rose);
  color: white;
  box-shadow: 0 4px 12px rgba(225, 29, 72, 0.15);
  transform: translateY(-1px);
}

/* ============================================================================
   RESPONSIVE UTILITIES & CSS SCALPEL
   ============================================================================ */

/* Hide by default on desktop, show only on mobile */
.show-on-mobile-only {
  display: none !important;
}

@media (max-width: 1024px) {
  /* Hide on mobile viewports */
  .hide-on-mobile {
    display: none !important;
  }

  /* Show on mobile viewports (only if not explicitly hidden) */
  nav.show-on-mobile-only:not(.hidden) {
    display: flex !important;
  }
  div.show-on-mobile-only:not(.hidden) {
    display: block !important;
  }
  span.show-on-mobile-only:not(.hidden) {
    display: inline-block !important;
  }

  /* Structural paddings for app-container to avoid footer overlap */
  .app-container {
    padding-bottom: 85px !important;
  }
}

/* ============================================================================
   FIXED BOTTOM NAVIGATION BAR
   ============================================================================ */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 64px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  justify-content: space-around;
  align-items: center;
  z-index: 1500;
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.04);
}

.mobile-nav-item {
  background: transparent;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.65rem;
  font-weight: 700;
  cursor: pointer;
  gap: 0.2rem;
  flex: 1;
  height: 100%;
  transition: var(--transition);
  outline: none;
  padding: 4px 0;
}

.mobile-nav-item.active {
  color: var(--primary) !important;
}

/* Specific theme color for student nav items (Vibrant Emerald) */
#mobile-bottom-bar-student .mobile-nav-item.active {
  color: var(--emerald) !important;
}

.mobile-nav-icon {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
  transition: transform 0.2s ease;
}

.mobile-nav-item:active .mobile-nav-icon {
  transform: scale(0.9);
}

/* Dynamic notification badge on bottom nav */
.mobile-nav-badge {
  position: absolute;
  top: -4px;
  right: -8px;
  background: var(--rose);
  color: white;
  border-radius: 9999px;
  padding: 0.15rem 0.35rem;
  font-size: 0.6rem;
  font-weight: 800;
  line-height: 1;
  min-width: 14px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(225, 29, 72, 0.4);
}

/* Mobile responsive padding and alignment scale */
@media (max-width: 768px) {
  .detail-title-row {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
    padding-bottom: 1rem;
  }
  
  .detail-title-row .btn-add-student,
  .detail-title-row .btn {
    width: 100%;
  }

  .app-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
}

.icon-btn:hover {
  color: #EF4444 !important;
}





