/* STYLE CSS: BẢNG TUYÊN DƯƠNG SAO & TÍCH ĐIỂM ĐỔI QUÀ TCT.VN */
:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #eef2ff;
  --accent: #f59e0b;
  --accent-hover: #d97706;
  --accent-light: #fef3c7;
  --star-gold: #fbbf24;
  --success: #10b981;
  --danger: #ef4444;
  --purple: #8b5cf6;
  --bg-main: #f8fafc;
  --card-bg: #ffffff;
  --border: #e2e8f0;
  --text-main: #0f172a;
  --text-sub: #64748b;
  --radius: 12px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
}

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

body {
  font-family: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  overflow-x: hidden;
}

/* Canvas toàn màn hình hiệu ứng sao */
#burst-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9999;
}

.app-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 16px 24px 32px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* HEADER */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding: 12px 20px;
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 60%, #4338ca 100%);
  color: #ffffff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  margin-bottom: 16px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 8px;
  backdrop-filter: blur(8px);
  transition: all 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-back:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.header-icon {
  font-size: 2.2rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
  animation: pulse-star 2s infinite ease-in-out;
}

@keyframes pulse-star {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.1) rotate(5deg); }
}

.header-titles h1 {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
}

.header-titles .subtitle {
  font-size: 0.85rem;
  color: #e0e7ff;
  margin-top: 2px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-action, .btn-secondary, .btn-primary, .btn-accent {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-action {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.btn-action:hover {
  background: rgba(255, 255, 255, 0.28);
}

.btn-secondary {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: #e2e8f0;
}

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

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.btn-accent {
  background: var(--accent);
  color: #ffffff;
}

.btn-accent:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

/* BANNER KHỞI TẠO CHUẨN */
.banner-box {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1px solid #fde68a;
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

.banner-box.hidden {
  display: none !important;
}

.banner-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.banner-icon {
  font-size: 2rem;
}

.banner-text {
  flex: 1;
  min-width: 280px;
}

.banner-text h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #92400e;
  margin-bottom: 4px;
}

.banner-text p {
  font-size: 0.88rem;
  color: #78350f;
}

.banner-btns {
  display: flex;
  gap: 10px;
}

/* TOP NAV & STATS */
.top-nav-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  background: var(--card-bg);
  padding: 8px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.nav-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-sub);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tab-btn:hover {
  background: #f1f5f9;
  color: var(--text-main);
}

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

.quick-stats-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f8fafc;
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.85rem;
}

.stat-label {
  color: var(--text-sub);
}

.stat-value {
  font-weight: 700;
  color: var(--text-main);
}

.star-color {
  color: #d97706;
}

.class-inline-input {
  border: 1px dashed #cbd5e1;
  background: #fff;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 700;
  color: var(--primary);
  font-size: 0.85rem;
  width: 90px;
}

.class-inline-input:focus {
  outline: none;
  border-color: var(--primary);
  background: #ffffff;
}

/* MAIN BODY & TAB PANES */
.main-body {
  flex: 1;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

/* PANE TOOLBAR */
.pane-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--card-bg);
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}

.toolbar-search {
  position: relative;
  flex: 1;
  min-width: 220px;
}

.toolbar-search .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 0.9rem;
}

.toolbar-search input {
  width: 100%;
  padding: 8px 12px 8px 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-family: inherit;
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.15s ease;
}

.toolbar-search input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.toolbar-filter, .toolbar-sort {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-sub);
}

.toolbar-filter select, .toolbar-sort select {
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #ffffff;
  font-family: inherit;
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-action-sm {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-action-sm:hover {
  background: #f1f5f9;
}

.btn-primary-sm {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

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

/* STUDENTS GRID */
.students-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.student-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.student-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}

.student-card.starred-anim {
  animation: card-star-glow 0.6s ease;
}

@keyframes card-star-glow {
  0% { transform: scale(1); box-shadow: 0 0 0 rgba(245, 158, 11, 0); }
  50% { transform: scale(1.03); box-shadow: 0 0 25px rgba(245, 158, 11, 0.45); border-color: #f59e0b; }
  100% { transform: scale(1); box-shadow: var(--shadow-md); }
}

.student-card-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.avatar-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1 0%, #4338ca 100%);
  color: #ffffff;
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 4px rgba(79, 70, 229, 0.2);
}

.avatar-circle.gender-nu {
  background: linear-gradient(135deg, #ec4899 0%, #be185d 100%);
  box-shadow: 0 2px 4px rgba(236, 72, 153, 0.2);
}

.student-info {
  flex: 1;
  min-width: 0;
}

.student-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.student-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.student-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-sub);
  margin-top: 2px;
}

.group-badge {
  background: #f1f5f9;
  padding: 1px 7px;
  border-radius: 4px;
  font-weight: 600;
  color: #475569;
}

/* KHỐI SAO & HOA ĐIỂM MƯỜI */
.student-star-display {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  background: linear-gradient(135deg, #fefce8 0%, #fef3c7 100%);
  border: 1px solid #fef08a;
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 12px;
}

.star-count-box {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.star-count-num {
  font-size: 1.8rem;
  font-weight: 900;
  color: #b45309;
  line-height: 1;
}

.star-icon-big {
  font-size: 1.4rem;
  color: var(--accent);
}

.star-balance-tag {
  font-size: 0.75rem;
  color: #78350f;
  background: rgba(254, 240, 138, 0.6);
  padding: 2px 6px;
  border-radius: 4px;
}

/* Thước đo sao mini */
.star-track-icons {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
  min-height: 20px;
  margin-bottom: 12px;
  align-items: center;
}

.mini-star {
  font-size: 0.85rem;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.1));
}

.mini-star-overflow {
  font-size: 0.75rem;
  font-weight: 700;
  color: #92400e;
  background: #fef3c7;
  padding: 0 4px;
  border-radius: 4px;
}

/* Danh hiệu gắn trên thẻ */
.student-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  background: #ede9fe;
  color: #6d28d9;
  margin-bottom: 12px;
}

/* Thao tác trên thẻ */
.student-card-actions {
  display: flex;
  gap: 8px;
}

.btn-award-star {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #ffffff;
  border: none;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 9px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 2px 6px rgba(217, 119, 6, 0.25);
}

.btn-award-star:hover {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(217, 119, 6, 0.35);
}

.btn-student-menu {
  width: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  color: #475569;
}

.btn-student-menu:hover {
  background: #e2e8f0;
}

/* EMPTY STATE */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 2px dashed var(--border);
  margin-top: 16px;
}

.empty-state.hidden {
  display: none;
}

.empty-icon {
  font-size: 3.5rem;
  color: #cbd5e1;
  margin-bottom: 12px;
}

.empty-state h4 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: #334155;
}

.empty-state p {
  color: var(--text-sub);
  font-size: 0.9rem;
  max-width: 500px;
  margin: 0 auto 18px;
}

.empty-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
}

/* TAB 2: LEADERBOARD & PODIUM */
.leaderboard-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
}

.section-sub {
  font-size: 0.88rem;
  color: var(--text-sub);
  margin-top: 2px;
  margin-bottom: 16px;
}

.subsection-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-main);
}

/* Podium display */
.podium-wrapper {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 16px;
  padding: 24px 16px 0;
  background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  min-height: 240px;
}

.podium-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 160px;
}

.podium-slot .avatar-circle {
  width: 52px;
  height: 52px;
  font-size: 1.2rem;
  margin-bottom: 8px;
}

.podium-name {
  font-weight: 700;
  font-size: 0.9rem;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.podium-stars {
  font-weight: 800;
  color: #d97706;
  font-size: 0.85rem;
  margin-bottom: 8px;
}

.podium-pedestal {
  width: 100%;
  border-radius: 8px 8px 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 900;
  font-size: 1.4rem;
  box-shadow: inset 0 2px 4px rgba(255,255,255,0.3);
}

.podium-first .podium-pedestal {
  height: 120px;
  background: linear-gradient(135deg, #f59e0b 0%, #b45309 100%);
}

.podium-second .podium-pedestal {
  height: 90px;
  background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
}

.podium-third .podium-pedestal {
  height: 70px;
  background: linear-gradient(135deg, #d97706 0%, #78350f 100%);
}

.podium-crown {
  font-size: 1.4rem;
  margin-bottom: -6px;
}

/* BADGES GRID */
.badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.badge-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}

.badge-icon-box {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: #fef3c7;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.badge-info h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.badge-info p {
  font-size: 0.8rem;
  color: var(--text-sub);
}

.badge-holder {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary);
  margin-top: 3px;
}

/* STYLED TABLE */
.table-responsive {
  overflow-x: auto;
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

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

.styled-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 700;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.styled-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-main);
}

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

.styled-table tr:hover {
  background: #f8fafc;
}

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

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.85rem;
}

.rank-1 { background: #fef3c7; color: #b45309; }
.rank-2 { background: #f1f5f9; color: #475569; }
.rank-3 { background: #ffedd5; color: #c2410c; }

/* TAB 3: REWARDS */
.rewards-header-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.rewards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.reward-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.reward-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.reward-icon-circle {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.reward-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

.reward-cost-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #fef3c7;
  color: #92400e;
  font-weight: 800;
  font-size: 0.82rem;
  padding: 3px 8px;
  border-radius: 6px;
  margin-top: 2px;
}

.reward-desc {
  font-size: 0.85rem;
  color: var(--text-sub);
  margin-bottom: 16px;
  line-height: 1.4;
}

.btn-redeem-gift {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px;
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-redeem-gift:hover {
  background: #2563eb;
  color: #ffffff;
}

/* TAB 4: HISTORY */
.history-header-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.history-list-box {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 8px 16px;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #f1f5f9;
}

.history-item:last-child {
  border-bottom: none;
}

.history-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.history-type-icon {
  font-size: 1.4rem;
}

.history-desc {
  font-size: 0.88rem;
  color: var(--text-main);
}

.history-desc strong {
  color: var(--text-main);
}

.history-time {
  font-size: 0.75rem;
  color: var(--text-sub);
  margin-top: 2px;
}

.history-star-tag {
  font-weight: 800;
  font-size: 0.9rem;
  padding: 4px 10px;
  border-radius: 20px;
}

.star-plus {
  background: #fef3c7;
  color: #b45309;
}

.star-minus {
  background: #fee2e2;
  color: #b91c1c;
}

/* FOOTER */
.app-footer {
  margin-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 16px;
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.save-status {
  font-size: 0.82rem;
  color: var(--text-sub);
}

.footer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-footer {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #ffffff;
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-footer:hover {
  background: #f1f5f9;
}

.btn-danger-ghost {
  color: var(--danger);
  border-color: #fecaca;
}

.btn-danger-ghost:hover {
  background: #fee2e2;
}

/* MODAL */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  padding: 16px;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: #ffffff;
  border-radius: var(--radius);
  max-width: 520px;
  width: 100%;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  transform: translateY(20px);
  transition: transform 0.2s ease;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.modal-backdrop.active .modal-card {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-sub);
  cursor: pointer;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: #f8fafc;
}

/* MODAL FORM ELEMENTS */
.form-group {
  margin-bottom: 14px;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.88rem;
  outline: none;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-row {
  display: flex;
  gap: 12px;
}

.col-6 {
  flex: 1;
}

.form-hint {
  font-size: 0.8rem;
  color: var(--text-sub);
  margin-bottom: 8px;
}

/* STAR SELECTION GRID IN MODAL */
.star-category-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.star-type-card {
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  position: relative;
  transition: all 0.15s ease;
}

.star-type-card:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.star-type-card.active {
  border-color: var(--accent);
  background: #fffbeb;
}

.st-icon {
  font-size: 1.4rem;
  margin-bottom: 2px;
}

.st-name {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-main);
}

.st-desc {
  font-size: 0.72rem;
  color: var(--text-sub);
  margin-top: 1px;
}

.st-pts {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 0.75rem;
  font-weight: 800;
  color: #b45309;
  background: #fef3c7;
  padding: 1px 6px;
  border-radius: 10px;
}

/* Stepper */
.star-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.btn-step {
  width: 36px;
  height: 36px;
  background: #f1f5f9;
  border: none;
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
}

.btn-step:hover {
  background: #e2e8f0;
}

.star-stepper input {
  width: 50px;
  height: 36px;
  border: none;
  text-align: center;
  font-weight: 700;
  font-size: 1rem;
}

.award-student-info, .redeem-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid var(--border);
  margin-bottom: 14px;
}

.award-student-meta {
  font-size: 0.8rem;
  color: var(--text-sub);
}

.redeem-icon {
  font-size: 2rem;
}

.cost-tag {
  font-size: 0.82rem;
  font-weight: 800;
  color: #b45309;
}

.redeem-note {
  font-size: 0.82rem;
  padding: 8px 12px;
  border-radius: 6px;
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.redeem-note.warning {
  background: #fef2f2;
  color: #991b1b;
  border-color: #fecaca;
}

/* PRINT AREA (ẨN TRÊN MÀN HÌNH BÌNH THƯỜNG) */
.print-gold-board {
  display: none;
}

/* MEDIA PRINT: KHỔ A4 */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }

  .app-container, .modal-backdrop, #burst-canvas {
    display: none !important;
  }

  .print-gold-board {
    display: block !important;
    width: 100%;
    padding: 20px;
    box-sizing: border-box;
  }

  .print-header {
    text-align: center;
    border-bottom: 3px double #d97706;
    padding-bottom: 12px;
    margin-bottom: 20px;
  }

  .print-emblem {
    font-size: 1.8rem;
    margin-bottom: 4px;
  }

  .print-title {
    font-size: 24pt;
    font-weight: 900;
    color: #b45309;
    letter-spacing: 1px;
    margin-bottom: 4px;
    text-transform: uppercase;
  }

  .print-sub {
    font-size: 14pt;
    font-weight: 700;
    color: #334155;
    margin-bottom: 6px;
  }

  .print-quote {
    font-size: 10.5pt;
    font-style: italic;
    color: #64748b;
  }

  .print-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 24px;
  }

  .print-student-item {
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 10px;
    text-align: center;
    page-break-inside: avoid;
    background: #fff;
  }

  .print-student-name {
    font-weight: 700;
    font-size: 10.5pt;
    margin-bottom: 4px;
  }

  .print-student-group {
    font-size: 8.5pt;
    color: #64748b;
    margin-bottom: 6px;
  }

  .print-student-stars {
    font-size: 13pt;
    font-weight: 800;
    color: #d97706;
  }

  .print-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-top: 30px;
    page-break-inside: avoid;
  }

  .print-date {
    font-size: 10pt;
    font-style: italic;
  }

  .print-sign {
    font-size: 10.5pt;
    font-weight: 700;
    text-align: center;
    width: 220px;
  }

  .print-sign i {
    font-size: 9pt;
    font-weight: normal;
  }
}
