/* Import Fonts - We will rely on System Fonts for an authentic iOS feel */
/* Color Variables & Root */
:root {
  --font-primary: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-title: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* iOS Color Palette */
  --primary: #007AFF; /* iOS Blue */
  --primary-hover: #0056b3;
  --primary-light: rgba(0, 122, 255, 0.1);
  
  --success: #34C759; /* iOS Green */
  --success-light: rgba(52, 199, 89, 0.1);
  --success-hover: #248a3d;

  --warning: #FF9500; /* iOS Orange */
  --warning-light: rgba(255, 149, 0, 0.1);

  --danger: #FF3B30; /* iOS Red */
  --danger-light: rgba(255, 59, 48, 0.1);
  --danger-hover: #b32922;

  --info: #5AC8FA; /* iOS Light Blue */
  --info-light: rgba(90, 200, 250, 0.1);

  --text-main: #000000; /* Black */
  --text-muted: #8E8E93; /* iOS Gray */
  --text-white: #ffffff;

  /* iOS Card settings */
  --glass-bg: #FFFFFF;
  --glass-border: transparent;
  --glass-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  
  --radius-sm: 10px;
  --radius-md: 12px;
  --radius-lg: 16px;
  
  --transition-smooth: all 0.3s ease-out;
  --transition-fast: all 0.15s ease-out;
}

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

body {
  font-family: var(--font-primary);
  color: var(--text-main);
  background-color: #F2F2F7; /* iOS grouped background */
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Base Panel Containers (iOS styled cards) */
.glass-panel {
  background: var(--glass-bg);
  border-radius: var(--radius-md);
  box-shadow: var(--glass-shadow);
  padding: 24px;
  transition: var(--transition-smooth);
}

/* App Header & Layout */
.app-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px 80px 16px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  padding: 16px 24px;
  z-index: 10;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.logo-icon {
  background: var(--primary);
  color: var(--text-white);
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-icon i, .logo-icon svg {
  width: 20px;
  height: 20px;
}

.logo-text {
  font-family: var(--font-title);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-main);
}

.btn-header {
  display: flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: none;
  color: var(--primary);
  padding: 8px 12px;
  font-weight: 500;
  font-size: 16px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-header:hover {
  opacity: 0.7;
}

.btn-header i, .btn-header svg {
  width: 18px;
  height: 18px;
}

/* Page screens container with smooth transitions */
.screen {
  opacity: 0;
  transform: translateY(20px);
  display: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  flex-grow: 1;
}

.screen.active {
  display: flex;
  flex-direction: column;
  opacity: 1;
  transform: translateY(0);
}

/* Screen 1: Welcome/Login Screen */
.welcome-screen {
  align-items: center;
  justify-content: center;
  gap: 24px;
  text-align: center;
  max-width: 800px;
  margin: 40px auto 0 auto;
}

.welcome-title {
  font-family: var(--font-title);
  font-size: 36px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 12px;
  color: var(--text-main);
}

.welcome-title span {
  color: var(--primary);
}

.welcome-desc {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 32px auto;
}

.role-cards-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  width: 100%;
}

.role-card {
  padding: 32px 24px;
  border-radius: var(--radius-md);
  background: var(--glass-bg);
  box-shadow: var(--glass-shadow);
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  transition: var(--transition-fast);
  border: 1px solid rgba(0,0,0,0.05);
}

.role-card:active {
  transform: scale(0.98);
  background: #F2F2F7;
}

.role-card.student-card {
  border-bottom: 4px solid var(--success);
}

.role-card.teacher-card {
  border-bottom: 5px solid var(--primary);
}

.role-card-icon {
  width: 76px;
  height: 76px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin-bottom: 12px;
  transition: var(--transition-smooth);
}

.student-card .role-card-icon {
  background: var(--success-light);
  color: var(--success);
}

.teacher-card .role-card-icon {
  background: var(--primary-light);
  color: var(--primary);
}

.role-card:hover .role-card-icon {
  transform: rotate(10deg) scale(1.1);
}

.role-card-title {
  font-family: var(--font-title);
  font-size: 22px;
  font-weight: 700;
}

.role-card-desc {
  color: var(--text-muted);
  font-size: 14px;
}

/* Modals & Popups (PIN Dialog) */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.25);
  backdrop-filter: blur(10px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  display: flex;
  opacity: 1;
}

.modal-content {
  width: 90%;
  max-width: 420px;
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-title {
  font-family: var(--font-title);
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-close {
  background: transparent;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-close:hover {
  opacity: 0.7;
}

.pin-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

.input-field-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-field-wrapper i, .input-field-wrapper svg {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  width: 16px;
  height: 16px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

.input-control {
  width: 100%;
  padding: 12px 14px 12px 42px;
  border: 1px solid #E5E5EA;
  border-radius: var(--radius-sm);
  background: white;
  font-family: var(--font-primary);
  font-size: 16px;
  transition: var(--transition-fast);
}

.input-control:focus {
  outline: none;
  border-color: var(--primary);
}

.pin-error {
  color: var(--danger);
  font-size: 13px;
  font-weight: 500;
  display: none;
  align-items: center;
  gap: 6px;
}

/* Shake Animation for Pin Error */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.shake-it {
  animation: shake 0.3s ease;
}

.btn-submit {
  background: var(--primary);
  color: white;
  border: none;
  padding: 14px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-submit i, .btn-submit svg {
  width: 16px;
  height: 16px;
}

.btn-submit:hover {
  opacity: 0.85;
}

/* Screen 2: Guru Dashboard Layout */
.dashboard-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 28px;
  margin-top: 10px;
}

.dashboard-sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-nav-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-primary);
  font-size: 15px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: var(--transition-fast);
}

.sidebar-nav-btn:hover {
  background: #E5E5EA;
}

.sidebar-nav-btn.active {
  background: #E5E5EA;
  color: var(--text-main);
  font-weight: 700;
}

.sidebar-nav-btn.active i, .sidebar-nav-btn.active svg {
  color: var(--primary);
}

.sidebar-nav-btn i, .sidebar-nav-btn svg {
  width: 18px;
  height: 18px;
}

/* Teacher view panels container */
.panel-container {
  flex-grow: 1;
}

.panel {
  display: none;
  flex-direction: column;
  gap: 24px;
}

.panel.active {
  display: flex;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  padding-bottom: 16px;
  margin-bottom: 8px;
}

.panel-title {
  font-family: var(--font-title);
  font-size: 24px;
  font-weight: 800;
  color: var(--text-main);
}

.panel-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Controls Grid (Filtering & Setup) */
.controls-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 20px;
}

.date-select-card, .student-select-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* List/Cards selection elements */
.student-bubble-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-height: 140px;
  overflow-y: auto;
  padding: 4px;
}

.student-bubble {
  padding: 8px 16px;
  border-radius: 20px;
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.student-bubble:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

.student-bubble.selected {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Checklist Cards */
.checklist-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.checklist-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: white;
  border: 1px solid #E5E5EA;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
}

.checklist-card:active {
  background: #F2F2F7;
}

.checklist-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.checklist-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.checklist-icon i, .checklist-icon svg {
  width: 20px;
  height: 20px;
}

.checklist-card:nth-child(1) .checklist-icon { background: #e0f2fe; color: #0369a1; } /* Shalat 5 */
.checklist-card:nth-child(2) .checklist-icon { background: #fef3c7; color: #b45309; } /* Sunnah */
.checklist-card:nth-child(3) .checklist-icon { background: #d1fae5; color: #047857; } /* Quran */
.checklist-card:nth-child(4) .checklist-icon { background: #fee2e2; color: #b91c1c; } /* Sedekah */
.checklist-card:nth-child(5) .checklist-icon { background: #f3e8ff; color: #6d28d9; } /* Orang Tua */
.checklist-card:nth-child(6) .checklist-icon { background: #e0f2fe; color: #0369a1; } /* Wudhu */

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

.checklist-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
}

.checklist-desc {
  font-size: 12px;
  color: var(--text-muted);
}

/* Beautiful Switch Toggle */
.switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
}

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

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

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

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

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

.checklist-card.completed {
  border-color: rgba(16, 185, 129, 0.4);
  background: var(--success-light);
}

/* Save Bar in Input Panel */
.save-bar {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.btn-primary {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--primary);
  color: white;
  border: none;
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 16px -4px rgba(99, 102, 241, 0.3);
  transition: var(--transition-fast);
}

.btn-primary i, .btn-primary svg {
  width: 16px;
  height: 16px;
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 12px 20px -4px rgba(99, 102, 241, 0.4);
}

/* Panel 2: Kelola Siswa */
.manage-grid {
  display: grid;
  grid-template-columns: 1.2fr 2fr;
  gap: 24px;
}

.student-list-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.search-mini {
  position: relative;
  display: flex;
  align-items: center;
}

.search-mini i, .search-mini svg {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  width: 14px;
  height: 14px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

.search-mini input {
  width: 100%;
  padding: 10px 10px 10px 38px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-sm);
  background: white;
  font-size: 14px;
}

.search-mini input:focus {
  outline: none;
  border-color: var(--primary);
}

/* Table element */
.table-wrapper {
  max-height: 380px;
  overflow-y: auto;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: var(--radius-sm);
  background: white;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

thead {
  background: #f8fafc;
  position: sticky;
  top: 0;
  z-index: 2;
}

th {
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

td {
  padding: 14px 16px;
  font-size: 14px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: #fafafa;
}

.btn-icon-danger {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: none;
  background: var(--danger-light);
  color: var(--danger);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

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

/* Backup and Sync Card */
.sync-panel-layout {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 8px;
}

.sync-card {
  padding: 20px;
  background: white;
  border: 1px solid #E5E5EA;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sync-card-title {
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sync-card-desc {
  font-size: 12px;
  color: var(--text-muted);
}

.btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: white;
  color: var(--primary);
  border: 1px solid var(--primary);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-secondary i, .btn-secondary svg {
  width: 16px;
  height: 16px;
}

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

/* Screen 3: Portal Siswa (Leaderboard & Details) */
.student-portal-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: start;
}

/* Search Header at the top */
.search-header-container {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.search-box-large {
  position: relative;
  width: 100%;
  max-width: 600px;
}

.search-box-large i, .search-box-large svg {
  position: absolute;
  left: 16px;
  color: var(--text-muted);
  width: 20px;
  height: 20px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

.search-box-large input {
  width: 100%;
  padding: 14px 20px 14px 44px;
  border: none;
  border-radius: 10px;
  background: #E3E3E8;
  font-family: var(--font-primary);
  font-size: 16px;
  font-weight: 500;
  transition: var(--transition-smooth);
}

.search-box-large input:focus {
  outline: none;
}

/* Auto suggestion dropdown */
.search-suggestions {
  position: absolute;
  top: 105%;
  left: 0;
  right: 0;
  background: white;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.05);
  max-height: 200px;
  overflow-y: auto;
  z-index: 5;
  display: none;
}

.search-suggestions.active {
  display: block;
}

.suggestion-item {
  padding: 12px 20px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition-fast);
}

.suggestion-item:hover {
  background: var(--primary-light);
  color: var(--primary);
}

/* Leaderboard Board */
.leaderboard-card {
  height: 100%;
  min-height: 480px;
}

.leaderboard-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-title);
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 20px;
}

.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 450px;
  overflow-y: auto;
  padding-right: 4px;
}

.leaderboard-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: white;
  border: 1px solid #E5E5EA;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
  cursor: pointer;
}

.leaderboard-item:active {
  background: #F2F2F7;
}

.leaderboard-item:hover {
  border-color: var(--primary);
  transform: translateX(4px);
}

.rank-badge {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  margin-right: 14px;
  flex-shrink: 0;
}

.rank-1 { background: #fef08a; color: #a16207; border: 2px solid #facc15; }
.rank-2 { background: #e2e8f0; color: #475569; border: 2px solid #cbd5e1; }
.rank-3 { background: #ffedd5; color: #c2410c; border: 2px solid #fb923c; }
.rank-other { background: #f1f5f9; color: #64748b; }

.leaderboard-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #e0f2fe;
  color: #0369a1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  margin-right: 12px;
}

.leaderboard-info {
  flex-grow: 1;
}

.leaderboard-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
}

.leaderboard-bar-bg {
  height: 6px;
  background: #f1f5f9;
  border-radius: 3px;
  margin-top: 4px;
  overflow: hidden;
}

.leaderboard-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--info));
  border-radius: 3px;
  width: 0%;
  transition: width 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.leaderboard-score {
  font-size: 14px;
  font-weight: 800;
  color: var(--primary);
  margin-left: 16px;
  text-align: right;
  white-space: nowrap;
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: var(--text-muted);
  text-align: center;
  gap: 12px;
}

.empty-state i, .empty-state svg {
  width: 40px;
  height: 40px;
  color: #cbd5e1;
}

/* Student Detail Panel (Right Side) */
.student-detail-card {
  min-height: 480px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.student-detail-profile {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.student-avatar-lg {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--primary-light), var(--info-light));
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 800;
  box-shadow: 0 6px 12px rgba(99, 102, 241, 0.1);
}

.student-meta {
  display: flex;
  flex-direction: column;
}

.student-name-lg {
  font-family: var(--font-title);
  font-size: 20px;
  font-weight: 800;
  color: var(--text-main);
}

.student-rank-lbl {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Stats mini grid */
.student-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.stat-item-box {
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.04);
  padding: 14px 10px;
  border-radius: var(--radius-sm);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: var(--transition-fast);
}

.stat-item-box:hover {
  border-color: var(--primary-light);
  transform: translateY(-2px);
}

.stat-val {
  font-family: var(--font-title);
  font-size: 18px;
  font-weight: 800;
}

.stat-item-box.points-box .stat-val { color: var(--primary); }
.stat-item-box.streak-box .stat-val { color: var(--warning); }
.stat-item-box.deeds-box .stat-val { color: var(--success); }

.stat-lbl {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

/* Charts and Visualization */
.chart-card {
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.04);
  padding: 16px;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chart-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.chart-container-svg {
  height: 120px;
  width: 100%;
  display: flex;
  align-items: flex-end;
  gap: 14px;
  padding: 10px 10px 0 10px;
  position: relative;
  border-bottom: 2px solid #e2e8f0;
}

.chart-bar {
  flex-grow: 1;
  background: linear-gradient(180deg, var(--primary-light), var(--primary));
  border-top-left-radius: 4px;
  border-top-right-radius: 4px;
  height: 0%;
  transition: height 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  cursor: pointer;
}

.chart-bar:hover {
  background: linear-gradient(180deg, var(--info), var(--primary));
}

.chart-bar::after {
  content: attr(data-val) "%";
  position: absolute;
  top: -24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 800;
  background: var(--text-main);
  color: white;
  padding: 2px 6px;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.chart-bar:hover::after {
  opacity: 1;
}

.chart-labels-row {
  display: flex;
  justify-content: space-between;
  width: 100%;
  padding: 6px 10px 0 10px;
}

.chart-lbl-day {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  flex-grow: 1;
  text-align: center;
}

/* Badges Showcase Grid */
.badges-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.badge-card {
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.04);
  padding: 14px 10px;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  filter: grayscale(1);
  opacity: 0.5;
  transition: var(--transition-smooth);
}

.badge-card.unlocked {
  filter: grayscale(0);
  opacity: 1;
  border-color: rgba(245, 158, 11, 0.2);
  background: linear-gradient(135deg, #ffffff, #fffbeb);
  box-shadow: 0 4px 10px -2px rgba(245, 158, 11, 0.15);
}

.badge-card.unlocked:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 8px 16px -2px rgba(245, 158, 11, 0.25);
}

.badge-icon-wrap {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.badge-icon-wrap i, .badge-icon-wrap svg {
  width: 18px;
  height: 18px;
}

.badge-card.unlocked .badge-icon-wrap {
  background: #fef3c7;
  color: #d97706;
}

.badge-card.locked .badge-icon-wrap {
  background: #f1f5f9;
  color: #94a3b8;
}

.badge-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.badge-desc {
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.3;
}

/* Toast System */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 999;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  background: white;
  border-left: 4px solid var(--success);
  padding: 14px 20px;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
  font-size: 14px;
  font-weight: 600;
  transform: translateX(120%);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.35);
}

.toast.show {
  transform: translateX(0);
}

.toast.toast-error {
  border-left-color: var(--danger);
}

.toast-icon {
  font-size: 18px;
}

.toast-success .toast-icon { color: var(--success); }
.toast-error .toast-icon { color: var(--danger); }

/* Scrollbar customization */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Responsive Breakpoints */
@media (max-width: 992px) {
  .dashboard-layout {
    grid-template-columns: 1fr;
  }
  .student-portal-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .role-cards-container,
  .checklist-container,
  .manage-grid,
  .controls-grid,
  .sync-panel-layout {
    grid-template-columns: 1fr;
  }

  .badges-container {
    grid-template-columns: repeat(2, 1fr);
  }

  .welcome-title {
    font-size: 32px;
  }

  .app-container {
    padding: 12px 10px 60px 10px;
  }

  header {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }

  .table-wrapper {
    overflow-x: auto;
  }

  .student-detail-profile {
    flex-direction: column;
    text-align: center;
  }
}

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

  .badges-container {
    grid-template-columns: 1fr;
  }

  .welcome-title {
    font-size: 26px;
  }

  .role-card {
    padding: 24px 20px;
  }

  .panel-title {
    font-size: 20px;
  }

  .stat-val {
    font-size: 16px;
  }
}
