/* ─── Design Tokens ─── */
:root {
  --blush:        #FCF6F2;
  --card:         #FFFFFF;
  --plum:         #2A0E2E;
  --plum-mid:     #5C2860;
  --plum-lt:      #EDE4F0;
  --champagne:    #C09838;
  --champ-lt:     #EDD8A0;
  --champ-glow:   rgba(192, 152, 56, 0.13);
  --rose:         #C83C58;
  --sage:         #2E7A60;
  --text:         #1C0820;
  --text-mid:     #6A3868;
  --text-muted:   #A080A0;
  --shadow:       0 4px 28px rgba(42, 14, 46, 0.10);
  --shadow-sm:    0 2px 14px rgba(42, 14, 46, 0.07);
  --radius:       20px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

body {
  font-family: 'Noto Sans SC', sans-serif;
  background: var(--blush);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

.hidden { display: none !important; }

/* ─── Loading Screen ─── */
#loading-screen {
  position: fixed; inset: 0;
  background: linear-gradient(155deg, var(--plum) 0%, #4A1848 100%);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
}

.loader-wrap {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  color: white;
}

.loader-logo { font-size: 52px; animation: pulse 2s ease-in-out infinite; }
.loader-brand { font-size: 18px; font-weight: 900; color: var(--champ-lt); letter-spacing: 0.04em; }
.loader-sub { font-size: 12px; color: rgba(237,216,160,0.5); margin-bottom: 8px; }

.loader-spinner {
  width: 28px; height: 28px;
  border: 2.5px solid rgba(237,216,160,0.2);
  border-top-color: var(--champagne);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.08); } }

/* ─── Login Screen ─── */
#login-screen {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: linear-gradient(155deg, var(--plum) 0%, #4A1848 60%, #3A0C3E 100%);
}

.login-card {
  background: white;
  border-radius: 24px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 32px 64px rgba(0,0,0,0.35);
  overflow: hidden;
  animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.login-header {
  background: linear-gradient(155deg, var(--plum), #4A1848);
  padding: 32px 28px 24px;
  text-align: center;
  position: relative;
}

.login-header::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 60% 0%, rgba(192,152,56,0.18) 0%, transparent 65%);
  pointer-events: none;
}

.login-icon { font-size: 40px; margin-bottom: 10px; display: block; }

.login-header h1 {
  font-size: 20px; font-weight: 900;
  color: #FDF6FF; letter-spacing: 0.02em;
  position: relative; z-index: 1;
}

.login-header p {
  font-size: 11px; color: var(--champ-lt); opacity: 0.6;
  margin-top: 4px; letter-spacing: 0.08em;
  position: relative; z-index: 1;
}

.login-body { padding: 28px; display: flex; flex-direction: column; gap: 16px; }

.login-error {
  background: #fef2f2; border: 1px solid #fca5a5;
  color: #b91c1c; font-size: 13px; font-weight: 600;
  padding: 10px 14px; border-radius: 10px;
}

.form-field { display: flex; flex-direction: column; gap: 6px; }

.form-field label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
  color: var(--text-muted); text-transform: uppercase;
}

.form-field input {
  padding: 12px 14px;
  border: 1.5px solid var(--plum-lt);
  border-radius: 12px;
  font-size: 14px; font-weight: 600;
  font-family: 'Noto Sans SC', sans-serif;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: var(--blush);
}

.form-field input:focus {
  border-color: var(--plum-mid);
  box-shadow: 0 0 0 3px rgba(92,40,96,0.10);
  background: white;
}

#login-btn {
  width: 100%; padding: 13px;
  background: linear-gradient(135deg, var(--plum), var(--plum-mid));
  color: white; font-weight: 900; font-size: 14px;
  border: none; border-radius: 12px;
  cursor: pointer; letter-spacing: 0.03em;
  box-shadow: 0 6px 20px rgba(42,14,46,0.25);
  transition: opacity 0.2s, transform 0.1s;
}

#login-btn:hover { opacity: 0.92; }
#login-btn:active { transform: scale(0.98); }
#login-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.login-footer {
  padding: 16px 28px;
  font-size: 11px; color: var(--text-muted);
  text-align: center; border-top: 1px solid var(--plum-lt);
  background: #FBF5FF;
}

/* ─── Sibling Switcher Bar ─── */
#sibling-bar {
  background: var(--card);
  border-bottom: 1px solid var(--plum-lt);
  padding: 10px 16px;
  position: sticky;
  top: 74px;
  z-index: 90;
  box-shadow: 0 2px 8px rgba(42,14,46,0.06);
}

#sibling-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
#sibling-pills::-webkit-scrollbar { display: none; }

.sibling-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px 6px 8px;
  border-radius: 24px;
  border: 1.5px solid var(--plum-lt);
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.18s;
  font-family: 'Noto Sans SC', sans-serif;
}

.sibling-pill.active {
  background: var(--plum);
  border-color: var(--plum);
  color: var(--champ-lt);
}

.pill-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--plum-lt);
  color: var(--plum-mid);
  font-size: 11px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sibling-pill.active .pill-avatar {
  background: rgba(255,255,255,0.15);
  color: var(--champ-lt);
}

/* ─── Main App ─── */
#parent-app {
  max-width: 500px; margin: 0 auto;
  min-height: 100vh; position: relative;
  padding-bottom: 88px;
}

/* ─── Header ─── */
.top-bar {
  background: linear-gradient(155deg, var(--plum) 0%, #4A1848 50%, #3A0C3E 100%);
  padding: 0 20px 18px;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 6px 32px rgba(30, 8, 34, 0.30);
}

.top-bar::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 60% 0%, rgba(192,152,56,0.15) 0%, transparent 65%);
  pointer-events: none;
}

.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 16px;
  position: relative; z-index: 1;
}

.center-tag {
  position: absolute; top: 8px; left: 50%;
  transform: translateX(-50%);
  font-size: 9px; font-weight: 700; letter-spacing: 0.14em;
  color: var(--champ-lt); opacity: 0.5;
  text-transform: uppercase; white-space: nowrap;
}

.child-info { display: flex; align-items: center; gap: 11px; margin-top: 6px; flex: 1 1 auto; min-width: 0; }
.child-text { min-width: 0; flex: 1 1 auto; }

.avatar-ring {
  width: 46px; height: 46px; border-radius: 50%;
  overflow: hidden; border: 2px solid var(--champagne);
  box-shadow: 0 0 0 3px rgba(192,152,56,0.20);
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--plum-mid), var(--plum));
  display: flex; align-items: center; justify-content: center;
}

.avatar-initial {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px; font-weight: 700;
  color: var(--champ-lt);
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
}

.child-greet {
  font-size: 11px; font-weight: 700; letter-spacing: 0.02em;
  color: var(--champ-lt); opacity: 0.7;
  margin-bottom: 1px;
}

.child-name {
  font-size: 16px; font-weight: 900; color: #FDF6FF;
  /* 名字过长时省略号，不再撑动整行 / 挤压右侧按钮 */
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; text-overflow: ellipsis;
  line-height: 1.2;
}
.child-level { display: flex; align-items: center; gap: 5px; font-size: 10.5px; color: var(--champ-lt); opacity: 0.6; margin-top: 2px; }
.level-pip { width: 5px; height: 5px; border-radius: 50%; background: var(--champagne); flex-shrink: 0; }

.logout-btn {
  background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.10);
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; cursor: pointer; color: var(--champ-lt);
  margin-top: 4px;
}

/* ─── Pages ─── */
.content { padding: 16px; }

.page { display: none; }
.page.active { display: block; }

.page-loading {
  display: flex; align-items: center; justify-content: center;
  padding: 60px 0;
}

.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--plum-lt);
  border-top-color: var(--plum-mid);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ─── Cards ─── */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}

/* ─── Profile Tab ─── */
.profile-hero {
  background: linear-gradient(155deg, var(--plum), #4A1848);
  border-radius: var(--radius);
  padding: 32px 24px 28px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  margin-bottom: 14px;
  position: relative; overflow: hidden;
  box-shadow: var(--shadow);
}

.profile-hero::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 70% 0%, rgba(192,152,56,0.18) 0%, transparent 65%);
  pointer-events: none;
}

.profile-avatar {
  width: 80px; height: 80px; border-radius: 50%;
  background: rgba(255,255,255,0.10);
  border: 2.5px solid var(--champagne);
  box-shadow: 0 0 0 4px rgba(192,152,56,0.18);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Cormorant Garamond', serif;
  font-size: 36px; font-weight: 700;
  color: var(--champ-lt);
  position: relative; z-index: 1;
}

.profile-name {
  font-size: 22px; font-weight: 900; color: #FDF6FF;
  letter-spacing: 0.02em;
  position: relative; z-index: 1;
}

.profile-name-zh {
  font-size: 16px; font-weight: 700; color: var(--champ-lt); opacity: 0.85;
  position: relative; z-index: 1;
}

.profile-badges {
  display: flex; gap: 8px; align-items: center;
  position: relative; z-index: 1;
}

.level-badge {
  background: var(--champagne); color: white;
  font-size: 11px; font-weight: 900;
  padding: 4px 12px; border-radius: 20px;
  letter-spacing: 0.05em;
}

.enroll-badge {
  font-size: 11px; font-weight: 700;
  padding: 4px 10px; border-radius: 20px;
}

.status-active  { background: rgba(46,122,96,0.3);  color: #7ED4B0; }
.status-warn    { background: rgba(200,60,88,0.3);   color: #F4A0B0; }
.status-muted   { background: rgba(255,255,255,0.10); color: rgba(255,255,255,0.5); }

.vip-badge {
  display: flex; align-items: center; gap: 8px;
  background: rgba(192,152,56,0.18); border: 1px solid rgba(192,152,56,0.30);
  border-radius: 20px; padding: 5px 14px;
  font-size: 11px; font-weight: 700; color: var(--champ-lt);
  position: relative; z-index: 1;
}

.vip-expiry { opacity: 0.65; font-weight: 500; }

.regular-badge {
  font-size: 11px; font-weight: 700;
  color: rgba(255,255,255,0.4);
  position: relative; z-index: 1;
}

/* Info Card */
.info-card { padding: 4px 0; }

.info-row {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 20px;
  border-bottom: 1px solid #F5EEF8;
}

.info-row:last-child { border-bottom: none; }

.info-icon { font-size: 18px; flex-shrink: 0; width: 24px; text-align: center; }
.info-label { font-size: 11.5px; font-weight: 700; color: var(--text-muted); width: 72px; flex-shrink: 0; }
.info-value { font-size: 13.5px; font-weight: 600; color: var(--text); flex: 1; }

/* ─── Monthly Fee Calendar (学费目录) ─── */
.fee-cal-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 16px 20px;
  margin-bottom: 14px;
}

.fee-cal-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}

.fee-cal-title {
  font-size: 14.5px; font-weight: 900; color: var(--plum);
  display: flex; align-items: center; gap: 6px;
}

.fee-cal-legend { display: flex; gap: 10px; }
.fee-legend-item { display: flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 700; color: var(--text-muted); }
.fee-legend-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.fee-legend-dot.paid   { background: var(--sage); }
.fee-legend-dot.unpaid { background: var(--rose); }

.fee-month-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.fee-month-cell {
  border: 1.5px solid var(--plum-lt);
  border-radius: 12px;
  padding: 10px 6px 9px;
  text-align: center;
  background: #FBF7FC;
}

.fee-month-cell.future { opacity: 0.5; }

.fee-month-name {
  font-size: 13px; font-weight: 800; color: var(--text); margin-bottom: 5px;
}

.fee-month-status {
  font-size: 10.5px; font-weight: 800; line-height: 1.3;
}

.fee-month-amount {
  font-size: 10px; color: var(--text-muted); margin-top: 2px; font-weight: 600;
}

.fee-month-cell.paid {
  background: rgba(46,122,96,0.10);
  border-color: rgba(46,122,96,0.30);
}
.fee-month-cell.paid .fee-month-status { color: var(--sage); }

.fee-month-cell.unpaid {
  background: rgba(200,60,88,0.08);
  border-color: rgba(200,60,88,0.30);
}
.fee-month-cell.unpaid .fee-month-status { color: var(--rose); }

.fee-month-cell.none .fee-month-status { color: var(--text-muted); }

/* ─── Records Tab ─── */
.records-summary {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex; align-items: stretch;
  margin-bottom: 14px;
  overflow: hidden;
}

.summary-cell {
  flex: 1; padding: 20px 16px;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
}

.summary-divider { width: 1px; background: var(--plum-lt); margin: 16px 0; }

.summary-label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.07em;
  color: var(--text-muted); text-transform: uppercase;
}

.summary-amount {
  font-family: 'Cormorant Garamond', serif;
  font-size: 26px; font-weight: 700;
}

.summary-amount.paid   { color: var(--sage); }
.summary-amount.unpaid { color: var(--rose); }

.filter-bar {
  display: flex; gap: 8px;
  margin-bottom: 14px;
}

.filter-btn {
  flex: 1;
  padding: 8px 0;
  border: 1.5px solid var(--plum-lt);
  border-radius: 50px;
  background: var(--card);
  color: var(--text-mid);
  font-size: 13px; font-weight: 700;
  font-family: 'Noto Sans SC', sans-serif;
  cursor: pointer;
  transition: all 0.18s ease;
}

.filter-btn.active {
  background: var(--plum-mid);
  border-color: var(--plum-mid);
  color: #fff;
  box-shadow: 0 3px 10px rgba(92,40,96,0.25);
}

.invoice-list { display: flex; flex-direction: column; gap: 10px; }

.invoice-row {
  background: var(--card);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  display: flex; align-items: stretch;
  overflow: hidden;
  animation: fadeUp 0.3s ease both;
}

.inv-status-bar { width: 4px; flex-shrink: 0; }
.bar-paid   { background: var(--sage); }
.bar-unpaid { background: var(--rose); }

.inv-body { flex: 1; padding: 14px 12px 14px 14px; display: flex; flex-direction: column; gap: 5px; }

.inv-top { display: flex; justify-content: space-between; align-items: center; }

.inv-number {
  font-family: monospace; font-size: 11px; font-weight: 700;
  color: var(--text-muted);
}

.inv-badge {
  font-size: 10.5px; font-weight: 800;
  padding: 2px 9px; border-radius: 12px;
}

.badge-paid   { background: rgba(46,122,96,0.12);  color: var(--sage); }
.badge-unpaid { background: rgba(200,60,88,0.10);   color: var(--rose); }

.inv-desc { font-size: 13.5px; font-weight: 700; color: var(--text); }

.inv-bottom { display: flex; justify-content: space-between; align-items: center; margin-top: 2px; }

.inv-date { font-size: 11px; color: var(--text-muted); }

.inv-amount {
  font-family: 'Cormorant Garamond', serif;
  font-size: 18px; font-weight: 700; color: var(--champagne);
}

.inv-view-btn {
  align-self: center;
  padding: 8px 14px; margin-right: 12px;
  background: var(--plum-lt); color: var(--plum-mid);
  border: none; border-radius: 10px;
  font-size: 11.5px; font-weight: 800;
  cursor: pointer; white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s;
}

.inv-view-btn:active { background: #DDD0E8; }

.empty-state {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 48px 0; color: var(--text-muted); font-size: 14px; font-weight: 600;
}

.empty-icon { font-size: 40px; opacity: 0.4; }

/* ─── Friendly empty-state card (no invoices at all) ─── */
.empty-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 36px 28px 38px;
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  animation: fadeUp 0.3s ease both;
}
.empty-card-icon {
  font-size: 40px;
  width: 72px; height: 72px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--plum-lt);
  margin-bottom: 4px;
}
.empty-card-title {
  font-size: 15px; font-weight: 900; color: var(--plum);
}
.empty-card-sub {
  font-size: 12.5px; font-weight: 600; color: var(--text-muted);
  line-height: 1.55; max-width: 260px;
}

/* ─── "All settled" summary variant (invoices exist, nothing due) ─── */
.records-summary.all-clear {
  background: rgba(46,122,96,0.08);
  border: 1.5px solid rgba(46,122,96,0.22);
  box-shadow: none;
}
.records-summary.all-clear .summary-cell { padding: 16px 16px; gap: 3px; }
.all-clear-title {
  font-size: 16px; font-weight: 900; color: var(--sage);
}
.all-clear-sub {
  font-size: 11.5px; font-weight: 700; color: var(--text-muted);
}

/* ─── Bottom Nav ─── */
.bottom-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 500px; height: 78px;
  background: rgba(252, 246, 242, 0.95);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(92, 40, 96, 0.10);
  display: flex; justify-content: space-around; align-items: center;
  z-index: 200;
  box-shadow: 0 -4px 24px rgba(42,14,46,0.09);
}

.nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  color: var(--text-muted); cursor: pointer;
  background: none; border: none;
  padding: 8px 28px; position: relative;
  transition: color 0.2s;
}

.nav-item.active { color: var(--plum-mid); }
.nav-icon { font-size: 20px; }
.nav-label { font-size: 10px; font-weight: 700; letter-spacing: 0.03em; }

.nav-indicator {
  position: absolute; bottom: -1px; left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 22px; height: 2.5px;
  background: var(--champagne); border-radius: 2px;
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-item.active .nav-indicator { transform: translateX(-50%) scaleX(1); }

/* ─── Animations ─── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Calendar ─── */
.calendar-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px 16px 24px;
  margin: 0 0 16px;
}

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

.calendar-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--plum);
}

.cal-nav-btn {
  background: var(--plum-lt);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 20px;
  color: var(--plum);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.cal-nav-btn:active { opacity: 0.7; }

.calendar-grid-weekdays,
.calendar-grid-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.calendar-grid-weekdays {
  margin-bottom: 6px;
}

.calendar-grid-weekdays > div {
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 4px 0;
}

.cal-day {
  text-align: center;
  padding: 6px 2px 14px 2px;
  border-radius: 10px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s;
  position: relative !important;
}

.cal-day:active { opacity: 0.7; }
.cal-day.empty  { cursor: default; }

.cal-day.has-class {
  background: var(--plum-lt);
  color: var(--plum-mid);
  font-weight: 600;
  box-shadow: inset 0 0 0 1.5px var(--plum-mid);
}

.cal-day.has-class.today,
.cal-day.has-class.selected-day {
  box-shadow: inset 0 0 0 1.5px var(--champ-lt);
}

.cal-day.today {
  background: var(--champagne);
  color: #fff;
  font-weight: 700;
}

.cal-day.selected-day {
  background: var(--plum);
  color: #fff;
  font-weight: 700;
}

/* ─── Calendar Dot Indicators ─── */
.cal-dot-indicator {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  z-index: 2;
}

.dot-present { background: var(--sage) !important; }
.dot-late { background: var(--champagne) !important; }
.dot-leave { background: var(--text-muted) !important; }
.dot-absent { background: var(--rose) !important; }

/* ─── Malaysia Public Holidays (auto) ─── */
.cal-day.public-holiday {
  background: rgba(200, 60, 88, 0.08);
  font-weight: 800;
}
.cal-day.public-holiday .day-num-text { color: var(--rose); }
/* today/selected 时保留其底色，靠右上角小旗子区分公共假期 */
.cal-day.today.public-holiday .day-num-text,
.cal-day.selected-day.public-holiday .day-num-text { color: #fff; }
.cal-holiday-flag {
  position: absolute;
  top: 2px;
  right: 3px;
  font-size: 9px;
  line-height: 1;
  z-index: 2;
  pointer-events: none;
}

.cal-day.selected-day .cal-dot-indicator,
.cal-day.today .cal-dot-indicator {
  box-shadow: 0 0 0 1px white;
}

/* day detail */
.schedule-list-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--plum);
  margin: 16px 0 10px;
}

.schedule-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--plum-lt);
  border-radius: 14px;
  padding: 14px 16px;
}

.schedule-time-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 36px;
}

.schedule-date-num {
  font-size: 22px;
  font-weight: 800;
  color: var(--plum);
  line-height: 1;
}

.schedule-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.schedule-class-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--plum);
}

.schedule-time-range {
  font-size: 13px;
  color: var(--text-mid);
}

/* ─── Notification System Styles ─── */
.lang-btn {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--champ-lt);
  cursor: pointer;
  margin-top: 4px;
  transition: all 0.2s ease;
  font-family: inherit;
}

.lang-btn:active {
  transform: scale(0.92);
}

.noti-btn {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.10);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  color: var(--champ-lt);
  margin-top: 4px;
  position: relative;
  transition: all 0.2s ease;
}

.noti-btn:active {
  transform: scale(0.92);
}

.noti-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--rose);
  color: white;
  font-size: 10px;
  font-weight: 900;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  box-shadow: 0 2px 6px rgba(200,60,88,0.4);
  animation: pulseBadge 2s infinite;
}

@keyframes pulseBadge {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.noti-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  justify-content: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.noti-overlay:not(.hidden) {
  opacity: 1;
  pointer-events: auto;
}

.noti-drawer {
  width: 100%;
  max-width: 420px;
  height: 100%;
  background: var(--blush);
  box-shadow: -10px 0 40px rgba(15, 23, 42, 0.15);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 20px 16px 24px;
}

.noti-overlay:not(.hidden) .noti-drawer {
  transform: translateX(0);
}

.noti-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  border-bottom: 1.5px solid var(--plum-lt);
  padding-bottom: 12px;
}

.noti-drawer-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.noti-drawer-title h2 {
  font-size: 18px;
  font-weight: 900;
  color: var(--plum);
}

.noti-clear-btn {
  background: transparent;
  border: none;
  color: var(--text-mid);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.2s;
}

.noti-clear-btn:hover {
  background: var(--plum-lt);
}

.noti-close-btn {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
}

.noti-close-btn:hover {
  color: var(--plum);
}

.noti-filter-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.noti-filter-bar::-webkit-scrollbar {
  display: none;
}

.noti-filter-btn {
  padding: 6px 12px;
  border: 1.5px solid var(--plum-lt);
  border-radius: 50px;
  background: var(--card);
  color: var(--text-mid);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.noti-filter-btn.active {
  background: var(--plum-mid);
  border-color: var(--plum-mid);
  color: white;
  box-shadow: var(--shadow-sm);
}

.noti-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 2px;
}

.noti-card {
  background: var(--card);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  padding: 14px 16px;
  border-left: 4px solid var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: fadeUp 0.3s ease both;
}

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

.noti-card.unread {
  background: rgba(92, 40, 96, 0.03);
}

.noti-card.unread::after {
  content: '';
  position: absolute;
  top: 14px;
  right: 14px;
  width: 6px;
  height: 6px;
  background: var(--rose);
  border-radius: 50%;
}

.noti-card.type-attendance { border-left-color: var(--sage); }
.noti-card.type-invoice { border-left-color: var(--rose); }
.noti-card.type-makeup { border-left-color: var(--champagne); }
.noti-card.type-holiday { border-left-color: var(--text-mid); }
.noti-card.type-announcement { border-left-color: var(--plum-mid); }

.noti-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.noti-card-title {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--plum);
  display: flex;
  align-items: center;
  gap: 6px;
}

.noti-card-time {
  font-size: 10.5px;
  color: var(--text-muted);
  font-weight: 500;
}

.noti-card-content {
  font-size: 12.5px;
  color: var(--text);
  line-height: 1.5;
  font-weight: 600;
  white-space: pre-wrap;
}

.noti-card-footer {
  font-size: 11px;
  color: var(--text-muted);
  border-top: 1px dashed rgba(92, 40, 96, 0.1);
  padding-top: 6px;
  margin-top: 2px;
}

/* Teacher Attendance View Styles */
.status-btn {
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
  border: 1px solid #cbd5e1;
  background: white;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s;
}
.status-btn.active.val-present { background: #e6fffa; border-color: #319795; color: #007766; }
.status-btn.active.val-late { background: #fffbeb; border-color: #fcd34d; color: #b45309; }
.status-btn.active.val-leave { background: #faf5ff; border-color: #d8b4fe; color: #6b21a8; }
.status-btn.active.val-absent { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }

