/* ==========================================================================
   Thời Khóa Biểu & Giờ Đón Con · Hệ Thống Giao Diện Tối Sang Trọng (Luxury Dark)
   Phong cách chuẩn Agenda Studio: Tối giản, Đẳng cấp, Nét đơn sắc, Viền thở
   ========================================================================== */

:root {
  --bg: #071310;
  --bg-gradient: #0d221c;
  --card-bg: #0d1e18;
  --card-border: rgba(255, 255, 255, 0.08);
  --card-hover: rgba(16, 185, 129, 0.08);
  
  --primary: #ecfdf5;
  --primary-glow: rgba(16, 185, 129, 0.4);
  --accent: #10b981;
  --accent-light: #34d399;
  --accent-glow: rgba(16, 185, 129, 0.35);
  --gold: #fbbf24;
  --gold-glow: rgba(251, 191, 36, 0.3);
  --amber: #f59e0b;
  --danger: #f87171;
  
  --text-main: #f0fdf4;
  --text-muted: #9bb5ab;
  --text-dim: #607b71;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  
  --hero-time-color: #ffffff;
  --hero-cd-color: #34d399;
  --notice-bg: #0d1e18;
  --notice-text-color: #ecfdf5;
  
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 8px;
  
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.65);
  --font-sans: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

html {
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  background-attachment: fixed;
  background-size: cover;
  background-position: center;
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 70px;
  min-height: 100vh;
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
  position: relative;
}

/* Lớp phủ ảnh nền nếu có ảnh */
body.has-bg-image::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(7, 19, 16, 0.88);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: -1;
}

/* Shell Container */
.container {
  max-width: 980px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 18px;
  box-sizing: border-box;
  overflow-x: hidden;
  transition: filter 0.35s ease, opacity 0.35s ease;
}

/* Lớp bảo vệ Auth Gate: Chống bypass bằng DevTools khi chưa đăng nhập */
body.auth-gate-locked .container {
  filter: blur(16px);
  pointer-events: none;
  user-select: none;
  opacity: 0.2;
}

/* Icon Nét Đơn Sắc (Monochrome Stroke Icons) */
.stroke-icon {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

/* Header trường & lớp */
.app-header {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 24px;
  width: 100%;
}
.app-header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  width: 100%;
  gap: 14px;
  flex-wrap: wrap;
}
.header-top-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.trial-badge-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
  color: #fbbf24;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.12);
  user-select: none;
  cursor: pointer;
}
.trial-badge-chip:hover {
  background: rgba(245, 158, 11, 0.22);
  border-color: #fbbf24;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.2);
}
.btn-guide-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
  color: #f0fdf4;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn-guide-link:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
  color: #ffffff;
  transform: translateY(-1px);
}
.flat-icon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}
.inline-svg {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}
.settings-badges-box {
  width: 100%;
}
.settings-tab-btn.tab-dimmed {
  opacity: 0.65;
  filter: grayscale(0.2);
}
.guest-locked-card {
  transition: all 0.25s ease;
}

.school-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 260px;
}
.school-logo-img {
  max-height: 52px;
  max-width: 120px;
  object-fit: contain;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  padding: 4px 8px;
}
.school-meta h1 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.school-meta h1 .badge-class {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 8px;
  letter-spacing: 0.04em;
}
.school-meta h1 .badge-class.badge-noon-home {
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #fde68a;
}
body[data-theme="light"] .school-meta h1 .badge-class.badge-noon-home {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #b45309;
}
.school-meta p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}
.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
}
/* Nút Thiết lập chung nổi bật cho phụ huynh */
.btn-settings {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.18) 0%, rgba(5, 150, 105, 0.25) 100%);
  border: 1.5px solid rgba(52, 211, 153, 0.6);
  color: #ecfdf5;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.25);
  backdrop-filter: blur(8px);
}
.btn-settings:hover {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.3) 0%, rgba(5, 150, 105, 0.4) 100%);
  border-color: #34d399;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 18px rgba(16, 185, 129, 0.4);
}

/* Nút Quản lý dặn dò chìm nhạt, không nổi bật, dành riêng cho Admin */
.btn-admin-subtle {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 500;
  padding: 6px 11px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  opacity: 0.55;
  transition: all 0.2s;
}
.btn-admin-subtle:hover {
  opacity: 0.95;
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.06);
}

/* ==========================================================================
   HERO: KHUNG TO ĐỒNG HỒ ĐẾM NGƯỢC GIỜ ĐÓN CON HÔM NAY (Đen sang trọng)
   ========================================================================== */
.hero-pickup-card {
  background: linear-gradient(135deg, #071914 0%, #0c261e 55%, #123429 100%);
  color: white;
  border-radius: var(--radius-lg);
  padding: 30px 34px;
  margin-bottom: 16px; /* Để sát ngay trên tab thông báo chạy */
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg), 0 0 45px rgba(16, 185, 129, 0.12);
  border: 1.5px solid rgba(16, 185, 129, 0.3);
}
.hero-pickup-card::before {
  content: "";
  position: absolute;
  top: -80px;
  right: -80px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.2) 0%, transparent 70%);
  pointer-events: none;
}
.hero-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 14px;
}
.hero-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.hero-kicker {
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #a7f3d0;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.hero-status-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 800;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid var(--accent);
  color: #a7f3d0;
  letter-spacing: 0.02em;
}
.hero-status-tag.pulse-live {
  animation: liveBadgePulse 1.8s infinite;
}
@keyframes liveBadgePulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  50% { transform: scale(1.03); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
}

.hero-body-grid {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 28px;
}
.hero-time-box {
  display: flex;
  flex-direction: column;
}
.hero-time-label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.88) !important;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.hero-pickup-card #hero-school-year,
.hero-pickup-card .hero-subtext span {
  color: rgba(255, 255, 255, 0.88) !important;
  font-weight: 600;
}
.hero-time-val {
  font-size: 54px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.04em;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

/* Khung to đồng hồ đếm ngược (Centerpiece) */
.hero-countdown-box {
  background: rgba(3, 14, 11, 0.65);
  border: 1.5px solid rgba(16, 185, 129, 0.35);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius-md);
  padding: 18px 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: inset 0 0 25px rgba(16, 185, 129, 0.1), 0 8px 25px rgba(0, 0, 0, 0.3);
}
.hero-cd-label {
  font-size: 11px;
  color: #6ee7b7;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
}
.hero-cd-val {
  font-size: 40px;
  font-weight: 900;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1.1;
  text-shadow: 0 0 24px rgba(16, 185, 129, 0.5);
}
.hero-cd-sub {
  font-size: 12px;
  opacity: 0.95;
  color: rgba(255, 255, 255, 0.88);
}

/* Huy hiệu Cổng đón (Clickable Google Maps link - Kính mờ sang trọng đồng bộ) */
.hero-gate-badge {
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  border-radius: var(--radius-md);
  padding: 14px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: all 0.2s;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.hero-gate-badge:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}
.hero-gate-badge .gate-label {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 4px;
}
.hero-gate-badge .gate-name {
  font-size: 20px;
  font-weight: 900;
  line-height: 1.15;
  margin: 4px 0 2px;
  color: #ffffff;
}
.hero-gate-badge .gate-street {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Thanh tiến độ ngày học */
.hero-progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  margin-top: 22px;
  overflow: hidden;
}
.hero-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #34d399);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.6);
  transition: width 0.5s ease-out;
}

/* ==========================================================================
   TAB THÔNG BÁO CHẠY (TICKER MARQUEE) - NẰM NGAY DƯỚI ĐỒNG HỒ ĐẾM NGƯỢC
   ========================================================================== */
.ticker-tab-container {
  margin-bottom: 24px;
}
.ticker-bar {
  background: linear-gradient(135deg, rgba(11, 26, 21, 0.95) 0%, rgba(6, 17, 14, 0.98) 100%);
  border: 1.5px solid rgba(52, 211, 153, 0.35);
  color: #d1fae5;
  padding: 11px 18px;
  font-size: 13.5px;
  font-weight: 500;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.08), inset 0 0 15px rgba(0, 0, 0, 0.5);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.ticker-badge {
  background: rgba(16, 185, 129, 0.16);
  border: 1px solid rgba(52, 211, 153, 0.55);
  color: #6ee7b7;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 4px 11px;
  border-radius: 20px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.25);
}
.ticker-badge-icon {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  flex-shrink: 0;
}
.ticker-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 8px #34d399, 0 0 16px rgba(52, 211, 153, 0.7);
  animation: pulseDot 1.5s infinite;
}
@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1.2); }
  50% { opacity: 0.3; transform: scale(0.8); }
}
.ticker-track {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  mask-image: linear-gradient(90deg, transparent 0%, black 2%, black 98%, transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, black 2%, black 98%, transparent 100%);
}
.ticker-text {
  display: inline-block;
  padding-left: 20px;
  animation: tickerScroll 35s linear infinite;
  color: #ecfdf5;
  font-weight: 500;
  will-change: transform;
  letter-spacing: 0.015em;
}
.ticker-time-tag {
  color: #67e8f9;
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(34, 211, 238, 0.5);
  padding: 2px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 12.5px;
  display: inline-block;
  white-space: nowrap;
  text-shadow: 0 0 6px rgba(34, 211, 238, 0.8), 0 0 16px rgba(6, 182, 212, 0.5);
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.2);
  letter-spacing: 0.02em;
}
.ticker-separator {
  color: #fde047;
  font-weight: 900;
  letter-spacing: 0.24em;
  margin: 0 14px;
  display: inline-block;
  text-shadow: 0 0 6px rgba(253, 224, 71, 0.95), 0 0 16px rgba(234, 179, 8, 0.7);
  filter: drop-shadow(0 0 4px rgba(250, 204, 21, 0.45));
}
.ticker-body {
  color: #f0fdf4;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-shadow: 0 0 5px rgba(240, 253, 244, 0.75), 0 0 14px rgba(52, 211, 153, 0.45), 0 0 24px rgba(16, 185, 129, 0.25);
}
.ticker-bar:hover .ticker-text,
.ticker-bar:active .ticker-text {
  animation-play-state: paused;
}
@keyframes tickerScroll { 
  0% { transform: translateX(100%); } 
  100% { transform: translateX(-100%); } 
}

/* ==========================================================================
   DAILY NOTICE HUB (Desktop: Lưới 3 cột + Bảng cô giáo; Mobile: 1 ô duy nhất vuốt/icon)
   ========================================================================== */
.daily-notice-hub {
  margin-bottom: 26px;
}

/* Thanh tabs 4 icon Mobile: Ẩn trên Desktop, hiện trên Mobile */
.hub-mobile-tabs {
  display: none;
}

/* Container chứa 4 thẻ: Mặc định Desktop hiển thị lưới 3 cột + Bảng dặn dò trải dài */
.hub-cards-slider {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

/* Kiểu dáng từng thẻ trong Hub */
.hub-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  position: relative;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
}
.hub-card:hover {
  transform: translateY(-2px);
  border-color: rgba(16, 185, 129, 0.3);
  box-shadow: var(--shadow-md);
}

/* Thẻ 3 (Lời dặn cô) trên Desktop trải dài toàn bộ 3 cột */
.hub-card.hub-card-teacher {
  grid-column: 1 / -1;
  margin-top: 4px;
}

.hub-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.hub-card-icon-box {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid transparent;
}
.hub-card-icon-box .stroke-icon {
  width: 19px;
  height: 19px;
}
.hub-card-icon-box.icon-blue {
  color: #60a5fa;
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.3);
}
.hub-card-icon-box.icon-amber {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.3);
}
.hub-card-icon-box.icon-emerald {
  color: #34d399;
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.3);
}
.hub-card-icon-box.icon-purple {
  color: #c084fc;
  background: rgba(168, 85, 247, 0.12);
  border-color: rgba(168, 85, 247, 0.3);
}

.hub-card-tag {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}
.hub-teacher-header-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.hub-teacher-name {
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 600;
}

.hub-card-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.45;
  margin-bottom: 6px;
}
.hub-card-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.55;
}

.hub-card-map-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  font-size: 12px;
  font-weight: 700;
  color: #60a5fa;
  text-decoration: none;
  transition: color 0.2s;
}
.hub-card-map-link:hover {
  text-decoration: underline;
  color: #93c5fd;
}
.hub-card-map-link .stroke-icon {
  width: 14px;
  height: 14px;
}

.hub-notice-box {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-size: 14px;
  line-height: 1.75;
  color: #ecfdf5;
  white-space: pre-line;
}

/* ==========================================================================
   KHU VỰC THỜI KHÓA BIỂU & TABS NGÀY (Nhịp thở sáng)
   ========================================================================== */
.schedule-section {
  margin-top: 30px;
}
.schedule-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 18px;
}
.schedule-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.01em;
}
.schedule-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.view-switch-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  padding: 4px;
  border-radius: 10px;
  gap: 4px;
}
.view-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.view-btn.active {
  background: var(--accent);
  color: #032017;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

/* Thanh Tab chọn Thứ trong tuần (Tối ưu 5 tab vừa vặn trên 1 màn hình) */
.day-tabs-bar {
  display: flex;
  gap: 8px;
  width: 100%;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 18px;
  scrollbar-width: none;
}
.day-tabs-bar::-webkit-scrollbar {
  display: none;
}
.day-tab-btn {
  flex: 1;
  min-width: 0;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 10px 4px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.day-tab-btn:hover {
  background: #112821;
  border-color: rgba(16, 185, 129, 0.4);
}
.day-tab-btn .day-name {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
  display: block;
  white-space: nowrap;
}
.day-tab-btn .day-date {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* 1. NGÀY THỰC TẾ HÔM NAY (XANH NGỌC PHÁT SÁNG EMERALD) */
.day-tab-btn[data-live-day="true"] {
  border-color: #10b981 !important;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.35);
  animation: liveTabPulse 2.4s infinite ease-in-out;
}
.day-tab-btn[data-live-day="true"] .day-name {
  color: #a7f3d0 !important;
}
.tab-badge-today {
  color: #34d399 !important;
  font-weight: 800;
  font-size: 11px;
}

@keyframes liveTabPulse {
  0%, 100% { border-color: rgba(16, 185, 129, 0.6); box-shadow: 0 0 10px rgba(16, 185, 129, 0.25); }
  50% { border-color: #34d399; box-shadow: 0 0 22px rgba(16, 185, 129, 0.55); }
}

/* 2. NGÀY ĐANG CHỌN XEM: NẾU TRÙNG HÔM NAY THÌ XANH NGỌC NỔI BẬT */
.day-tab-btn.active:not([data-diff-active="true"]) {
  background: rgba(16, 185, 129, 0.15);
  border-color: #10b981 !important;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
}

/* 3. NGÀY ĐANG CHỌN XEM: NẾU KHÁC HÔM NAY THÌ KHUNG VIỀN MÀU VÀNG NỔI BẬT (KHÔNG BỊ NHẦM LẪN) */
.day-tab-btn[data-diff-active="true"] {
  background: rgba(250, 204, 21, 0.08) !important;
  border-color: #facc15 !important;
  box-shadow: 0 0 18px rgba(250, 204, 21, 0.45) !important;
}
.day-tab-btn[data-diff-active="true"] .day-name {
  color: #fef08a !important;
}
.day-tab-btn[data-diff-active="true"] .day-date {
  color: #fde047 !important;
}
.tab-badge-viewing {
  color: #facc15 !important;
  font-weight: 800;
  font-size: 11px;
}

/* ==========================================================================
   GIAO DIỆN THỜI KHÓA BIỂU THEO NGÀY: XẾP NGANG TINH GỌN (HORIZONTAL COMPACT)
   ========================================================================== */
.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* THẺ LỜI DẶN BA MẸ NỔI BẬT ĐẶT TRƯỚC THỜI KHÓA BIỂU */
.parent-memo-prominent-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12) 0%, rgba(217, 119, 6, 0.06) 100%);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-left: 4px solid #f59e0b;
  border-radius: 10px;
  margin-bottom: 4px;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.1);
  transition: all 0.2s ease;
}
.parent-memo-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.parent-memo-card-title {
  font-size: 13px;
  font-weight: 700;
  color: #fbbf24;
  display: flex;
  align-items: center;
  gap: 6px;
}
.parent-memo-card-body {
  font-size: 13.5px;
  color: var(--text-main);
  line-height: 1.55;
  word-break: break-word;
}
.btn-quick-edit-parent-memo {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-quick-edit-parent-memo:hover {
  background: rgba(245, 158, 11, 0.3);
  color: #fef08a;
}

/* SMART ACCORDION: THU GỌN BUỔI ĐÃ HỌC XONG */
.session-heading-row.session-collapse-header {
  cursor: pointer;
  user-select: none;
  transition: background 0.2s ease, border-color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 8px;
}
.session-heading-row.session-collapse-header:hover {
  background: rgba(255, 255, 255, 0.05);
}
.session-collapse-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}
.session-done-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  color: #34d399;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 2px 7px;
  border-radius: 6px;
}
.collapse-chevron {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  color: var(--text-muted);
  flex-shrink: 0;
}
.session-section.is-collapsed .collapse-chevron {
  transform: rotate(-90deg);
}
.session-section.is-collapsed .session-body-collapsible {
  display: none !important;
}
.session-section.is-collapsed {
  opacity: 0.82;
  margin-bottom: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  border-radius: 10px;
  padding: 4px 8px;
}

/* Khung tiêu đề ngày tóm tắt */
.day-summary-header {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  box-shadow: var(--shadow-sm);
}
.day-summary-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.status-pill-today {
  background: rgba(16, 185, 129, 0.16);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: 999px;
  font-size: 11px;
  padding: 2px 8px;
  font-weight: 800;
}
.status-pill-viewing {
  background: rgba(250, 204, 21, 0.16);
  color: #facc15;
  border: 1px solid rgba(250, 204, 21, 0.4);
  border-radius: 999px;
  font-size: 11px;
  padding: 2px 8px;
  font-weight: 800;
}
.day-summary-notice {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
  padding: 8px 12px;
  border-radius: 6px;
  border-left: 3px solid var(--accent);
}
.day-summary-notice.teacher-live-notice {
  border-left: 3px solid #c084fc;
  background: rgba(168, 85, 247, 0.12);
  color: #f5f3ff;
  line-height: 1.6;
  font-size: 13.5px;
  padding: 10px 14px;
}
.teacher-notice-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}
.teacher-notice-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #e9d5ff;
  font-weight: 700;
  font-size: 13px;
}
.teacher-notice-meta {
  font-size: 11px;
  color: #c4b5fd;
  font-weight: 500;
  background: rgba(168, 85, 247, 0.2);
  padding: 2px 8px;
  border-radius: 12px;
}
.teacher-notice-body {
  color: #ffffff;
  line-height: 1.6;
  font-size: 13.5px;
  font-weight: 500;
}

/* Khối buổi học Sáng / Chiều */
.session-section {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}
.session-heading-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.session-title-tag {
  font-size: 12px;
  font-weight: 800;
  color: #93c5fd;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.session-time-range {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}

/* Lưới xếp ngang các tiết học */
.periods-row-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

/* Từng tiết học: Giao diện Liquid Glass cao cấp */
.period-compact-row {
  position: relative;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.015) 100%);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 16px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.16), 0 4px 16px rgba(0, 0, 0, 0.25);
  transition: all 0.25s ease;
}
.period-compact-row:hover {
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
  box-shadow: inset 0 1px 1px 0 rgba(255, 255, 255, 0.25), 0 8px 24px rgba(0, 0, 0, 0.35);
}

.period-badge-col {
  display: flex;
  flex-direction: column;
  min-width: 82px;
  flex-shrink: 0;
}
.period-num {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-main);
}
.period-hours {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 1px;
}

.period-main-col {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
}
.period-subj-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.3;
}
.period-subj-pill .stroke-icon {
  width: 16px;
  height: 16px;
}
.period-teacher-tag {
  font-size: 11px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 600;
}
.period-tag-cds {
  font-size: 11px;
  color: #38bdf8;
  font-weight: 700;
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.35);
  padding: 2px 7px;
  border-radius: 4px;
}
.period-extra-row {
  border-color: rgba(56, 189, 248, 0.28) !important;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.04), rgba(14, 165, 233, 0.02));
}

/* Dải hoạt động đầu giờ & Ra chơi & Bán trú */
.activity-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  margin-bottom: 10px;
  font-size: 12px;
  color: var(--text-muted);
  transition: all 0.3s ease;
  position: relative;
}
.activity-strip .activity-icon-box {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #34d399;
  flex-shrink: 0;
}
.activity-strip .activity-icon-box .stroke-icon {
  width: 16px;
  height: 16px;
}
.activity-strip .activity-label {
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
}
.activity-strip .activity-text {
  flex: 1;
}
.activity-strip .activity-status-col {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}
.activity-strip.strip-recess {
  background: rgba(245, 158, 11, 0.05);
  border-color: rgba(245, 158, 11, 0.25);
  color: #fbbf24;
}
.activity-strip.strip-boarding {
  background: rgba(20, 184, 166, 0.06);
  border: 1px solid rgba(20, 184, 166, 0.25);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 700;
  color: #2dd4bf;
}

/* Trạng thái đã qua của dải nghỉ/ra chơi */
.activity-strip[data-status="past"] {
  opacity: 0.45;
  filter: grayscale(0.3);
  border-style: solid;
  border-color: rgba(255, 255, 255, 0.04);
}

/* KHUNG NGHỈ / RA CHƠI / BÁN TRÚ ĐANG DIỄN RA (LIVE):
   Hiệu ứng Liquid Glass viền xoay tia sáng màu lạnh (Cool Ice Cyan & Emerald Băng Giá) */
.activity-strip[data-status="live"] {
  position: relative;
  overflow: hidden;
  border: 1px solid transparent !important;
  border-radius: 14px;
  background: transparent !important;
  box-shadow: 
    0 0 24px rgba(6, 182, 212, 0.4),
    0 0 46px rgba(16, 185, 129, 0.28),
    inset 0 1px 1px rgba(255, 255, 255, 0.35);
  animation: breakCardAura 3.5s infinite ease-in-out;
}

/* Tia sáng đèn xoay vô tận màu sắc lạnh: Cyan băng (#06b6d4), Sky Blue (#38bdf8), Ice Blue (#60a5fa), Emerald mát (#10b981) */
.activity-strip[data-status="live"]::before {
  content: '';
  position: absolute;
  top: -150%;
  left: -150%;
  width: 400%;
  height: 400%;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    transparent 20deg,
    #06b6d4 55deg,      /* Cyan ngọc băng */
    #38bdf8 80deg,      /* Sky blue */
    #60a5fa 95deg,      /* Ice blue */
    transparent 135deg,
    transparent 200deg,
    #10b981 235deg,     /* Ngọc lục bảo mát */
    #34d399 260deg,     /* Mint pastel */
    #2dd4bf 285deg,     /* Teal mát mẻ */
    transparent 320deg,
    transparent 360deg
  );
  animation: rotateLiquidBeam 3.8s linear infinite;
  pointer-events: none;
  z-index: 1;
}

/* Lớp kính Liquid Glass bên trong cách mép 1.8px cho viền sáng chạy qua */
.activity-strip[data-status="live"]::after {
  content: '';
  position: absolute;
  inset: 1.8px;
  background: linear-gradient(135deg, rgba(6, 24, 34, 0.94) 0%, rgba(3, 16, 23, 0.97) 100%);
  backdrop-filter: blur(20px) saturate(200%);
  -webkit-backdrop-filter: blur(20px) saturate(200%);
  border-radius: 12.2px;
  z-index: 2;
  pointer-events: none;
  box-shadow: inset 0 1px 1.5px rgba(255, 255, 255, 0.3), inset 0 -1px 2px rgba(0, 0, 0, 0.6);
}

/* Toàn bộ nội dung chữ, icon, tag nằm trên cùng */
.activity-strip[data-status="live"] > * {
  position: relative;
  z-index: 3;
}

.activity-strip[data-status="live"] .activity-label {
  color: #38bdf8 !important;
  font-weight: 800;
  text-shadow: 0 0 10px rgba(56, 189, 248, 0.6);
}

.activity-strip[data-status="live"] .activity-text {
  color: #f0fdf4 !important;
  font-weight: 700;
}

.activity-strip[data-status="live"] .activity-icon-box {
  color: #22d3ee !important;
  filter: drop-shadow(0 0 6px rgba(34, 211, 238, 0.7));
}

@keyframes breakCardAura {
  0%, 100% {
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.35), 0 0 38px rgba(16, 185, 129, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.35);
  }
  50% {
    box-shadow: 0 0 30px rgba(6, 182, 212, 0.6), 0 0 54px rgba(16, 185, 129, 0.45), inset 0 1px 1.5px rgba(255, 255, 255, 0.5);
  }
}

/* Badge trạng thái dải nghỉ / ra chơi (màu sắc lạnh mát) */
.status-badge-break-live {
  background: linear-gradient(90deg, #0284c7 0%, #0d9488 100%) !important;
  color: #ffffff !important;
  font-weight: 800;
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.6), 0 0 20px rgba(16, 185, 129, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.45);
  animation: liveBadgePulse 1.8s infinite ease-in-out;
}

/* Thích ứng Theme sáng (Light) & Theme hồng (Princess) */
body[data-theme="light"] .activity-strip[data-status="live"]::after {
  background: linear-gradient(135deg, rgba(236, 254, 255, 0.96) 0%, rgba(207, 250, 254, 0.96) 100%);
  box-shadow: inset 0 1px 1.5px rgba(255, 255, 255, 0.8), 0 2px 8px rgba(0, 0, 0, 0.05);
}
body[data-theme="light"] .activity-strip[data-status="live"] .activity-label {
  color: #0284c7 !important;
  text-shadow: none;
}
body[data-theme="light"] .activity-strip[data-status="live"] .activity-text {
  color: #0f172a !important;
}
body[data-theme="light"] .status-badge-break-live {
  background: linear-gradient(90deg, #0284c7 0%, #0d9488 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 10px rgba(2, 132, 199, 0.4);
}

body[data-theme="princess"] .activity-strip[data-status="live"]::after {
  background: linear-gradient(135deg, rgba(240, 253, 250, 0.96) 0%, rgba(204, 251, 241, 0.96) 100%);
}
body[data-theme="princess"] .activity-strip[data-status="live"] .activity-label {
  color: #0f766e !important;
  text-shadow: none;
}
body[data-theme="princess"] .activity-strip[data-status="live"] .activity-text {
  color: #134e4a !important;
}


/* ==========================================================================
   TRẠNG THÁI TIẾT HỌC: LIQUID GLASS & VIỀN CHẠY LINE ĐÈN CAM - TÍM
   ========================================================================== */
.period-compact-row[data-status="past"] {
  opacity: 0.45;
  filter: grayscale(0.3);
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.04);
  box-shadow: none;
}
.period-compact-row[data-status="past"]:hover {
  opacity: 0.85;
}

/* Tiết sắp học: Liquid Glass thanh thoát, viền kính phản quang */
.period-compact-row[data-status="upcoming"] {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.02) 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 1.5px rgba(255, 255, 255, 0.2), 0 4px 18px rgba(0, 0, 0, 0.25);
}
.period-compact-row[data-status="upcoming"]:hover {
  border-color: rgba(192, 132, 252, 0.45);
  box-shadow: inset 0 1px 1.5px rgba(255, 255, 255, 0.3), 0 0 20px rgba(168, 85, 247, 0.22);
}

/* TIẾT ĐANG HỌC (LIVE): LIQUID GLASS VỚI VIỀN CHẠY LINE ĐÈN CAM - TÍM NEON */
.period-compact-row[data-status="live"],
.extra-period-row[data-status="live"] {
  position: relative;
  overflow: hidden;
  border: 1px solid transparent !important;
  border-radius: 16px;
  background: transparent !important;
  box-shadow: 
    0 0 26px rgba(249, 115, 22, 0.38),
    0 0 48px rgba(168, 85, 247, 0.28),
    inset 0 1px 1px rgba(255, 255, 255, 0.32);
  animation: liveCardAura 3.5s infinite ease-in-out;
}

/* Tia sáng đèn xoay vô tận: Cam - Tím neon chạy vòng quanh chu vi thẻ */
.period-compact-row[data-status="live"]::before,
.extra-period-row[data-status="live"]::before {
  content: '';
  position: absolute;
  top: -150%;
  left: -150%;
  width: 400%;
  height: 400%;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    transparent 20deg,
    #a855f7 55deg,      /* Tím neon */
    #c084fc 80deg,
    #e879f9 95deg,
    transparent 135deg,
    transparent 200deg,
    #f97316 235deg,     /* Cam rực rỡ */
    #fb923c 260deg,
    #facc15 285deg,     /* Ánh vàng cam */
    transparent 320deg,
    transparent 360deg
  );
  animation: rotateLiquidBeam 3.8s linear infinite;
  pointer-events: none;
  z-index: 1;
}

/* Lớp kính Liquid Glass bên trong: Cách mép 1.8px cho viền sáng chạy qua */
.period-compact-row[data-status="live"]::after,
.extra-period-row[data-status="live"]::after {
  content: '';
  position: absolute;
  inset: 1.8px;
  background: linear-gradient(135deg, rgba(14, 21, 32, 0.92) 0%, rgba(8, 14, 20, 0.96) 100%);
  backdrop-filter: blur(20px) saturate(200%);
  -webkit-backdrop-filter: blur(20px) saturate(200%);
  border-radius: 14.2px;
  z-index: 2;
  pointer-events: none;
  box-shadow: inset 0 1px 1.5px rgba(255, 255, 255, 0.28), inset 0 -1px 2px rgba(0, 0, 0, 0.6);
}

/* Toàn bộ nội dung chữ, icon, tag nằm trên cùng */
.period-compact-row[data-status="live"] > *,
.extra-period-row[data-status="live"] > * {
  position: relative;
  z-index: 3;
}

.period-compact-row[data-status="live"] .period-num,
.extra-period-row[data-status="live"] .extra-period-num {
  color: #fb923c !important;
  border-color: rgba(249, 115, 22, 0.5) !important;
  background: rgba(249, 115, 22, 0.2) !important;
  text-shadow: 0 0 10px rgba(249, 115, 22, 0.5);
}

.period-status-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 12px;
  letter-spacing: 0.03em;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.status-badge-done {
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.05);
}
.status-badge-live {
  background: linear-gradient(90deg, #f97316 0%, #a855f7 100%) !important;
  color: #ffffff !important;
  font-weight: 800;
  box-shadow: 0 0 12px rgba(249, 115, 22, 0.6), 0 0 20px rgba(168, 85, 247, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.35);
  animation: liveBadgePulse 1.8s infinite ease-in-out;
}

@keyframes rotateLiquidBeam {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes liveCardAura {
  0%, 100% {
    box-shadow: 0 0 22px rgba(249, 115, 22, 0.35), 0 0 40px rgba(168, 85, 247, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.3);
  }
  50% {
    box-shadow: 0 0 32px rgba(249, 115, 22, 0.55), 0 0 55px rgba(168, 85, 247, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.4);
  }
}
@keyframes liveBadgePulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.04); opacity: 0.92; }
}

/* ==========================================================================
   LƯỚI MA TRẬN CẢ TUẦN (Weekly Matrix - Tối ưu có con trỏ ngày hôm nay)
   ========================================================================== */
.weekly-grid-container {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  box-shadow: var(--shadow-sm);
  scrollbar-width: thin;
}
.timetable-table {
  width: 100%;
  min-width: 580px;
  border-collapse: collapse;
  text-align: center;
  font-size: 12px;
}
.timetable-table th, .timetable-table td {
  padding: 8px 6px;
  border: 1px solid var(--line);
}
.timetable-table th {
  background: #091713;
  color: #a7f3d0;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.03em;
  vertical-align: bottom;
  position: relative;
}
.timetable-table th.th-slot-col {
  width: 48px;
  font-size: 11px;
  color: var(--text-muted);
}
.th-day-title {
  font-size: 13px;
  font-weight: 800;
}

/* Con trỏ ngày hôm nay trên tiêu đề cột */
.today-pointer-badge {
  font-size: 9px;
  font-weight: 900;
  color: #10b981;
  background: rgba(16, 185, 129, 0.2);
  border-radius: 4px;
  padding: 2px 4px;
  margin-bottom: 3px;
  letter-spacing: 0.05em;
  display: inline-block;
  animation: pointerPulse 1.8s infinite ease-in-out;
}
@keyframes pointerPulse {
  0%, 100% { transform: translateY(0); opacity: 0.9; }
  50% { transform: translateY(-2px); opacity: 1; }
}

.timetable-table th.col-today {
  background: #113125 !important;
  color: #34d399 !important;
  border-top: 3px solid #10b981 !important;
  border-left: 2px solid rgba(16, 185, 129, 0.4) !important;
  border-right: 2px solid rgba(16, 185, 129, 0.4) !important;
}
.timetable-table td.cell-today {
  background: rgba(16, 185, 129, 0.08) !important;
  border-left: 2px solid rgba(16, 185, 129, 0.4) !important;
  border-right: 2px solid rgba(16, 185, 129, 0.4) !important;
}

.cell-slot-col {
  text-align: center;
  padding: 6px 2px;
}
.cell-slot-col strong {
  display: block;
  font-size: 12px;
  color: var(--text-main);
}
.cell-slot-col small {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
}

.matrix-subject-pill {
  padding: 5px 8px;
  border-radius: 7px;
  font-weight: 700;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  line-height: 1.25;
}
.matrix-subject-pill .stroke-icon {
  width: 14px;
  height: 14px;
}

.timetable-table .recess-row {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
}

/* ==========================================================================
   FOOTER & MÔ PHỎNG (Simulation Controls)
   ========================================================================== */
.app-footer {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
}
.sim-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  background: rgba(255, 255, 255, 0.04);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  display: inline-flex;
}
.sim-label {
  font-size: 12px;
  font-weight: 700;
  color: #a7f3d0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.sim-select {
  background: #0d1e18;
  border: 1px solid var(--line-strong);
  color: #ffffff;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-family: inherit;
  outline: none;
}
.sim-select:focus {
  border-color: var(--primary);
}

/* ==========================================================================
   BANNER MÔ PHỎNG KIỂM THỬ (CHỈ HIỆN KHI CÓ ?sim=...)
   ========================================================================== */
.sim-active-banner {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 99999;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1.5px solid rgba(245, 158, 11, 0.6);
  box-shadow: 0 12px 32px -4px rgba(0, 0, 0, 0.65), 0 0 20px rgba(245, 158, 11, 0.35);
  color: #fef3c7;
  padding: 8px 18px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  font-weight: 500;
  max-width: 90vw;
  box-sizing: border-box;
  animation: slideUpSimBanner 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes slideUpSimBanner {
  from { opacity: 0; transform: translate(-50%, 20px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
.sim-active-banner strong {
  color: #fbbf24;
}
.sim-active-exit-btn {
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid rgba(245, 158, 11, 0.5);
  color: #fde68a;
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.sim-active-exit-btn:hover {
  background: #f59e0b;
  color: #0f172a;
}

/* ==========================================================================
   RESPONSIVE (Điện thoại di động & Máy tính bảng iPad)
   ========================================================================== */

/* iPad & Máy tính bảng (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  .container { max-width: 95%; padding: 24px 20px; }
  .hero-pickup-card { padding: 28px 30px; }
  .hero-body-grid { grid-template-columns: auto 1fr auto; gap: 20px; }
  .hero-time-val { font-size: 52px; }
  .hero-cd-val { font-size: 38px; }
  .quick-cards-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .period-card { grid-template-columns: 160px 1fr auto; padding: 18px 20px; }
  .period-time-range { font-size: 16px; }
  .subject-pill { font-size: 16px; }
}

/* Điện thoại di động (< 768px) */
@media (max-width: 768px) {
  .container { padding: 16px 14px; }
  
  /* Header trên điện thoại */
  .app-header { gap: 10px; margin-bottom: 16px; }
  .app-header-top { flex-direction: column; align-items: flex-start; gap: 8px; }
  .header-top-badges { align-self: flex-end; margin-top: -4px; }
  .header-actions { justify-content: flex-start; gap: 6px; }
  .school-meta { gap: 10px; }
  .school-meta h1 { font-size: 19px; }
  .school-meta p { font-size: 12px; }
  .trial-badge-chip { padding: 4px 10px; font-size: 11px; }
  .btn-guide-link { padding: 4px 10px; font-size: 11px; }

  /* Hero Card đếm ngược trên điện thoại */
  .hero-pickup-card { padding: 22px 18px; border-radius: var(--radius-md); }
  .hero-top-row { gap: 10px; margin-bottom: 16px; padding-bottom: 10px; }
  .hero-kicker { font-size: 13px; }
  .hero-body-grid { grid-template-columns: 1fr; gap: 16px; }
  
  .hero-time-box {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: baseline;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 10px;
  }
  .hero-time-val { font-size: 48px; }
  
  .hero-countdown-box { padding: 16px 18px; }
  .hero-cd-val { font-size: 34px; }
  .hero-cd-sub { font-size: 11px; }
  
  .hero-gate-badge {
    flex-direction: row;
    justify-content: space-between;
    padding: 14px 18px;
    text-align: left;
  }
  .hero-gate-badge .gate-name { font-size: 18px; margin: 0; }
  
  /* Daily Notice Hub trên Mobile (< 768px): Chỉ hiện 1 ô duy nhất + Thanh 4 icon tabs chuyển đổi */
  .hub-mobile-tabs {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding: 2px 1px;
  }
  .hub-mobile-tabs::-webkit-scrollbar {
    display: none;
  }
  .hub-tab-btn {
    flex: 1;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 8px 4px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--line);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
  .hub-tab-btn .hub-tab-icon {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .hub-tab-btn .hub-tab-icon .stroke-icon {
    width: 14px;
    height: 14px;
  }
  .hub-tab-btn .hub-tab-label {
    font-size: 11px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .hub-tab-btn.active {
    background: rgba(16, 185, 129, 0.16);
    border-color: #10b981;
    color: #6ee7b7;
    box-shadow: 0 0 14px rgba(16, 185, 129, 0.35);
  }

  /* Container trượt ngang: Chỉ hiện 1 ô duy nhất, vuốt qua lại mượt mà */
  .hub-cards-slider {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 12px;
    margin-bottom: 22px;
    padding-bottom: 4px;
  }
  .hub-cards-slider::-webkit-scrollbar {
    display: none;
  }
  .hub-card {
    flex: 0 0 100%;
    min-width: 100%;
    max-width: 100%;
    scroll-snap-align: start;
    box-sizing: border-box;
    padding: 16px 18px;
  }
  .hub-card.hub-card-teacher {
    margin-top: 0;
  }

  /* Freeze cố định cột TIẾT và Giờ học khi cuộn ngang ma trận tuần trên Mobile */
  .timetable-table {
    border-collapse: separate !important;
    border-spacing: 0 !important;
  }
  .timetable-table th, .timetable-table td {
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }
  .timetable-table th.th-slot-col {
    position: sticky;
    left: 0;
    z-index: 12;
    min-width: 52px;
    width: 52px;
    max-width: 52px;
    background: #091713;
    box-shadow: 3px 0 10px rgba(0, 0, 0, 0.6);
    border-right: 2px solid rgba(16, 185, 129, 0.4);
  }
  .timetable-table td.cell-slot-col {
    position: sticky;
    left: 0;
    z-index: 9;
    min-width: 52px;
    width: 52px;
    max-width: 52px;
    background: #0d1e18;
    box-shadow: 3px 0 10px rgba(0, 0, 0, 0.6);
    border-right: 2px solid rgba(16, 185, 129, 0.4);
  }
  /* Nhãn giải lao bám theo màn hình */
  .recess-sticky-label {
    position: sticky;
    left: 58px;
    display: inline-block;
    font-weight: 700;
    white-space: nowrap;
  }
  
  /* Tabs ngày trong tuần trên điện thoại: vừa vặn 100% chiều rộng */
  .day-tabs-bar {
    gap: 4px;
    padding-bottom: 4px;
    margin-bottom: 14px;
  }
  .day-tab-btn {
    min-width: 0;
    padding: 8px 3px;
    border-radius: 8px;
  }
  .day-tab-btn .day-name {
    font-size: 12px;
  }
  .day-tab-btn .day-date {
    font-size: 10px;
  }
  
  /* Khối tiết học ngang trên điện thoại */
  .periods-row-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .period-compact-row {
    padding: 8px 10px;
    gap: 8px;
  }
  .period-badge-col {
    min-width: 72px;
  }
  .period-num {
    font-size: 12px;
  }
  .period-hours {
    font-size: 10px;
  }
  .period-subj-pill {
    font-size: 13px;
    padding: 4px 8px;
  }
}

/* ==========================================================================
   BỘ 4 GIAO DIỆN THEMEFOREST (Dark Unfold · Light Aigocy · Princess · Sunshine)
   Tối ưu UX/UI: Chấm màu tối giản, tương phản cao tuyệt đối trên nền sáng
   ========================================================================== */

/* Thanh chuyển nhanh Theme trên Header */
.theme-quick-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  padding: 4px;
  border-radius: 20px;
}
.theme-pill-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.theme-pill-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
}
.theme-pill-btn.active {
  background: var(--accent);
  color: #031811;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Chấm màu tối giản thay cho Icon emoji */
.theme-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.dot-dark { background: #10b981; box-shadow: 0 0 6px rgba(16, 185, 129, 0.7); }
.dot-light { background: #2563eb; box-shadow: 0 0 6px rgba(37, 99, 235, 0.7); }
.dot-princess { background: #ec4899; box-shadow: 0 0 6px rgba(236, 72, 153, 0.7); }
.dot-sunshine { background: #facc15; box-shadow: 0 0 6px rgba(250, 204, 21, 0.7); }

/* Thanh ghi chú ngày (Day Notice Bar) */
.day-notice-bar {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-left: 4px solid var(--accent);
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 13px;
  color: #a7f3d0;
  line-height: 1.5;
}
.day-notice-bar strong {
  color: #ffffff;
}

/* --------------------------------------------------------------------------
   1. LIGHT THEME: Harold Modern Light (Tương phản cao chuẩn Harold Design)
   Reference: https://themesdesign.in/harold/layout/index.html
   Palette: Deep Navy Slate #1c2f50 (text), Signature Teal #2fb4ae (brand accent), Coral #ff7f51
   -------------------------------------------------------------------------- */
body[data-theme="light"] {
  --text-main: #1c2f50;       /* Harold Deep Navy Slate - tương phản tối đa trên nền sáng */
  --text-muted: #475569;      /* Slate trung tính rõ ràng */
  --text-dim: #64748b;
  --card-bg: #ffffff;
  --card-border: #e2e8f0;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --shadow-sm: 0px 3px 10px 0px rgba(28, 47, 80, 0.06);
  --shadow-md: 0px 8px 24px 0px rgba(28, 47, 80, 0.10);
  --accent: #2fb4ae;          /* Harold Signature Teal Accent */
}

/* Hero Card trên Theme Sáng - Đậm chất Harold Dark Navy với Teal Countdown */
body[data-theme="light"] .hero-pickup-card {
  background: linear-gradient(135deg, #162540 0%, #1c2f50 55%, #253e66 100%) !important;
  border: 1.5px solid rgba(47, 180, 174, 0.35);
  box-shadow: 0 12px 36px rgba(28, 47, 80, 0.22);
}
body[data-theme="light"] .hero-pickup-card .hero-time-label,
body[data-theme="light"] .hero-time-label {
  color: rgba(255, 255, 255, 0.92) !important;
}
body[data-theme="light"] .hero-pickup-card #hero-school-year,
body[data-theme="light"] .hero-pickup-card .hero-subtext span {
  color: #e6f7f6 !important;
}
body[data-theme="light"] .hero-pickup-card #hero-cd-val {
  color: #ffffff !important;
}
body[data-theme="light"] .hero-gate-badge {
  background: rgba(255, 255, 255, 0.12) !important;
  border-color: rgba(47, 180, 174, 0.5) !important;
}
body[data-theme="light"] .hero-gate-badge .gate-label { color: #a4e4e0 !important; }
body[data-theme="light"] .hero-gate-badge .gate-name { color: #ffffff !important; }
body[data-theme="light"] .hero-gate-badge .gate-street { color: #e6f7f6 !important; }

body[data-theme="light"] .theme-quick-bar { background: #ffffff; border-color: #e2e8f0; box-shadow: 0 2px 8px rgba(28, 47, 80, 0.05); }
body[data-theme="light"] .theme-pill-btn { color: #475569; font-weight: 600; }
body[data-theme="light"] .theme-pill-btn.active { background: #2fb4ae; color: #ffffff; }
body[data-theme="light"] .school-meta h1 { color: #1c2f50 !important; font-weight: 800; }
body[data-theme="light"] .school-meta p { color: #475569 !important; }
body[data-theme="light"] .school-meta h1 .badge-class { background: #e6f7f6; color: #167c77; border-color: #a4e4e0; font-weight: 700; }
body[data-theme="light"] .btn-admin { background: #ffffff; color: #1c2f50; border-color: #e2e8f0; }
body[data-theme="light"] .btn-admin:hover { background: #e6f7f6; color: #167c77; border-color: #2fb4ae; }

/* Ticker Marquee - Harold High Contrast (Khắc phục triệt để lỗi mờ / chìm màu trên nền sáng) */
body[data-theme="light"] .ticker-bar {
  background: #ffffff;
  color: #1c2f50;
  border: 1.5px solid #2fb4ae;
  box-shadow: 0 4px 16px rgba(47, 180, 174, 0.12), 0 1px 3px rgba(28, 47, 80, 0.05);
}
body[data-theme="light"] .ticker-badge {
  background: #2fb4ae;
  color: #ffffff;
  border: 1px solid #2fb4ae;
  box-shadow: 0 2px 8px rgba(47, 180, 174, 0.35);
  font-weight: 800;
}
body[data-theme="light"] .ticker-badge-icon {
  stroke: #ffffff;
}
body[data-theme="light"] .ticker-dot {
  background: #ffffff;
  box-shadow: 0 0 6px #ffffff;
}
body[data-theme="light"] .ticker-text {
  color: #1c2f50 !important;
  font-weight: 600;
}
body[data-theme="light"] .ticker-time-tag {
  color: #167c77 !important;
  background: #e6f7f6 !important;
  border: 1px solid #a4e4e0 !important;
  font-weight: 700 !important;
  text-shadow: none !important;
  box-shadow: none !important;
}
body[data-theme="light"] .ticker-separator {
  color: #2fb4ae !important;
  text-shadow: none !important;
  filter: none !important;
}
body[data-theme="light"] .ticker-body {
  color: #1c2f50 !important;
  font-weight: 700 !important;
  text-shadow: none !important;
}
body[data-theme="light"] .ticker-parent-tag {
  background: #fff7ed !important;
  color: #c2410c !important;
  border: 1px solid #fed7aa !important;
}

/* 3 Thẻ chuẩn bị nhanh: Trang phục, Đồ dùng, Cổng đón */
body[data-theme="light"] .quick-card {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  box-shadow: 0 3px 12px rgba(28, 47, 80, 0.05);
}
body[data-theme="light"] .quick-card-icon {
  background: #e6f7f6;
  border-color: #a4e4e0;
  color: #167c77;
}
body[data-theme="light"] .quick-card-content h3 {
  color: #475569 !important;
  font-weight: 700;
  letter-spacing: 0.04em;
}
body[data-theme="light"] .quick-card-content p {
  color: #1c2f50 !important;
  font-weight: 700;
}
body[data-theme="light"] .gate-badge-val {
  color: #2fb4ae !important;
}

/* Bảng dặn dò của cô */
body[data-theme="light"] .notice-board-card {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  box-shadow: 0 3px 12px rgba(28, 47, 80, 0.05);
}
body[data-theme="light"] .teacher-info h3 {
  color: #1c2f50 !important;
  font-weight: 800;
}
body[data-theme="light"] .teacher-info p {
  color: #475569 !important;
}
body[data-theme="light"] .teacher-avatar {
  background: #e6f7f6;
  color: #167c77;
  border-color: #a4e4e0;
}
body[data-theme="light"] .notice-time-tag {
  background: #e6f7f6;
  color: #167c77;
  border-color: #a4e4e0;
  font-weight: 700;
}
body[data-theme="light"] .notice-message-box {
  background: #f8fafc;
  color: #1c2f50 !important;
  border-color: #e2e8f0;
  font-weight: 600;
}

/* Khu vực Thời khóa biểu & Tab ngày (Chuẩn Harold Teal & Deep Navy, loại bỏ màu vàng nhạt mờ) */
body[data-theme="light"] .schedule-title {
  color: #1c2f50 !important;
  font-weight: 800;
}
body[data-theme="light"] .schedule-sub {
  color: #475569 !important;
}
body[data-theme="light"] .view-switch-tabs {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  box-shadow: 0 2px 8px rgba(28, 47, 80, 0.04);
}
body[data-theme="light"] .view-btn {
  color: #475569;
  font-weight: 600;
}
body[data-theme="light"] .view-btn.active {
  background: #2fb4ae;
  color: #ffffff;
  font-weight: 700;
}

body[data-theme="light"] .day-tab-btn {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  color: #1c2f50;
  box-shadow: 0 2px 8px rgba(28, 47, 80, 0.04);
}
body[data-theme="light"] .day-tab-btn .day-name {
  color: #1c2f50 !important;
  font-weight: 700;
}
body[data-theme="light"] .day-tab-btn .day-date {
  color: #64748b !important;
  font-weight: 600;
}
body[data-theme="light"] .day-tab-btn:hover {
  background: #f8fafc;
  border-color: #2fb4ae;
}
body[data-theme="light"] .day-tab-btn.active,
body[data-theme="light"] .day-tab-btn[data-diff-active="true"] {
  background: #2fb4ae !important;
  border-color: #2fb4ae !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(47, 180, 174, 0.35) !important;
}
body[data-theme="light"] .day-tab-btn.active .day-name,
body[data-theme="light"] .day-tab-btn[data-diff-active="true"] .day-name {
  color: #ffffff !important;
}
body[data-theme="light"] .day-tab-btn.active .day-date,
body[data-theme="light"] .day-tab-btn[data-diff-active="true"] .day-date {
  color: #e6f7f6 !important;
}
body[data-theme="light"] .day-tab-btn[data-live-day="true"] {
  border-color: #2fb4ae !important;
  box-shadow: 0 0 14px rgba(47, 180, 174, 0.3) !important;
}
body[data-theme="light"] .period-compact-row {
  background: rgba(255, 255, 255, 0.92);
  border-color: #e2e8f0;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
}
body[data-theme="light"] .period-compact-row[data-status="live"],
body[data-theme="light"] .extra-period-row[data-status="live"] {
  border: 1.5px solid transparent !important;
  box-shadow: 
    0 0 24px rgba(37, 99, 235, 0.32),
    0 0 42px rgba(16, 185, 129, 0.22),
    0 4px 18px rgba(15, 23, 42, 0.08) !important;
}
/* Viền chạy tia sáng xoay vô tận (Liquid Beam) rực rỡ trên nền sáng */
body[data-theme="light"] .period-compact-row[data-status="live"]::before,
body[data-theme="light"] .extra-period-row[data-status="live"]::before {
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    transparent 20deg,
    #2563eb 55deg,      /* Xanh dương công nghệ */
    #38bdf8 80deg,      /* Sky blue tươi sáng */
    #06b6d4 95deg,      /* Cyan ngọc bích */
    transparent 135deg,
    transparent 200deg,
    #10b981 235deg,     /* Ngọc lục bảo */
    #f59e0b 265deg,     /* Vàng cam hổ phách */
    #ea580c 285deg,     /* Cam rực rỡ */
    transparent 320deg,
    transparent 360deg
  ) !important;
  animation: rotateLiquidBeam 3.6s linear infinite !important;
}
body[data-theme="light"] .period-compact-row[data-status="live"]::after,
body[data-theme="light"] .extra-period-row[data-status="live"]::after {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.97) 0%, rgba(248, 250, 252, 0.98) 100%) !important;
  box-shadow: inset 0 1px 1.5px rgba(255, 255, 255, 0.9), 0 2px 10px rgba(0, 0, 0, 0.06);
}
body[data-theme="light"] .period-compact-row[data-status="live"] .period-num,
body[data-theme="light"] .extra-period-row[data-status="live"] .extra-period-num {
  color: #ea580c !important;
  text-shadow: none !important;
}
body[data-theme="light"] .period-compact-row[data-status="live"] .period-hours {
  color: #475569 !important;
}
body[data-theme="light"] .activity-strip[data-status="live"]::before {
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    transparent 20deg,
    #0284c7 55deg,
    #06b6d4 80deg,
    #3b82f6 95deg,
    transparent 135deg,
    transparent 200deg,
    #0d9488 235deg,
    #10b981 265deg,
    #34d399 285deg,
    transparent 320deg,
    transparent 360deg
  ) !important;
  animation: rotateLiquidBeam 3.6s linear infinite !important;
}
/* Dải hoạt động & Ra chơi trên Theme Sáng - Tương phản cao ấm áp, tuyệt đối không bị chìm chữ */
body[data-theme="light"] .activity-strip {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #475569;
}
body[data-theme="light"] .activity-strip .activity-label {
  color: #1c2f50 !important;
  font-weight: 700;
}
body[data-theme="light"] .activity-strip .activity-text {
  color: #1c2f50 !important;
  font-weight: 600;
}
body[data-theme="light"] .activity-strip.strip-recess {
  background: #fff7ed !important;
  border: 1px solid #fed7aa !important;
  color: #9a3412 !important;
}
body[data-theme="light"] .activity-strip.strip-recess .activity-label {
  color: #c2410c !important;
  font-weight: 700;
}
body[data-theme="light"] .activity-strip.strip-recess .activity-text {
  color: #9a3412 !important;
  font-weight: 600;
}
body[data-theme="light"] .activity-strip.strip-recess .activity-icon-box {
  color: #ea580c !important;
}
body[data-theme="light"] .activity-strip.strip-boarding {
  background: #e6f7f6 !important;
  border: 1px solid #a4e4e0 !important;
  color: #0f766e !important;
}
body[data-theme="light"] .activity-strip.strip-boarding .activity-label,
body[data-theme="light"] .activity-strip.strip-boarding .activity-text {
  color: #0f766e !important;
  font-weight: 700;
}

body[data-theme="light"] .hub-tab-btn {
  background: #ffffff;
  border-color: #e2e8f0;
  color: #475569;
}
body[data-theme="light"] .hub-tab-btn.active {
  background: #e6f7f6;
  border-color: #2fb4ae;
  color: #167c77;
  box-shadow: 0 0 12px rgba(47, 180, 174, 0.25);
}
body[data-theme="light"] .hub-card {
  background: #ffffff;
  border-color: #e2e8f0;
}
body[data-theme="light"] .day-summary-header { background: #ffffff; border-color: #e2e8f0; }
body[data-theme="light"] .session-section { background: #ffffff; border-color: #e2e8f0; }

/* Thanh ghi chú ngày - Harold Emerald / Teal */
body[data-theme="light"] .day-notice-bar {
  background: #f0fdf9;
  border-color: #a4e4e0;
  border-left: 4px solid #2fb4ae;
  color: #167c77 !important;
  font-weight: 600;
}
body[data-theme="light"] .day-notice-bar strong { color: #0f766e !important; font-weight: 800; }

/* Thẻ tiết học */
body[data-theme="light"] .period-card { background: #ffffff; border-color: #e2e8f0; }
body[data-theme="light"] .period-time-range { color: #1c2f50 !important; font-weight: 800; }
body[data-theme="light"] .period-index { color: #475569 !important; font-weight: 600; }
body[data-theme="light"] .teacher-badge { background: #e6f7f6; color: #167c77; border-color: #a4e4e0; }

body[data-theme="light"] .period-card[data-status="past"] {
  background: #f8fafc !important;
  border-color: #e2e8f0 !important;
  opacity: 1 !important;
}
body[data-theme="light"] .period-card[data-status="past"] .period-time-range { color: #475569 !important; }
body[data-theme="light"] .period-card[data-status="past"] .period-index { color: #64748b !important; }
body[data-theme="light"] .period-card[data-status="past"] .status-badge-done {
  color: #475569 !important;
  background: #e2e8f0 !important;
  border: 1px solid #cbd5e1;
  font-weight: 700;
}

body[data-theme="light"] .period-card[data-status="live"] {
  background: #e6f7f6 !important;
  border: 2px solid #2fb4ae !important;
  box-shadow: 0 0 25px rgba(47, 180, 174, 0.25);
}
body[data-theme="light"] .period-card[data-status="live"] .period-time-range { color: #167c77 !important; }
body[data-theme="light"] .period-card[data-status="live"] .period-status-badge.status-badge-live {
  background: #2fb4ae !important;
  color: #ffffff !important;
}

/* Mô phỏng & Footer */
body[data-theme="light"] .sim-controls { background: #ffffff; border-color: #e2e8f0; }
body[data-theme="light"] .sim-label { color: #1c2f50 !important; font-weight: 700; }
body[data-theme="light"] .sim-select { background: #ffffff !important; color: #1c2f50 !important; border-color: #cbd5e1 !important; }
body[data-theme="light"] .app-footer { color: #475569 !important; border-top-color: #e2e8f0; }

/* Ma trận tuần */
body[data-theme="light"] .timetable-table th { background: #f1f5f9; color: #1c2f50; border-color: #cbd5e1; }
body[data-theme="light"] .timetable-table td { border-color: #e2e8f0; color: #1c2f50; }
body[data-theme="light"] .timetable-table th.col-today { background: #e6f7f6; color: #167c77; border-color: #2fb4ae; }
body[data-theme="light"] .timetable-table td.cell-today { background: #f0fdf9; }
body[data-theme="light"] .timetable-table th.th-slot-col {
  background: #f1f5f9 !important;
  color: #1c2f50 !important;
  box-shadow: 3px 0 8px rgba(28, 47, 80, 0.06) !important;
  border-right: 2px solid #cbd5e1 !important;
}
body[data-theme="light"] .timetable-table td.cell-slot-col {
  background: #ffffff !important;
  color: #1c2f50 !important;
  box-shadow: 3px 0 8px rgba(28, 47, 80, 0.06) !important;
  border-right: 2px solid #cbd5e1 !important;
}

/* Quản lý tài khoản trong modal Thiết lập (Khách & Phụ huynh) */
.settings-account-card.logged-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 14px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 10px;
  transition: all 0.2s ease;
}
.btn-settings-logout:hover {
  background: #ef4444 !important;
  color: #ffffff !important;
}
body[data-theme="light"] .settings-account-card.logged-in {
  background: #f0fdf9 !important;
  border: 1.5px solid #2fb4ae !important;
}
body[data-theme="light"] #settings-account-name {
  color: #1c2f50 !important;
}
body[data-theme="light"] #settings-account-phone {
  color: #475569 !important;
}
body[data-theme="light"] .settings-account-badge {
  background: #e6f7f6 !important;
  color: #167c77 !important;
  border-color: #a4e4e0 !important;
}
body[data-theme="light"] #settings-account-guest {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
  color: #475569 !important;
}
body[data-theme="light"] #btn-open-login-from-settings {
  background: #e6f7f6 !important;
  border-color: #2fb4ae !important;
  color: #167c77 !important;
}

/* --------------------------------------------------------------------------
   2. PRINCESS THEME: Inkwell Soft Rose & Berry (Tương phản cao ấm áp)
   -------------------------------------------------------------------------- */
body[data-theme="princess"] {
  --text-main: #4c1325;
  --text-muted: #831843;
  --text-dim: #9f1239;
  --card-bg: #ffffff;
  --card-border: #fbcfe8;
  --line: #fce7f3;
  --line-strong: #fbcfe8;
  --shadow-sm: 0 3px 12px rgba(236, 72, 153, 0.08);
  --shadow-md: 0 8px 24px rgba(236, 72, 153, 0.12);
  --accent: #be185d;
}

/* Tương phản cao Hero Card trên Theme Hồng (Khắc phục lỗi chữ chìm) */
body[data-theme="princess"] .hero-pickup-card {
  border-color: rgba(244, 114, 182, 0.45);
  box-shadow: 0 12px 36px rgba(190, 24, 93, 0.22);
}
body[data-theme="princess"] .hero-pickup-card .hero-time-label,
body[data-theme="princess"] .hero-time-label {
  color: rgba(255, 255, 255, 0.9) !important;
}
body[data-theme="princess"] .hero-pickup-card #hero-school-year,
body[data-theme="princess"] .hero-pickup-card .hero-subtext span {
  color: rgba(255, 255, 255, 0.9) !important;
}
body[data-theme="princess"] .hero-gate-badge {
  background: rgba(255, 255, 255, 0.16) !important;
  border-color: rgba(251, 207, 232, 0.45) !important;
}
body[data-theme="princess"] .hero-gate-badge .gate-label { color: #fce7f3 !important; }
body[data-theme="princess"] .hero-gate-badge .gate-name { color: #ffffff !important; }
body[data-theme="princess"] .hero-gate-badge .gate-street { color: #fde8ed !important; }

body[data-theme="princess"] .theme-quick-bar { background: #ffffff; border-color: #fbcfe8; }
body[data-theme="princess"] .theme-pill-btn { color: #831843; }
body[data-theme="princess"] .theme-pill-btn.active { background: #ec4899; color: #ffffff; }
body[data-theme="princess"] .school-meta h1 { color: #4c1325 !important; }
body[data-theme="princess"] .school-meta p { color: #831843 !important; }
body[data-theme="princess"] .school-meta h1 .badge-class { background: #fdf2f8; color: #db2777; border-color: #fbcfe8; }
body[data-theme="princess"] .btn-admin { background: #ffffff; color: #831843; border-color: #fbcfe8; }

/* Ticker & Thẻ nhanh */
body[data-theme="princess"] .ticker-bar { background: #ffffff; border-color: #fbcfe8; }
body[data-theme="princess"] .ticker-text { color: #4c1325 !important; font-weight: 600; }
body[data-theme="princess"] .ticker-badge { background: #fdf2f8; color: #db2777; border-color: #fbcfe8; }
body[data-theme="princess"] .ticker-dot { background: #db2777; }
body[data-theme="princess"] .quick-card { background: #ffffff; border-color: #fbcfe8; box-shadow: 0 3px 12px rgba(236, 72, 153, 0.05); }
body[data-theme="princess"] .quick-card-icon { background: #fdf2f8; border-color: #fbcfe8; color: #db2777; }
body[data-theme="princess"] .quick-card-content h3 { color: #831843 !important; font-weight: 700; }
body[data-theme="princess"] .quick-card-content p { color: #4c1325 !important; font-weight: 600; }
body[data-theme="princess"] .gate-badge-val { color: #db2777 !important; }

/* Bảng dặn dò */
body[data-theme="princess"] .notice-board-card { background: #ffffff; border-color: #fbcfe8; }
body[data-theme="princess"] .teacher-info h3 { color: #4c1325 !important; font-weight: 800; }
body[data-theme="princess"] .teacher-info p { color: #831843 !important; }
body[data-theme="princess"] .teacher-avatar { background: #fdf2f8; color: #db2777; border-color: #fbcfe8; }
body[data-theme="princess"] .notice-time-tag { background: #fdf2f8; color: #db2777; border-color: #fbcfe8; }
body[data-theme="princess"] .notice-message-box { background: #fff5f7; color: #4c1325 !important; border-color: #fce7f3; font-weight: 500; }

/* Khu vực Thời khóa biểu & Tab ngày */
body[data-theme="princess"] .schedule-title { color: #4c1325 !important; }
body[data-theme="princess"] .schedule-sub { color: #831843 !important; }
body[data-theme="princess"] .view-switch-tabs { background: #ffffff; border-color: #fbcfe8; }
body[data-theme="princess"] .view-btn { color: #831843; }
body[data-theme="princess"] .view-btn.active { background: #ec4899; color: #ffffff; }

body[data-theme="princess"] .day-tab-btn { background: #ffffff; border-color: #fbcfe8; color: #4c1325; }
body[data-theme="princess"] .day-tab-btn .day-name { color: #4c1325 !important; }
body[data-theme="princess"] .day-tab-btn .day-date { color: #831843 !important; font-weight: 600; }
body[data-theme="princess"] .day-tab-btn.active { background: #fdf2f8; border-color: #ec4899; box-shadow: 0 4px 14px rgba(236, 72, 153, 0.15); }
body[data-theme="princess"] .day-tab-btn.active .day-name { color: #be185d !important; }
body[data-theme="princess"] .day-tab-btn[data-live-day="true"] { border-color: #10b981 !important; box-shadow: 0 0 14px rgba(16, 185, 129, 0.3); }
body[data-theme="princess"] .day-tab-btn[data-diff-active="true"] { border-color: #d97706 !important; background: #fffbeb !important; box-shadow: 0 0 14px rgba(217, 119, 6, 0.25) !important; }
body[data-theme="princess"] .day-tab-btn[data-diff-active="true"] .day-name { color: #b45309 !important; }
body[data-theme="princess"] .day-tab-btn[data-diff-active="true"] .day-date { color: #d97706 !important; }
body[data-theme="princess"] .period-compact-row {
  background: rgba(255, 255, 255, 0.92);
  border-color: #fbcfe8;
  box-shadow: 0 2px 10px rgba(236, 72, 153, 0.06);
}
body[data-theme="princess"] .period-compact-row[data-status="live"]::after,
body[data-theme="princess"] .extra-period-row[data-status="live"]::after {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96) 0%, rgba(253, 242, 248, 0.98) 100%) !important;
}
body[data-theme="princess"] .period-compact-row[data-status="live"] .period-num,
body[data-theme="princess"] .extra-period-row[data-status="live"] .extra-period-num {
  color: #db2777 !important;
  text-shadow: none !important;
}
body[data-theme="princess"] .hub-tab-btn {
  background: #ffffff;
  border-color: #fbcfe8;
  color: #831843;
}
body[data-theme="princess"] .hub-tab-btn.active {
  background: #fdf2f8;
  border-color: #ec4899;
  color: #db2777;
  box-shadow: 0 0 12px rgba(236, 72, 153, 0.25);
}
body[data-theme="princess"] .hub-card {
  background: #ffffff;
  border-color: #fbcfe8;
}
body[data-theme="princess"] .day-summary-header { background: #ffffff; border-color: #fbcfe8; }
body[data-theme="princess"] .session-section { background: #ffffff; border-color: #fbcfe8; }

/* Thanh ghi chú ngày */
body[data-theme="princess"] .day-notice-bar {
  background: #fdf2f8;
  border-color: #fbcfe8;
  border-left: 4px solid #ec4899;
  color: #831843 !important;
  font-weight: 500;
}
body[data-theme="princess"] .day-notice-bar strong { color: #be185d !important; font-weight: 800; }

/* Thẻ tiết học */
body[data-theme="princess"] .period-card { background: #ffffff; border-color: #fbcfe8; }
body[data-theme="princess"] .period-time-range { color: #4c1325 !important; font-weight: 800; }
body[data-theme="princess"] .period-index { color: #831843 !important; font-weight: 600; }
body[data-theme="princess"] .teacher-badge { background: #fdf2f8; color: #831843; border-color: #fbcfe8; }

body[data-theme="princess"] .period-card[data-status="past"] {
  background: #fff8fa !important;
  border-color: #fce7f3 !important;
  opacity: 1 !important;
}
body[data-theme="princess"] .period-card[data-status="past"] .period-time-range { color: #701a35 !important; }
body[data-theme="princess"] .period-card[data-status="past"] .period-index { color: #9d174d !important; }
body[data-theme="princess"] .period-card[data-status="past"] .status-badge-done {
  color: #831843 !important;
  background: #fce7f3 !important;
  border: 1px solid #fbcfe8;
  font-weight: 700;
}

body[data-theme="princess"] .period-card[data-status="live"] {
  background: #fdf2f8 !important;
  border: 2px solid #ec4899 !important;
  box-shadow: 0 0 25px rgba(236, 72, 153, 0.25);
}
body[data-theme="princess"] .period-card[data-status="live"] .period-time-range { color: #be185d !important; }
body[data-theme="princess"] .period-card[data-status="live"] .period-status-badge.status-badge-live {
  background: #ec4899 !important;
  color: #ffffff !important;
}

/* Mô phỏng & Footer */
body[data-theme="princess"] .sim-controls { background: #ffffff; border-color: #fbcfe8; }
body[data-theme="princess"] .sim-label { color: #4c1325 !important; }
body[data-theme="princess"] .sim-select { background: #ffffff !important; color: #4c1325 !important; border-color: #fbcfe8 !important; }
body[data-theme="princess"] .app-footer { color: #831843 !important; border-top-color: #fce7f3; }

/* Ma trận tuần */
body[data-theme="princess"] .timetable-table th { background: #fdf2f8; color: #831843; border-color: #fbcfe8; }
body[data-theme="princess"] .timetable-table td { border-color: #fce7f3; color: #4c1325; }
body[data-theme="princess"] .timetable-table th.col-today { background: #fce7f3; color: #db2777; border-color: #ec4899; }
body[data-theme="princess"] .timetable-table td.cell-today { background: #fff8fa; }
body[data-theme="princess"] .timetable-table th.th-slot-col {
  background: #fdf2f8 !important;
  color: #831843 !important;
  box-shadow: 3px 0 8px rgba(236, 72, 153, 0.1) !important;
  border-right: 2px solid #fbcfe8 !important;
}
body[data-theme="princess"] .timetable-table td.cell-slot-col {
  background: #ffffff !important;
  color: #4c1325 !important;
  box-shadow: 3px 0 8px rgba(236, 72, 153, 0.1) !important;
  border-right: 2px solid #fbcfe8 !important;
}

/* --------------------------------------------------------------------------
   THẺ MÔN HỌC TƯƠNG PHẢN CAO CHO 2 THEME SÁNG (Light & Princess)
   -------------------------------------------------------------------------- */
body[data-theme="light"] .subject-pill,
body[data-theme="light"] .matrix-subject-pill,
body[data-theme="princess"] .subject-pill,
body[data-theme="princess"] .matrix-subject-pill {
  font-weight: 800 !important;
  filter: none !important;
}

body[data-theme="light"] .subject-pill[data-subject="Tiếng Việt"],
body[data-theme="light"] .matrix-subject-pill[data-subject="Tiếng Việt"],
body[data-theme="princess"] .subject-pill[data-subject="Tiếng Việt"],
body[data-theme="princess"] .matrix-subject-pill[data-subject="Tiếng Việt"],
body[data-theme="light"] .subject-pill[data-subject="Chào cờ (HĐTN)"],
body[data-theme="princess"] .subject-pill[data-subject="Chào cờ (HĐTN)"] {
  background: #fee2e2 !important; color: #b91c1c !important; border-color: #fca5a5 !important;
}

body[data-theme="light"] .subject-pill[data-subject="Toán"],
body[data-theme="light"] .matrix-subject-pill[data-subject="Toán"],
body[data-theme="princess"] .subject-pill[data-subject="Toán"],
body[data-theme="princess"] .matrix-subject-pill[data-subject="Toán"] {
  background: #dbeafe !important; color: #1d4ed8 !important; border-color: #93c5fd !important;
}

body[data-theme="light"] .subject-pill[data-subject="Tiếng Anh (GVBN)"],
body[data-theme="light"] .matrix-subject-pill[data-subject="Tiếng Anh (GVBN)"],
body[data-theme="princess"] .subject-pill[data-subject="Tiếng Anh (GVBN)"],
body[data-theme="princess"] .matrix-subject-pill[data-subject="Tiếng Anh (GVBN)"] {
  background: #f3e8ff !important; color: #7e22ce !important; border-color: #d8b4fe !important;
}

body[data-theme="light"] .subject-pill[data-subject*="Mỹ thuật"],
body[data-theme="light"] .matrix-subject-pill[data-subject*="Mỹ thuật"],
body[data-theme="princess"] .subject-pill[data-subject*="Mỹ thuật"],
body[data-theme="princess"] .matrix-subject-pill[data-subject*="Mỹ thuật"] {
  background: #fce7f3 !important; color: #be185d !important; border-color: #f472b6 !important;
}

body[data-theme="light"] .subject-pill[data-subject*="Âm nhạc"],
body[data-theme="light"] .matrix-subject-pill[data-subject*="Âm nhạc"],
body[data-theme="princess"] .subject-pill[data-subject*="Âm nhạc"],
body[data-theme="princess"] .matrix-subject-pill[data-subject*="Âm nhạc"] {
  background: #fef3c7 !important; color: #b45309 !important; border-color: #fcd34d !important;
}

body[data-theme="light"] .subject-pill[data-subject*="GDTC"],
body[data-theme="light"] .matrix-subject-pill[data-subject*="GDTC"],
body[data-theme="princess"] .subject-pill[data-subject*="GDTC"],
body[data-theme="princess"] .matrix-subject-pill[data-subject*="GDTC"],
body[data-theme="light"] .subject-pill[data-subject*="Tập thể dục"],
body[data-theme="princess"] .subject-pill[data-subject*="Tập thể dục"] {
  background: #d1fae5 !important; color: #047857 !important; border-color: #6ee7b7 !important;
}

body[data-theme="light"] .subject-pill[data-subject="STEM"],
body[data-theme="light"] .matrix-subject-pill[data-subject="STEM"],
body[data-theme="princess"] .subject-pill[data-subject="STEM"],
body[data-theme="princess"] .matrix-subject-pill[data-subject="STEM"] {
  background: #cffafe !important; color: #0e7490 !important; border-color: #67e8f9 !important;
}

body[data-theme="light"] .subject-pill[data-subject="Kỹ năng sống"],
body[data-theme="light"] .matrix-subject-pill[data-subject="Kỹ năng sống"],
body[data-theme="princess"] .subject-pill[data-subject="Kỹ năng sống"],
body[data-theme="princess"] .matrix-subject-pill[data-subject="Kỹ năng sống"] {
  background: #e0e7ff !important; color: #4338ca !important; border-color: #a5b4fc !important;
}

body[data-theme="light"] .subject-pill[data-subject="TNXH"],
body[data-theme="light"] .matrix-subject-pill[data-subject="TNXH"],
body[data-theme="princess"] .subject-pill[data-subject="TNXH"],
body[data-theme="princess"] .matrix-subject-pill[data-subject="TNXH"] {
  background: #dcfce7 !important; color: #15803d !important; border-color: #86efac !important;
}

body[data-theme="light"] .subject-pill[data-subject*="Đạo đức"],
body[data-theme="light"] .matrix-subject-pill[data-subject*="Đạo đức"],
body[data-theme="princess"] .subject-pill[data-subject*="Đạo đức"],
body[data-theme="princess"] .matrix-subject-pill[data-subject*="Đạo đức"] {
  background: #fef9c3 !important; color: #a16207 !important; border-color: #fde047 !important;
}

body[data-theme="light"] .subject-pill[data-subject*="HĐTN"],
body[data-theme="light"] .matrix-subject-pill[data-subject*="HĐTN"],
body[data-theme="princess"] .subject-pill[data-subject*="HĐTN"],
body[data-theme="princess"] .matrix-subject-pill[data-subject*="HĐTN"] {
  background: #ffedd5 !important; color: #c2410c !important; border-color: #fdba74 !important;
}

body[data-theme="light"] .subject-pill[data-subject*="Ra chơi"],
body[data-theme="light"] .matrix-subject-pill[data-subject*="Ra chơi"],
body[data-theme="princess"] .subject-pill[data-subject*="Ra chơi"],
body[data-theme="princess"] .matrix-subject-pill[data-subject*="Ra chơi"] {
  background: #f1f5f9 !important; color: #334155 !important; border-color: #cbd5e1 !important;
}

body[data-theme="light"] .subject-pill[data-subject*="Bán trú"],
body[data-theme="light"] .matrix-subject-pill[data-subject*="Bán trú"],
body[data-theme="princess"] .subject-pill[data-subject*="Bán trú"],
body[data-theme="princess"] .matrix-subject-pill[data-subject*="Bán trú"] {
  background: #ccfbf1 !important; color: #0f766e !important; border-color: #5eead4 !important;
}

/* --------------------------------------------------------------------------
   3. SUNSHINE THEME: Ainox High-Contrast Cyber Solar
   -------------------------------------------------------------------------- */
body[data-theme="sunshine"] {
  --card-bg: #0d121c;
  --card-border: rgba(250, 204, 21, 0.3);
  --accent: #facc15;
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.6);
}
body[data-theme="sunshine"] .btn-admin { color: #facc15; border-color: rgba(250, 204, 21, 0.4); }
body[data-theme="sunshine"] .ticker-bar { background: #0d121c; border-color: rgba(250, 204, 21, 0.35); }
body[data-theme="sunshine"] .ticker-badge { background: rgba(250, 204, 21, 0.2); color: #facc15; border-color: rgba(250, 204, 21, 0.5); }
body[data-theme="sunshine"] .ticker-dot { background: #facc15; box-shadow: 0 0 10px #facc15; }
body[data-theme="sunshine"] .quick-card-icon { color: #facc15; border-color: rgba(250, 204, 21, 0.3); }
body[data-theme="sunshine"] .teacher-avatar { border-color: #facc15; color: #facc15; }
body[data-theme="sunshine"] .day-tab-btn.active { border-color: #facc15; background: #181f2c; box-shadow: 0 0 18px rgba(250, 204, 21, 0.25); }
body[data-theme="sunshine"] .day-tab-btn[data-live-day="true"] { border-color: #10b981 !important; box-shadow: 0 0 16px rgba(16, 185, 129, 0.4) !important; }
body[data-theme="sunshine"] .day-tab-btn[data-diff-active="true"] { border-color: #facc15 !important; background: #181f2c !important; }
body[data-theme="sunshine"] .day-notice-bar {
  background: rgba(250, 204, 21, 0.08);
  border-color: rgba(250, 204, 21, 0.3);
  border-left: 4px solid #facc15;
  color: #fef08a;
}
body[data-theme="sunshine"] .day-notice-bar strong { color: #facc15; }
body[data-theme="sunshine"] .period-card[data-status="live"] {
  border-color: #facc15 !important;
  box-shadow: 0 0 30px rgba(250, 204, 21, 0.45);
}
body[data-theme="sunshine"] .period-card[data-status="live"] .period-time-range { color: #facc15; }
body[data-theme="sunshine"] .theme-pill-btn.active { background: #facc15; color: #000000; }

body[data-theme="sunshine"] .timetable-table th.th-slot-col {
  background: #0d121c !important;
  color: #facc15 !important;
  box-shadow: 3px 0 10px rgba(0, 0, 0, 0.7) !important;
  border-right: 2px solid rgba(250, 204, 21, 0.4) !important;
}
body[data-theme="sunshine"] .timetable-table td.cell-slot-col {
  background: #0d121c !important;
  color: #fef08a !important;
  box-shadow: 3px 0 10px rgba(0, 0, 0, 0.7) !important;
  border-right: 2px solid rgba(250, 204, 21, 0.4) !important;
}
body[data-theme="sunshine"] .hub-tab-btn.active {
  background: rgba(250, 204, 21, 0.16);
  border-color: #facc15;
  color: #facc15;
  box-shadow: 0 0 14px rgba(250, 204, 21, 0.35);
}
body[data-theme="sunshine"] .period-compact-row[data-status="live"]::after,
body[data-theme="sunshine"] .extra-period-row[data-status="live"]::after {
  background: linear-gradient(135deg, rgba(16, 22, 34, 0.94) 0%, rgba(9, 13, 20, 0.98) 100%) !important;
}

body[data-theme="sunshine"] .hero-pickup-card {
  border-color: rgba(250, 204, 21, 0.45);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6), 0 0 25px rgba(250, 204, 21, 0.15);
}
body[data-theme="sunshine"] .hero-gate-badge {
  background: rgba(250, 204, 21, 0.12) !important;
  border-color: rgba(250, 204, 21, 0.45) !important;
}
body[data-theme="sunshine"] .hero-gate-badge .gate-label { color: #fde047 !important; }
body[data-theme="sunshine"] .hero-gate-badge .gate-name { color: #ffffff !important; }
body[data-theme="sunshine"] .hero-gate-badge .gate-street { color: #fef08a !important; }

/* ==========================================================================
   HUY HIỆU THỜI GIAN CẬP NHẬT DẶN DÒ / TỰ ĐỘNG THEO TKB
   ========================================================================== */
.notice-timestamp-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line-strong);
  color: var(--text-muted);
  letter-spacing: 0.02em;
}
.notice-timestamp-badge.is-live {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
}
.notice-timestamp-badge.is-auto {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.35);
  color: #93c5fd;
}
body[data-theme="light"] .notice-timestamp-badge.is-live {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
}
body[data-theme="light"] .notice-timestamp-badge.is-auto {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #334155;
}
body[data-theme="princess"] .notice-timestamp-badge.is-live {
  background: #fdf2f8;
  border-color: #fbcfe8;
  color: #be185d;
}
body[data-theme="princess"] .notice-timestamp-badge.is-auto {
  background: #fff5f7;
  border-color: #fce7f3;
  color: #831843;
}
body[data-theme="sunshine"] .notice-timestamp-badge.is-live {
  background: rgba(250, 204, 21, 0.16);
  border-color: rgba(250, 204, 21, 0.4);
  color: #facc15;
}
body[data-theme="sunshine"] .notice-timestamp-badge.is-auto {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: #e2e8f0;
}

/* ==========================================================================
   MODAL: THIẾT LẬP CHUNG DÀNH CHO PHỤ HUYNH / NGƯỜI DÙNG (CÁ NHÂN HÓA)
   ========================================================================== */
.settings-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: modalFadeIn 0.25s ease-out;
}
@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.settings-modal-dialog {
  background: var(--card-bg, #0b1a15);
  border: 1.5px solid var(--card-border, rgba(52, 211, 153, 0.35));
  border-radius: var(--radius-lg, 16px);
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 30px rgba(16, 185, 129, 0.15);
  overflow: hidden;
  animation: modalSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modalSlideUp {
  from { transform: translateY(20px) scale(0.97); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.settings-modal-header {
  padding: 18px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line, rgba(255, 255, 255, 0.08));
  background: rgba(255, 255, 255, 0.02);
}
.settings-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-main, #ffffff);
}
.settings-title-group h2 {
  font-size: 17px;
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.01em;
}
.btn-close-modal {
  background: transparent;
  border: none;
  color: var(--text-muted, #9bb5ab);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.btn-close-modal:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.settings-modal-body {
  padding: 20px 22px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.setting-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.setting-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted, #a7f3d0);
  letter-spacing: 0.02em;
}

/* 4 Thẻ Theme Grid */
.settings-theme-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.setting-theme-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1.5px solid var(--line-strong, rgba(255, 255, 255, 0.12));
  border-radius: var(--radius-sm, 10px);
  padding: 12px 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  transition: all 0.2s;
  color: var(--text-main, #ffffff);
}
.setting-theme-card:hover {
  border-color: rgba(52, 211, 153, 0.5);
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-1px);
}
.setting-theme-card.active {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.14);
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.25);
}
.theme-card-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.theme-card-info strong {
  font-size: 13px;
  font-weight: 700;
}
.theme-card-info small {
  font-size: 11px;
  color: var(--text-muted, #9bb5ab);
}

/* Radio Pill Selector (Font, Font Size) */
.setting-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.setting-pill-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line-strong, rgba(255, 255, 255, 0.12));
  color: var(--text-muted, #9bb5ab);
  font-size: 12.5px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.15s;
}
.setting-pill-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main, #ffffff);
}
.setting-pill-btn.active {
  background: rgba(16, 185, 129, 0.2);
  border-color: #10b981;
  color: #34d399;
  font-weight: 700;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

.settings-modal-footer {
  padding: 16px 22px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--line, rgba(255, 255, 255, 0.08));
  background: rgba(255, 255, 255, 0.02);
}
.btn-cancel-modal {
  background: transparent;
  border: 1px solid var(--line-strong, rgba(255, 255, 255, 0.15));
  color: var(--text-muted, #9bb5ab);
  font-size: 13px;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: var(--radius-sm, 8px);
  cursor: pointer;
  transition: all 0.15s;
}
.btn-cancel-modal:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}
.btn-apply-settings {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #021a12;
  border: none;
  font-size: 13.5px;
  font-weight: 800;
  padding: 9px 22px;
  border-radius: var(--radius-sm, 8px);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}
.btn-apply-settings:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

/* Toast thông báo */
.settings-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #064e3b;
  border: 1px solid #10b981;
  color: #ffffff;
  padding: 12px 20px;
  border-radius: var(--radius-md, 12px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  font-size: 13px;
  font-weight: 700;
  display: none;
  align-items: center;
  gap: 8px;
  z-index: 12000;
  animation: toastSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes toastSlideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@media (max-width: 640px) {
  .settings-theme-grid {
    grid-template-columns: 1fr;
  }
}


/* ============================================================================
   PROFILE CHIP — Nút hồ sơ bé trên header
   ============================================================================ */

.profile-chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px 6px 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  cursor: pointer;
  color: var(--text-main);
  font-size: 12px;
  font-family: var(--font-sans);
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: all 0.2s ease;
  position: relative;
  white-space: nowrap;
}
.profile-chip-btn:hover {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.4);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}
.profile-chip-avatar {
  font-size: 16px;
  line-height: 1;
}
.profile-chip-name {
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.profile-chip-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.7);
  flex-shrink: 0;
}

/* ============================================================================
   SETTINGS MODAL — Tab nav (Thiết lập chung / Thiết lập riêng)
   ============================================================================ */

.settings-tab-nav {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.settings-tab-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 12px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.settings-tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.06);
}
.settings-tab-btn.active {
  color: var(--accent);
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
}
[data-theme="light"] .settings-tab-btn.active {
  color: #2563eb;
  background: rgba(37, 99, 235, 0.10);
  border-color: rgba(37, 99, 235, 0.3);
}
[data-theme="princess"] .settings-tab-btn.active {
  color: #be185d;
  background: rgba(190, 24, 93, 0.10);
  border-color: rgba(190, 24, 93, 0.3);
}
[data-theme="sunshine"] .settings-tab-btn.active {
  color: #facc15;
  background: rgba(250, 204, 21, 0.12);
  border-color: rgba(250, 204, 21, 0.35);
}

/* ============================================================================
   SETTING HINT TEXT
   ============================================================================ */

.setting-hint {
  font-size: 11.5px;
  color: var(--text-dim);
  line-height: 1.5;
  margin-top: 2px;
  margin-bottom: 14px;
}

/* ============================================================================
   PROFILES LIST — Danh sách hồ sơ trong modal Thiết lập riêng
   ============================================================================ */

.profiles-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.profile-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 14px;
  transition: border-color 0.2s;
}
.profile-card-active {
  border-color: rgba(16, 185, 129, 0.45);
  background: rgba(16, 185, 129, 0.05);
}

.profile-card-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.profile-card-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  width: 100%;
}

.profile-card-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
}

.profile-avatar-big {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #34d399;
  flex-shrink: 0;
}

.profile-avatar-big svg {
  width: 20px;
  height: 20px;
}

.profile-card-name {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  min-width: 0;
}

.profile-name-text {
  white-space: nowrap;
}

.profile-card-meta {
  flex: 1;
  min-width: 0;
}

.profile-card-notes-box {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9px;
  font-size: 12px;
  color: var(--text-muted, #94a3b8);
  line-height: 1.5;
  box-sizing: border-box;
}

.profile-card-notes-icon {
  flex-shrink: 0;
  color: var(--primary, #10b981);
  display: inline-flex;
  align-items: center;
  margin-top: 2px;
}

.profile-card-notes-text {
  flex: 1;
  word-break: break-word;
}

.profile-card-school-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 7px 12px;
  background: rgba(16, 185, 129, 0.05);
  border: 1px solid rgba(16, 185, 129, 0.18);
  border-radius: 9px;
  box-sizing: border-box;
  flex-wrap: wrap;
}

.profile-card-school-info {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--text-main, #f1f5f9);
  min-width: 0;
  flex: 1 1 auto;
}

.profile-card-school-info svg {
  color: #34d399;
  flex-shrink: 0;
}

.profile-card-school-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.btn-profile-change-school {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 7px;
  color: #6ee7b7;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  font-family: var(--font-sans);
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.btn-profile-change-school:hover {
  background: rgba(16, 185, 129, 0.28);
  border-color: #34d399;
  color: #ffffff;
}

.profile-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-switch-profile {
  padding: 5px 12px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: 8px;
  color: #34d399;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: all 0.2s;
}
.btn-switch-profile:hover {
  background: rgba(16, 185, 129, 0.25);
}

.profile-active-badge {
  font-size: 11.5px;
  font-weight: 700;
  color: #10b981;
  letter-spacing: 0.04em;
}

/* .btn-del-profile được định kiểu tập trung ở section ENHANCED PROFILE LIST CARDS */

/* Lưới lịch học theo ngày */
.profile-schedule-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
@media (max-width: 500px) {
  .profile-schedule-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.profile-day-block {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  padding: 8px;
}
.profile-day-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.profile-day-slots {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 6px;
}
.profile-slot-empty {
  font-size: 10.5px;
  color: var(--text-dim);
  font-style: italic;
}
.profile-slot-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 6px;
  padding: 5px 7px;
  position: relative;
}
.profile-slot-time {
  font-size: 10px;
  font-weight: 700;
  color: #10b981;
}
.profile-slot-subj {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-main);
}
.profile-slot-loc {
  font-size: 10px;
  color: var(--text-muted);
}
.profile-slot-del {
  position: absolute;
  top: 4px;
  right: 4px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 10px;
  color: var(--text-dim);
  padding: 0 2px;
  line-height: 1;
  transition: color 0.15s;
}
.profile-slot-del:hover { color: #f87171; }

.btn-add-slot {
  width: 100%;
  padding: 5px 4px;
  background: none;
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 7px;
  color: var(--text-dim);
  font-size: 10.5px;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}
.btn-add-slot:hover {
  color: var(--text-muted);
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.06);
}

.btn-add-profile {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px;
  background: none;
  border: 2px dashed rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.2s;
}
.btn-add-profile:hover {
  color: var(--text-main);
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.06);
}

/* ============================================================================
   EXTRA SCHEDULE SECTION — Lịch học ngoài giờ trong Timeline
   ============================================================================ */

.extra-schedule-section {
  margin-top: 16px;
  border-top: 1px dashed rgba(139, 92, 246, 0.35);
  padding-top: 14px;
}

.extra-schedule-header {
  margin-bottom: 10px;
}

.extra-schedule-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #a78bfa;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 4px;
}

.extra-period-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.07) 0%, rgba(167, 139, 250, 0.04) 100%);
  border: 1px solid rgba(139, 92, 246, 0.22);
  border-radius: 16px;
  margin-bottom: 8px;
  animation: fadeInUp 0.3s ease;
  transition: all 0.25s ease;
}

.extra-period-row[data-status="past"] {
  opacity: 0.45;
  filter: grayscale(0.3);
  background: rgba(255, 255, 255, 0.02) !important;
  border-color: rgba(255, 255, 255, 0.04) !important;
  box-shadow: none !important;
}
.extra-period-row[data-status="past"]:hover {
  opacity: 0.85;
}

.extra-period-row[data-status="upcoming"] {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.07) 0%, rgba(167, 139, 250, 0.03) 100%);
  border: 1px solid rgba(139, 92, 246, 0.22);
}
.extra-period-row[data-status="upcoming"]:hover {
  border-color: rgba(192, 132, 252, 0.45);
  box-shadow: inset 0 1px 1.5px rgba(255, 255, 255, 0.3), 0 0 20px rgba(168, 85, 247, 0.22);
}

/* Trạng thái môn học thêm đang diễn ra đặt dưới đồng hồ đếm ngược */
.hero-extra-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  background: rgba(168, 85, 247, 0.16);
  border: 1px solid rgba(192, 132, 252, 0.35);
  color: #e9d5ff;
  box-shadow: 0 2px 10px rgba(168, 85, 247, 0.2), inset 0 1px 1px rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: extraStatusGlow 2.5s infinite ease-in-out;
  max-width: 100%;
}
.hero-extra-status strong {
  color: #ffffff;
  font-weight: 700;
}
.hero-extra-status .extra-status-pulse {
  display: inline-block;
  color: #c084fc;
  font-size: 10px;
  animation: liveBadgePulse 1.5s infinite ease-in-out;
  vertical-align: middle;
}

@keyframes extraStatusGlow {
  0%, 100% {
    box-shadow: 0 2px 10px rgba(168, 85, 247, 0.2), inset 0 1px 1px rgba(255, 255, 255, 0.15);
    border-color: rgba(192, 132, 252, 0.35);
  }
  50% {
    box-shadow: 0 4px 18px rgba(168, 85, 247, 0.42), inset 0 1px 1px rgba(255, 255, 255, 0.3);
    border-color: rgba(232, 121, 249, 0.65);
  }
}

body[data-theme="light"] .hero-extra-status {
  background: rgba(124, 58, 237, 0.09);
  border-color: rgba(124, 58, 237, 0.28);
  color: #5b21b6;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.12);
}
body[data-theme="light"] .hero-extra-status strong { color: #4c1d95; }
body[data-theme="light"] .hero-extra-status .extra-status-pulse { color: #7c3aed; }

body[data-theme="princess"] .hero-extra-status {
  background: rgba(219, 39, 119, 0.12);
  border-color: rgba(244, 114, 182, 0.4);
  color: #9d174d;
  box-shadow: 0 2px 8px rgba(219, 39, 119, 0.15);
}
body[data-theme="princess"] .hero-extra-status strong { color: #831843; }
body[data-theme="princess"] .hero-extra-status .extra-status-pulse { color: #db2777; }

body[data-theme="sunshine"] .hero-extra-status {
  background: rgba(250, 204, 21, 0.14);
  border-color: rgba(250, 204, 21, 0.45);
  color: #fef08a;
  box-shadow: 0 2px 8px rgba(250, 204, 21, 0.2);
}
body[data-theme="sunshine"] .hero-extra-status strong { color: #ffffff; }
body[data-theme="sunshine"] .hero-extra-status .extra-status-pulse { color: #facc15; }

.matrix-extra-pill.matrix-extra-pill-live {
  border-color: #a855f7 !important;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.35) 0%, rgba(249, 115, 22, 0.22) 100%) !important;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.35);
  animation: liveBadgePulse 1.8s infinite ease-in-out;
  color: #ffffff !important;
}
.matrix-live-dot {
  font-size: 9px;
  font-weight: 800;
  color: #fb923c;
  margin-left: 4px;
}

.extra-period-num {
  font-size: 9px !important;
  background: rgba(139, 92, 246, 0.18) !important;
  color: #a78bfa !important;
  border: 1px solid rgba(139, 92, 246, 0.3) !important;
  padding: 3px 6px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 800 !important;
  white-space: nowrap;
}

.extra-subj-pill {
  background: rgba(139, 92, 246, 0.12) !important;
  color: #c4b5fd !important;
  border: 1px solid rgba(139, 92, 246, 0.28) !important;
}

.extra-location-tag {
  color: #a78bfa !important;
  font-size: 11px !important;
  margin-top: 3px;
}

/* Light theme adjustments for extra schedule */
[data-theme="light"] .extra-schedule-section {
  border-top-color: rgba(109, 40, 217, 0.3);
}
[data-theme="light"] .extra-schedule-title { color: #7c3aed; }
[data-theme="light"] .extra-period-row {
  background: rgba(109, 40, 217, 0.05);
  border-color: rgba(109, 40, 217, 0.2);
}
[data-theme="light"] .extra-period-num {
  background: rgba(109, 40, 217, 0.10) !important;
  color: #7c3aed !important;
  border-color: rgba(109, 40, 217, 0.25) !important;
}
[data-theme="light"] .extra-subj-pill {
  background: rgba(109, 40, 217, 0.08) !important;
  color: #6d28d9 !important;
  border-color: rgba(109, 40, 217, 0.2) !important;
}
[data-theme="light"] .extra-location-tag { color: #7c3aed !important; }

/* ============================================================================
   HERO REMINDER BUTTON — Nút đặt nhắc nhở đón con
   ============================================================================ */
.hero-right-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}
.btn-hero-reminder {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.16) 0%, rgba(217, 119, 6, 0.08) 100%);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 999px;
  color: #fbbf24;
  font-size: 11.5px;
  font-weight: 700;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}
.btn-hero-reminder:hover {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.28) 0%, rgba(217, 119, 6, 0.16) 100%);
  border-color: #f59e0b;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.25);
  transform: translateY(-1px);
}
.btn-hero-reminder:active {
  transform: translateY(0);
}

/* ============================================================================
   CUSTOM MODALS (Sleek Glassmorphism & Mobile UX)
   ============================================================================ */
.custom-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10500;
  background: rgba(4, 10, 8, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeInModal 0.2s ease;
}

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

.custom-modal-box {
  background: linear-gradient(180deg, #15221f 0%, #0a1412 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(16, 185, 129, 0.1);
  width: 100%;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideUpModal 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.custom-modal-wide { max-width: 580px; }
.custom-modal-compact { max-width: 440px; }

.custom-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.modal-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.modal-step-badge {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #10b981;
  text-transform: uppercase;
}
.custom-modal-header .modal-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
  margin: 0;
  letter-spacing: -0.01em;
}

.custom-modal-body {
  padding: 16px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.custom-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.15);
}

.btn-save-slot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 20px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border: none;
  border-radius: 10px;
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 700;
  font-family: var(--font-sans);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
  transition: all 0.2s;
}
.btn-save-slot:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

/* ============================================================================
   UX 4-STEP SCHEDULE BUILDER
   ============================================================================ */
.ux-step-card {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.2s;
}
.ux-step-card:focus-within {
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.02);
}

.ux-step-header {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ux-step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  font-size: 11.5px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ux-step-title-box {
  display: flex;
  flex-direction: column;
}
.ux-step-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
}
.ux-step-desc {
  font-size: 11px;
  color: var(--text-muted);
}

/* Bước 1: Khung giờ presets */
.ux-presets-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}
@media (max-width: 460px) {
  .ux-presets-grid { grid-template-columns: repeat(2, 1fr); }
}
.ux-preset-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  font-family: var(--font-sans);
}
.ux-preset-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}
.ux-preset-btn.active {
  background: rgba(16, 185, 129, 0.12);
  border-color: #10b981;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}
.preset-icon { font-size: 15px; margin-bottom: 2px; }
.preset-name { font-size: 11px; font-weight: 700; color: var(--text-main); }
.preset-time { font-size: 9.5px; color: #10b981; font-weight: 600; margin-top: 1px; }

.ux-time-inputs-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 4px;
}
.ux-time-field {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ux-time-field label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}
.ux-time-field input[type="time"] {
  width: 100%;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9px;
  color: var(--text-main);
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-sans);
  outline: none;
  transition: border-color 0.2s;
}
.ux-time-field input[type="time"]:focus {
  border-color: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}
.ux-time-sep {
  font-size: 14px;
  color: var(--text-dim);
  padding-top: 18px;
}

/* Bước 2: Chọn môn học */
.ux-subjects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
@media (max-width: 480px) {
  .ux-subjects-grid { grid-template-columns: repeat(2, 1fr); }
}
.ux-subj-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
  font-family: var(--font-sans);
}
.ux-subj-chip:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}
.ux-subj-chip.active {
  background: rgba(139, 92, 246, 0.16);
  border-color: #a78bfa;
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.25);
}
.subj-icon { font-size: 15px; flex-shrink: 0; }
.subj-label { font-size: 11px; font-weight: 600; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ux-custom-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}
.ux-input-icon {
  position: absolute;
  left: 12px;
  font-size: 16px;
  pointer-events: none;
}
.ux-input-svg {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  pointer-events: none;
}
.ux-text-input {
  width: 100%;
  padding: 9px 12px 9px 38px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: var(--text-main);
  font-size: 13px;
  font-family: var(--font-sans);
  outline: none;
  transition: border-color 0.2s;
}
.ux-text-input:focus {
  border-color: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

/* Bước 3: Hình thức học */
.ux-mode-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
@media (max-width: 480px) {
  .ux-mode-row { grid-template-columns: repeat(2, 1fr); }
}
.ux-mode-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9px;
  color: var(--text-main);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  font-family: var(--font-sans);
  white-space: nowrap;
}
.ux-mode-btn:hover { background: rgba(255, 255, 255, 0.08); }
.ux-mode-btn.active {
  background: rgba(16, 185, 129, 0.14);
  border-color: #10b981;
  color: #34d399;
  font-weight: 700;
}

/* Bước 4: Chọn các thứ */
.ux-days-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ux-shortcut-btn {
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.15s;
}
.ux-shortcut-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

.ux-day-pills-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ux-day-pill {
  flex: 1;
  min-width: 58px;
  padding: 8px 4px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: var(--font-sans);
}
.ux-day-pill:hover { background: rgba(255, 255, 255, 0.07); }
.ux-day-pill.active {
  background: rgba(16, 185, 129, 0.16);
  border-color: #10b981;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}
.day-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transition: background 0.15s;
}
.ux-day-pill.active .day-dot { background: #10b981; }
.day-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}
.ux-day-pill.active .day-name { color: #fff; }

.ux-reminder-option-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 6px;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
}
.reminder-opt-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: #fbbf24;
}
.ux-reminder-select {
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 8px;
  color: #fde68a;
  font-size: 11.5px;
  font-weight: 600;
  font-family: var(--font-sans);
  outline: none;
}

/* ============================================================================
   SHARE PROFILE MODAL (QR CODE & LINK)
   ============================================================================ */
.share-modal-body {
  gap: 16px;
}
.share-profile-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
}
.share-avatar-box {
  font-size: 36px;
  line-height: 1;
}
.share-meta-box {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.share-child-name {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
  margin: 0;
}
.share-badge-tag {
  font-size: 11px;
  font-weight: 600;
  color: #10b981;
}

.share-qr-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 16px;
}
.share-qr-box {
  width: 200px;
  height: 200px;
  background: #ffffff;
  border-radius: 12px;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  margin-bottom: 12px;
}
.share-qr-box svg {
  width: 100%;
  height: 100%;
  display: block;
}
.share-qr-hint {
  font-size: 11.5px;
  color: var(--text-muted);
  max-width: 280px;
  margin: 0 0 12px 0;
  line-height: 1.4;
}
.btn-download-qr {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 999px;
  color: #34d399;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.2s;
}
.btn-download-qr:hover {
  background: rgba(16, 185, 129, 0.25);
  border-color: #10b981;
}

.share-link-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.share-link-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
}
.share-input-row {
  display: flex;
  gap: 6px;
}
.share-url-input {
  flex: 1;
  padding: 9px 12px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9px;
  color: var(--text-main);
  font-size: 12px;
  font-family: monospace;
  outline: none;
}
.btn-copy-share-url {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 9px 14px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border: none;
  border-radius: 9px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font-sans);
  white-space: nowrap;
  transition: all 0.2s;
}
.btn-copy-share-url:hover { filter: brightness(1.1); }

/* ============================================================================
   REMINDER MODAL (APPLE / GOOGLE CALENDAR)
   ============================================================================ */
.reminder-event-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(217, 119, 6, 0.04) 100%);
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-radius: 14px;
}
.reminder-event-icon {
  font-size: 30px;
  line-height: 1;
}
.reminder-event-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.reminder-event-title {
  font-size: 14.5px;
  font-weight: 800;
  color: #fbbf24;
  margin: 0;
}
.reminder-event-time {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  margin: 0;
}
.reminder-event-loc {
  font-size: 11px;
  color: var(--text-muted);
  margin: 0;
}

.reminder-time-chips {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}
.remind-chip-btn {
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}
.remind-chip-btn:hover { background: rgba(255, 255, 255, 0.08); }
.remind-chip-btn.active {
  background: rgba(245, 158, 11, 0.16);
  border-color: #f59e0b;
  color: #fbbf24;
  font-weight: 700;
}

.reminder-action-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}
.btn-reminder-action {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-main);
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-sans);
}
.btn-reminder-action:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}
.btn-remind-apple {
  border-color: rgba(16, 185, 129, 0.3);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(5, 150, 105, 0.03) 100%);
}
.btn-remind-apple:hover {
  border-color: #10b981;
}
.action-icon {
  font-size: 24px;
  line-height: 1;
}
.action-texts {
  display: flex;
  flex-direction: column;
}
.action-texts strong {
  font-size: 13px;
  font-weight: 700;
}
.action-texts small {
  font-size: 10.5px;
  color: var(--text-muted);
}

/* ============================================================================
   PROFILE EDIT MODAL (AVATAR PICKER)
   ============================================================================ */
.ux-avatar-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.avatar-opt-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}
.avatar-opt-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.08);
}
.avatar-opt-btn.active {
  background: rgba(16, 185, 129, 0.16);
  border-color: #10b981;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
  transform: scale(1.1);
}
.ux-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ux-form-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
}

/* ============================================================================
   ENHANCED PROFILE LIST CARDS & EXTRA SCHEDULE MANAGEMENT
   ============================================================================ */
.profile-card-top-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.btn-share-profile {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.18) 0%, rgba(124, 58, 237, 0.08) 100%);
  border: 1px solid rgba(139, 92, 246, 0.35);
  border-radius: 8px;
  color: #c4b5fd;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: all 0.15s;
}
.btn-share-profile:hover {
  background: rgba(139, 92, 246, 0.28);
  border-color: #a78bfa;
}
.btn-edit-profile-meta,
.btn-del-profile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  color: var(--text-main, #f1f5f9);
  cursor: pointer;
  padding: 0;
  transition: all 0.18s ease;
  flex-shrink: 0;
}
.btn-edit-profile-meta svg,
.btn-del-profile svg {
  stroke: currentColor;
  width: 14px;
  height: 14px;
}
.btn-edit-profile-meta:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: #38bdf8;
  color: #38bdf8;
  transform: translateY(-1px);
}
.btn-del-profile:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
  color: #f87171;
  transform: translateY(-1px);
}

.profile-classes-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}
.profile-class-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  transition: border-color 0.2s;
}
.profile-class-item:hover {
  border-color: rgba(255, 255, 255, 0.16);
}
.class-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.class-item-icon {
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
}
.class-item-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.class-item-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.class-item-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
}
.class-item-time {
  font-size: 11.5px;
  font-weight: 700;
  color: #10b981;
}
.class-item-days-row {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 2px;
}
.class-day-tag {
  font-size: 9.5px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(139, 92, 246, 0.15);
  color: #c4b5fd;
  border: 1px solid rgba(139, 92, 246, 0.3);
}
.class-loc-tag {
  font-size: 10.5px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 3px;
  margin-left: 4px;
}

.class-item-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.btn-class-action {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 7px;
  padding: 5px 8px;
  font-size: 12px;
  cursor: pointer;
  color: var(--text-main);
  transition: all 0.15s;
}
.btn-class-action:hover {
  background: rgba(255, 255, 255, 0.12);
}
.btn-class-action.action-del:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: #ef4444;
  color: #f87171;
}
.btn-class-action.action-remind:hover {
  background: rgba(245, 158, 11, 0.15);
  border-color: #f59e0b;
  color: #fbbf24;
}

.btn-open-add-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 10px;
  margin-top: 10px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px dashed rgba(16, 185, 129, 0.35);
  border-radius: 12px;
  color: #34d399;
  font-size: 12.5px;
  font-weight: 700;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.2s;
}
.btn-open-add-slot:hover {
  background: rgba(16, 185, 129, 0.16);
  border-color: #10b981;
}

.extra-slot-action-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 4px;
  opacity: 0.7;
  transition: opacity 0.15s;
  font-size: 12px;
}
.extra-slot-action-btn:hover { opacity: 1; }

/* ==========================================================================
   CSS CHO TÍNH NĂNG ĐỒNG BỘ LỊCH HỌC & HIỂN THỊ BADGE TRỰC QUAN TRÊN TAB
   ========================================================================== */

/* Badge môn học thêm trên Tab ngày */
.tab-extra-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(168, 85, 247, 0.18);
  border: 1px solid rgba(168, 85, 247, 0.45);
  color: #c084fc;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  margin-top: 3px;
  letter-spacing: 0.02em;
  box-shadow: 0 0 8px rgba(168, 85, 247, 0.2);
  white-space: nowrap;
}
.tab-extra-badge .extra-badge-dot {
  color: #a855f7;
  font-size: 8px;
  line-height: 1;
}
.day-tab-btn.active .tab-extra-badge {
  background: rgba(168, 85, 247, 0.32);
  border-color: #c084fc;
  color: #f3e8ff;
}

/* Tab Thứ 7 & Chủ Nhật linh hoạt */
.day-tab-btn.day-tab-weekend {
  border-color: rgba(251, 191, 36, 0.3);
}
.day-tab-btn.day-tab-weekend .day-name {
  color: #fbbf24;
}
.day-tab-btn.day-tab-weekend.active {
  border-color: #fbbf24;
  box-shadow: 0 0 16px rgba(251, 191, 36, 0.25);
}

/* Banner thông báo đồng bộ hồ sơ thành công */
.shared-import-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.18) 0%, rgba(168, 85, 247, 0.18) 100%);
  border: 1px solid rgba(129, 140, 248, 0.4);
  border-radius: 14px;
  padding: 12px 16px;
  margin-bottom: 16px;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.12);
  animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.shared-banner-content {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.shared-banner-icon {
  font-size: 22px;
  flex-shrink: 0;
}
.shared-banner-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
  color: var(--text-main, #ffffff);
}
.shared-banner-text strong {
  font-weight: 700;
  color: #e0e7ff;
}
.shared-banner-sub {
  font-size: 12px;
  color: #c7d2fe;
  opacity: 0.9;
  line-height: 1.35;
}
.shared-banner-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.shared-banner-btn {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.shared-banner-btn:hover {
  background: rgba(255, 255, 255, 0.22);
}
.shared-banner-close {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 16px;
  padding: 4px 8px;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.15s;
}
.shared-banner-close:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

/* Tóm tắt danh sách môn học trong Modal Chia sẻ */
.share-classes-summary-list {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line, rgba(255, 255, 255, 0.08));
  border-radius: 10px;
  padding: 8px 12px;
  margin: 10px 0;
  max-height: 120px;
  overflow-y: auto;
}
.share-summary-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  padding: 4px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.06);
}
.share-summary-item:last-child {
  border-bottom: none;
}
.share-summary-meta {
  color: var(--text-muted, #94a3b8);
  font-size: 11px;
}
.share-summary-empty {
  font-size: 12px;
  color: var(--text-muted, #94a3b8);
  text-align: center;
  padding: 6px 0;
}

.weekend-summary-header {
  border-color: rgba(251, 191, 36, 0.25) !important;
}

/* ==========================================================================
   ĐỒNG BỘ LỊCH HỌC 2 CHIỀU & MA TRẬN 7 NGÀY (THỨ 7 / CHỦ NHẬT)
   ========================================================================== */
.btn-sync-header {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-sync-header:hover {
  background: rgba(16, 185, 129, 0.24);
  border-color: #34d399;
  color: #ffffff;
  transform: translateY(-1px);
}
.btn-sync-header:active {
  transform: translateY(0);
}
.btn-sync-header.syncing .sync-spin-icon {
  animation: syncSpin 0.75s linear infinite;
}
@keyframes syncSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.btn-sync-profile {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-sync-profile:hover {
  background: rgba(16, 185, 129, 0.25);
  color: #ffffff;
}

.share-sync-badge-box {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(6, 78, 59, 0.16) 100%);
  border: 1.5px solid rgba(16, 185, 129, 0.35);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 14px;
}
.sync-code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.sync-code-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #34d399;
}
.sync-live-tag {
  font-size: 10px;
  font-weight: 700;
  color: #10b981;
  background: rgba(16, 185, 129, 0.2);
  padding: 2px 7px;
  border-radius: 10px;
}
.sync-code-display {
  background: rgba(0, 0, 0, 0.35);
  border: 1px dashed rgba(16, 185, 129, 0.4);
  border-radius: 8px;
  padding: 9px 12px;
  text-align: center;
  margin-bottom: 8px;
}
.sync-code-display code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #a7f3d0;
}
.share-sync-hint {
  font-size: 12px;
  color: var(--text-muted, #94a3b8);
  line-height: 1.45;
  margin: 0;
}

/* Cột cuối tuần & Lịch học thêm trong Lưới cả tuần */
.col-weekend {
  background: rgba(251, 191, 36, 0.03);
}
.th-day-weekend {
  color: #fbbf24 !important;
}
.weekend-badge-th {
  font-size: 9px;
  font-weight: 700;
  color: #fbbf24;
  letter-spacing: 0.04em;
  opacity: 0.85;
}
.matrix-weekend-off {
  color: var(--text-dim, #64748b);
  font-size: 11.5px;
  opacity: 0.4;
  font-style: italic;
}
.matrix-extra-cell {
  vertical-align: top;
  padding: 6px 4px !important;
}
.matrix-extra-pill {
  display: inline-flex;
  flex-direction: column;
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #6ee7b7;
  padding: 4px 6px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 4px;
  width: 100%;
  box-sizing: border-box;
  text-align: left;
  line-height: 1.25;
}
.matrix-extra-pill .extra-pill-time {
  font-size: 9.5px;
  color: #a7f3d0;
  opacity: 0.85;
  font-weight: normal;
  margin-top: 2px;
}

/* ============================================================================
   V0.13.0 — COUNTDOWN ALERT COLORS, SMART INFO, ACTION BUTTON, CONFIRM POPUP
   ============================================================================ */

/* 1. Dong ho dem nguoc: Button clickable (thay div) */
button.hero-cd-val {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: opacity 0.15s;
}
button.hero-cd-val:hover { opacity: 0.85; }
button.hero-cd-val:focus-visible {
  outline: 2px solid rgba(16, 185, 129, 0.6);
  outline-offset: 4px;
  border-radius: 4px;
}

/* 2. Canh bao mau cam (con 15 phut) */
.cd-alert-amber .hero-cd-val,
.hero-cd-val.cd-alert-amber {
  color: #fb923c !important;
  text-shadow: 0 0 30px rgba(249, 115, 22, 0.65), 0 0 60px rgba(249, 115, 22, 0.3) !important;
  animation: cdAmberPulse 1.8s ease-in-out infinite;
}
.cd-alert-amber.hero-countdown-box {
  border-color: rgba(249, 115, 22, 0.5) !important;
  box-shadow: inset 0 0 25px rgba(249, 115, 22, 0.12), 0 8px 25px rgba(0,0,0,0.3), 0 0 0 1px rgba(249,115,22,0.2) !important;
  background: rgba(20, 10, 3, 0.75) !important;
}
@keyframes cdAmberPulse {
  0%, 100% { text-shadow: 0 0 20px rgba(249, 115, 22, 0.5); }
  50% { text-shadow: 0 0 40px rgba(249, 115, 22, 0.85), 0 0 70px rgba(249, 115, 22, 0.4); }
}

/* 3. Canh bao mau do (con 5 phut) */
.cd-alert-red .hero-cd-val,
.hero-cd-val.cd-alert-red {
  color: #ef4444 !important;
  text-shadow: 0 0 30px rgba(239, 68, 68, 0.7), 0 0 60px rgba(239, 68, 68, 0.4) !important;
  animation: cdRedPulse 0.9s ease-in-out infinite;
}
.cd-alert-red.hero-countdown-box {
  border-color: rgba(239, 68, 68, 0.6) !important;
  box-shadow: inset 0 0 30px rgba(239, 68, 68, 0.15), 0 8px 25px rgba(0,0,0,0.3), 0 0 0 1.5px rgba(239,68,68,0.3) !important;
  background: rgba(20, 3, 3, 0.8) !important;
}
@keyframes cdRedPulse {
  0%, 100% { text-shadow: 0 0 20px rgba(239, 68, 68, 0.6); }
  50% { text-shadow: 0 0 45px rgba(239, 68, 68, 0.9), 0 0 80px rgba(239, 68, 68, 0.5); }
}

/* 4. Smart info chips: thong tin thong minh duoi dong ho */
.hero-smart-info {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.hero-smart-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--chip-color, #6ee7b7);
  background: color-mix(in srgb, var(--chip-color, #10b981) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--chip-color, #10b981) 35%, transparent);
  border-radius: 20px;
  padding: 3px 10px;
  white-space: nowrap;
  line-height: 1.4;
}
a.hero-smart-chip--link {
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
a.hero-smart-chip--link:hover {
  background: color-mix(in srgb, var(--chip-color, #10b981) 22%, transparent);
  border-color: color-mix(in srgb, var(--chip-color, #10b981) 55%, transparent);
}
.hero-smart-chip strong { font-weight: 800; }

/* 5. Action button: nut xac nhan noi bat (slide-up) */
.hero-action-area {
  display: flex;
  margin-top: 8px;
  animation: slideUpFade 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes slideUpFade {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.btn-hero-action {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.25) 0%, rgba(6, 182, 212, 0.15) 100%);
  border: 1.5px solid rgba(16, 185, 129, 0.55);
  color: #6ee7b7;
  font-size: 13px;
  font-weight: 700;
  padding: 9px 18px;
  border-radius: 24px;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: all 0.2s;
  backdrop-filter: blur(8px);
}
.btn-hero-action:hover {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.38) 0%, rgba(6, 182, 212, 0.22) 100%);
  border-color: rgba(16, 185, 129, 0.8);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.25);
}
.btn-hero-action.confirmed {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, transparent 100%);
  border-color: rgba(16, 185, 129, 0.35);
  color: #a7f3d0;
  cursor: default;
  font-weight: 600;
  font-size: 12px;
}
.btn-hero-action.confirmed:hover { transform: none; box-shadow: none; }

/* 6. Confirm popup overlay */
.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 20000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 0 env(safe-area-inset-bottom, 0);
  animation: overlayFadeIn 0.2s ease;
}
.confirm-overlay[hidden] { display: none; }
@keyframes overlayFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.confirm-sheet {
  background: linear-gradient(160deg, #0f1f1a 0%, #071310 100%);
  border: 1.5px solid rgba(16, 185, 129, 0.3);
  border-bottom: none;
  border-radius: 24px 24px 0 0;
  padding: 24px 20px 32px;
  width: 100%;
  max-width: 480px;
  animation: sheetSlideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 -12px 48px rgba(0, 0, 0, 0.5);
}
@keyframes sheetSlideUp {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.confirm-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.confirm-icon { font-size: 28px; flex-shrink: 0; }
.confirm-title {
  flex: 1;
  font-size: 18px;
  font-weight: 800;
  color: #ffffff;
  margin: 0;
}
.confirm-close {
  background: rgba(255,255,255,0.08);
  border: none;
  color: rgba(255,255,255,0.6);
  width: 32px; height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}
.confirm-close:hover { background: rgba(255,255,255,0.15); }
.confirm-desc {
  font-size: 14px;
  color: rgba(255,255,255,0.7);
  margin: 0 0 16px;
  line-height: 1.5;
}
.confirm-choices {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.confirm-choice-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.1);
  border: 1.5px solid rgba(16, 185, 129, 0.3);
  border-radius: 14px;
  color: #a7f3d0;
  font-size: 14px;
  font-weight: 700;
  padding: 14px 10px;
  cursor: pointer;
  transition: all 0.18s;
}
.confirm-choice-btn:hover {
  background: rgba(16, 185, 129, 0.22);
  border-color: rgba(16, 185, 129, 0.6);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.2);
}
.confirm-choice-btn:active { transform: scale(0.96); }
.confirm-gps-note {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: rgba(255,255,255,0.35);
  margin: 10px 0 0;
}
.confirm-undo-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 20px;
  cursor: pointer;
  margin-top: 12px;
  transition: all 0.18s;
}
.confirm-undo-btn:hover { background: rgba(239, 68, 68, 0.2); border-color: rgba(239, 68, 68, 0.5); }
.confirm-undo-btn[hidden] { display: none; }

/* 7. Toast nhanh */
.tkb-toast-msg {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(16, 185, 129, 0.95);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 20px;
  border-radius: 24px;
  z-index: 25000;
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
  white-space: nowrap;
}
.tkb-toast-msg.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Theme overrides cho alert colors */
body[data-theme="light"] .cd-alert-amber .hero-cd-val,
body[data-theme="light"] .hero-cd-val.cd-alert-amber { color: #ea580c !important; }
body[data-theme="light"] .cd-alert-red .hero-cd-val,
body[data-theme="light"] .hero-cd-val.cd-alert-red { color: #dc2626 !important; }
body[data-theme="light"] .confirm-sheet {
  background: linear-gradient(160deg, #f0fdf4 0%, #ecfdf5 100%);
  border-color: rgba(16, 185, 129, 0.4);
}
body[data-theme="light"] .confirm-title { color: #064e3b; }
body[data-theme="light"] .confirm-desc { color: rgba(0,0,0,0.65); }
body[data-theme="light"] .confirm-choice-btn { background: rgba(16, 185, 129, 0.08); color: #065f46; }
body[data-theme="princess"] .cd-alert-amber .hero-cd-val,
body[data-theme="princess"] .hero-cd-val.cd-alert-amber { color: #f97316 !important; }
body[data-theme="princess"] .cd-alert-red .hero-cd-val,
body[data-theme="princess"] .hero-cd-val.cd-alert-red { color: #ef4444 !important; }

/* Styles cho Mã Lớp Học & Gói Bản Quyền Thương Mại */
.badge-class-btn {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #6ee7b7;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.04em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
  vertical-align: middle;
  margin-left: 6px;
}
.badge-class-btn:hover {
  background: rgba(16, 185, 129, 0.25);
  border-color: #10b981;
  color: #ffffff;
  transform: translateY(-1px);
}

/* NÚT ĐĂNG NHẬP / TÀI KHOẢN PHỤ HUYNH TRÊN HEADER (ĐÃ TẮT THEO YÊU CẦU: CHUYỂN VÀO THIẾT LẬP CHUNG) */
.btn-parent-auth,
#btn-parent-auth {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  opacity: 0 !important;
  width: 0 !important;
  height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
}

.license-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.license-badge.badge-pro {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #000000;
}
.license-badge.badge-free {
  background: rgba(255, 255, 255, 0.1);
  color: #94a3b8;
}
.btn-upgrade-pro {
  background: linear-gradient(135deg, #f59e0b 0%, #b45309 100%);
  color: #ffffff;
  border: none;
  font-size: 12px;
  font-weight: 800;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}
.btn-upgrade-pro:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4);
}

/* NÚT ĐĂNG NHẬP / TÀI KHOẢN PHỤ HUYNH TRÊN HEADER */
.btn-parent-auth {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(2, 132, 199, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 20px;
  cursor: pointer;
  color: #38bdf8;
  font-size: 12px;
  font-family: var(--font-sans);
  font-weight: 700;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.btn-parent-auth:hover {
  background: rgba(2, 132, 199, 0.25);
  border-color: #38bdf8;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
}
.btn-parent-auth.logged-in {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(52, 211, 153, 0.4);
  color: #34d399;
}

/* THANH CHỌN BÉ NHANH GIA ĐÌNH */
.family-child-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  margin-bottom: 14px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  width: 100%;
  box-sizing: border-box;
}

.child-tabs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.child-tab-card,
.child-pill {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
  min-width: 0;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  font-family: inherit;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.child-tab-card:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.2);
}

.child-tab-card.active {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.25) 0%, rgba(14, 165, 233, 0.15) 100%);
  border: 1.5px solid #38bdf8;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.25);
}

.child-tab-top {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.child-tab-avatar {
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.child-tab-name {
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
  color: inherit;
}

.child-tab-dot {
  font-size: 9.5px;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.2);
  padding: 1px 6px;
  border-radius: 99px;
  flex-shrink: 0;
}

.child-tab-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  opacity: 0.85;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.child-tab-class {
  font-weight: 600;
  color: #93c5fd;
}

.child-tab-meal {
  display: inline-block;
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
}
.child-tab-meal.meal-full {
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.15);
}
.child-tab-meal.meal-noon {
  color: #fde68a;
  background: rgba(245, 158, 11, 0.2);
}

.btn-add-child-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
  align-self: stretch;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
}

.btn-add-child-action:hover {
  border-color: #38bdf8;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
}

/* Tùy chọn Bán trú vs Trưa về nhà trong Modal */
.meal-plan-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 4px;
}
.btn-meal-plan-opt {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
}
.btn-meal-plan-opt .meal-plan-title {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
}
.btn-meal-plan-opt .meal-plan-desc {
  font-size: 11px;
  color: var(--text-muted);
}
.btn-meal-plan-opt:hover {
  background: rgba(255, 255, 255, 0.08);
}
.btn-meal-plan-opt.active {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.15);
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.2);
}
.btn-meal-plan-opt.active .meal-plan-desc {
  color: #a7f3d0;
}
.btn-meal-plan-opt[data-meal-plan="noon_home"].active {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.15);
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.2);
}
.btn-meal-plan-opt[data-meal-plan="noon_home"].active .meal-plan-desc {
  color: #fde68a;
}

/* NÚT ĐĂNG NHẬP PHỤ HUYNH GIA ĐÌNH (ẨN HOÀN TOÀN) */
.btn-parent-auth,
#btn-parent-auth {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  opacity: 0 !important;
  width: 0 !important;
  height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
}

/* AUTH MODAL TABS */
.auth-tab-btn {
  transition: all 0.2s ease;
}
.auth-tab-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #ffffff !important;
}

@media (max-width: 768px) {
  .btn-parent-auth,
  #btn-parent-auth,
  .profile-chip-btn,
  #profile-active-chip {
    display: none !important;
  }

  .family-child-bar {
    padding: 6px 8px;
    gap: 6px;
    margin-bottom: 10px;
  }
  .child-tabs-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }
  .child-tab-card {
    padding: 6px 8px;
    border-radius: 8px;
  }
  .child-tab-name {
    font-size: 12.5px;
  }
  .child-tab-sub {
    font-size: 10px;
    gap: 4px;
  }
  .child-tab-dot {
    display: none !important;
  }
  .btn-add-child-action {
    padding: 6px 8px !important;
    min-width: 36px !important;
    width: 36px !important;
    justify-content: center !important;
  }
  .btn-add-child-action .btn-add-child-text {
    display: none !important;
  }
}

body[data-theme="light"] .child-tab-card {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.1);
  color: #475569;
}
body[data-theme="light"] .child-tab-card.active {
  background: #eff6ff;
  border-color: #0284c7;
  color: #0369a1;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.15);
}
body[data-theme="light"] .family-child-bar {
  background: #f8fafc;
  border-color: rgba(0, 0, 0, 0.08);
}

/* ==========================================================================
   TÍNH NĂNG GIỜ NGỦ VÀNG THÔNG MINH (SMART BEDTIME ROUTINE)
   ========================================================================== */
.hero-bedtime-status {
  display: flex;
  justify-content: center;
  margin-top: 8px;
  width: 100%;
}
.hero-bedtime-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid rgba(168, 85, 247, 0.35);
  border-radius: 20px;
  color: #e9d5ff;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  box-shadow: 0 2px 8px rgba(168, 85, 247, 0.15);
  transition: all 0.2s ease;
}
.hero-bedtime-chip .stroke-icon {
  width: 14px;
  height: 14px;
  stroke: #c084fc;
  flex-shrink: 0;
}
.hero-bedtime-chip strong {
  color: #ffffff;
  font-weight: 700;
}

/* Hub card bedtime */
.hub-card-bedtime {
  border-color: rgba(168, 85, 247, 0.3) !important;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.08) 0%, rgba(30, 27, 75, 0.3) 100%) !important;
}
.hub-card-icon-box.icon-purple {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border-color: rgba(168, 85, 247, 0.35);
}
.hub-card-bedtime .hub-card-tag {
  color: #c084fc;
}

/* Theme light overrides */
body[data-theme="light"] .hero-bedtime-chip {
  background: #f3e8ff;
  border-color: #d8b4fe;
  color: #6b21a8;
}
body[data-theme="light"] .hero-bedtime-chip .stroke-icon {
  stroke: #7c3aed;
}
body[data-theme="light"] .hero-bedtime-chip strong {
  color: #581c87;
}
body[data-theme="light"] .hub-card-bedtime {
  border-color: #d8b4fe !important;
  background: #faf5ff !important;
}
body[data-theme="light"] .hub-card-icon-box.icon-purple {
  background: #f3e8ff;
  color: #7c3aed;
  border-color: #d8b4fe;
}
/* Mobile responsive optimizations for Settings and Profile cards */
@media (max-width: 480px) {
  .profile-card-header-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .profile-card-identity {
    width: 100%;
  }
  .profile-card-top-actions {
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
  }
  .profile-card-school-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .btn-profile-change-school {
    align-self: flex-end;
  }
}

