:root {
  --primary: #2DD4BF; /* Teal 400 */
  --primary-dark: #14B8A6; /* Teal 500 */
  --primary-light: #CCFBF1;
  --secondary: #FDE047; /* Yellow 300 */
  --accent: #F472B6; /* Pink 400 */
  --art: #A78BFA; /* Purple 400 */
  --gym: #FB923C; /* Orange 400 */
  --mont: #34D399; /* Emerald 400 */
  --text: #334155;
  --text-muted: #94A3B8;
  --bg: #F8FAFC;
  --surface: rgba(255, 255, 255, 0.9);
  --border: #E2E8F0;
  --radius: 20px;
}
* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Nunito', 'Fredoka', sans-serif; -webkit-tap-highlight-color: transparent; }
body { background-color: var(--bg); color: var(--text); padding-bottom: 20px; overflow-x: hidden; }

/* UTILITIES */
.glass { background: var(--surface); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid rgba(255,255,255,0.4); }
.shadow-sm { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03); }
.shadow-md { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025); }

/* SCREENS */
.screen { display: none; width: 100%; min-height: 100vh; animation: fadeIn 0.3s ease; }
.screen.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* HEADER */
.header { position: sticky; top: 0; z-index: 50; padding: 16px 20px; display: flex; justify-content: space-between; align-items: center; border-radius: 0 0 24px 24px; box-shadow: 0 4px 20px rgba(45,212,191,0.15); background: linear-gradient(135deg, #14B8A6, #2DD4BF); color: white; }
.header h1 { font-family: 'Fredoka', sans-serif; font-size: 22px; margin: 0; display: flex; align-items: center; gap: 8px; }
.profile-btn { width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,0.2); border: none; font-size: 20px; cursor: pointer; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(4px); transition: transform 0.2s; }
.profile-btn:active { transform: scale(0.9); }

/* TABS (CAROUSEL-LIKE) */
.tabs-wrapper { padding: 16px 20px 8px; position: sticky; top: 72px; z-index: 40; background: var(--bg); }
.tabs-container { display: flex; gap: 12px; overflow-x: auto; scrollbar-width: none; padding-bottom: 8px; }
.tabs-container::-webkit-scrollbar { display: none; }
.tab-btn { flex: 0 0 auto; padding: 10px 20px; border-radius: 30px; font-weight: 700; font-size: 15px; border: 2px solid var(--border); background: white; color: var(--text-muted); cursor: pointer; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.tab-btn.active { border-color: transparent; color: white; box-shadow: 0 4px 12px rgba(0,0,0,0.1); transform: translateY(-2px); }
.tab-btn[data-cat="蒙式空間"].active { background: var(--mont); box-shadow: 0 4px 12px rgba(52,211,153,0.3); }
.tab-btn[data-cat="ART"].active { background: var(--art); box-shadow: 0 4px 12px rgba(167,139,250,0.3); }
.tab-btn[data-cat="GYM"].active { background: var(--gym); box-shadow: 0 4px 12px rgba(251,146,60,0.3); }

/* COMPACT CALENDAR */
.calendar-wrapper { margin: 0 20px 16px; border-radius: 24px; padding: 16px; background: white; border: 1px solid var(--border); }
.cal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.cal-month { font-weight: 800; font-size: 18px; color: var(--text); }
.cal-nav { background: var(--bg); border: none; width: 32px; height: 32px; border-radius: 12px; font-weight: bold; color: var(--primary-dark); cursor: pointer; display: flex; align-items: center; justify-content: center;}
.weekdays { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-size: 11px; font-weight: 700; color: var(--text-muted); margin-bottom: 8px; }
.days-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.day-cell { aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 12px; font-size: 14px; font-weight: 600; cursor: pointer; position: relative; transition: all 0.2s; }
.day-cell.empty { opacity: 0; pointer-events: none; }
.day-cell:not(.empty) { background: #f8fafc; }
.day-cell.today { color: var(--primary-dark); font-weight: 800; }
.day-cell.selected { background: var(--primary); color: white; transform: scale(1.05); box-shadow: 0 4px 10px rgba(45,212,191,0.3); }
.day-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--text-muted); position: absolute; bottom: 4px; opacity: 0; }
.day-cell.has-class .day-dot { opacity: 1; }
.day-cell.has-class.selected .day-dot { background: white; }

/* CLASSES TABLE LIST */
.classes-list { padding: 0 20px; display: flex; flex-direction: column; gap: 12px; }
.class-row { background: white; border-radius: 20px; padding: 16px; display: flex; flex-direction: column; gap: 12px; position: relative; overflow: hidden; border: 1px solid var(--border); transition: transform 0.2s; }
.class-row:active { transform: scale(0.98); }
.class-row::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; border-radius: 6px 0 0 6px; }
.class-row[data-cat="蒙式空間"]::before { background: var(--mont); }
.class-row[data-cat="ART"]::before { background: var(--art); }
.class-row[data-cat="GYM"]::before { background: var(--gym); }

.c-header { display: flex; justify-content: space-between; align-items: flex-start; }
.c-time { font-weight: 800; font-size: 18px; color: var(--text); line-height: 1.1; }
.c-teacher { font-size: 13px; color: var(--text-muted); font-weight: 600; margin-top: 4px; }
.c-badge { padding: 4px 10px; border-radius: 20px; font-weight: 800; font-size: 11px; }
.badge-ok { background: #DCFCE7; color: #166534; }
.badge-full { background: #FEE2E2; color: #991B1B; }

.c-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }
.c-tags { display: flex; gap: 6px; }
.c-series-tag { background: #FEF3C7; color: #B45309; padding: 4px 8px; border-radius: 8px; font-size: 11px; font-weight: 700; display: flex; align-items: center; gap: 4px; }
.btn-book { padding: 10px 24px; border-radius: 12px; border: none; font-weight: 800; font-size: 14px; background: var(--primary); color: white; cursor: pointer; box-shadow: 0 4px 12px rgba(45,212,191,0.25); transition: opacity 0.2s; }
.btn-book:disabled { opacity: 0.5; cursor: not-allowed; }

/* BOOKING & PROFILE FORMS */
.nav-top { padding: 20px; display: flex; align-items: center; gap: 16px; margin-bottom: 10px; }
.btn-back { width: 40px; height: 40px; border-radius: 14px; background: white; border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 18px; cursor: pointer; box-shadow: 0 2px 5px rgba(0,0,0,0.02); }
.page-title { font-size: 22px; font-weight: 800; }

.kids-selector { padding: 0 20px; display: flex; flex-direction: column; gap: 12px; }
.kid-card { background: white; border: 2px solid var(--border); border-radius: 20px; padding: 16px; display: flex; align-items: center; gap: 16px; cursor: pointer; transition: all 0.2s; position: relative; }
.kid-card.selected { border-color: var(--primary); background: var(--primary-light); }
.kid-card.selected::after { content: '✓'; position: absolute; right: 16px; font-weight: 800; color: var(--primary-dark); font-size: 20px; }
.kid-avatar { width: 48px; height: 48px; border-radius: 50%; background: #FDE047; display: flex; align-items: center; justify-content: center; font-size: 24px; }
.kid-info h3 { margin: 0 0 4px; font-size: 16px; font-weight: 700; color: var(--text); }
.kid-info p { margin: 0; font-size: 13px; color: var(--text-muted); font-weight: 600; }

.add-kid-btn { background: transparent; border: 2px dashed var(--border); border-radius: 20px; padding: 16px; text-align: center; color: var(--text-muted); font-weight: 700; font-size: 15px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.add-kid-btn i { font-size: 24px; font-style: normal; }

.form-section { padding: 20px; }
.input-group { margin-bottom: 16px; }
.input-group label { display: block; font-size: 13px; font-weight: 700; color: var(--text-muted); margin-bottom: 6px; }
.input-group input { width: 100%; padding: 14px 16px; border-radius: 14px; border: 2px solid var(--border); font-size: 16px; font-weight: 600; transition: border-color 0.2s; background: white; }
.input-group input:focus { outline: none; border-color: var(--primary); }

.fixed-bottom { position: fixed; bottom: 0; left: 0; right: 0; padding: 16px 20px 24px; background: linear-gradient(to top, rgba(255,255,255,1) 70%, rgba(255,255,255,0)); z-index: 100; display: none; }
.fixed-bottom.show { display: block; animation: slideUp 0.3s; }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

.btn-super { width: 100%; padding: 18px; border-radius: 16px; border: none; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: white; font-weight: 800; font-size: 18px; cursor: pointer; box-shadow: 0 8px 20px rgba(45,212,191,0.4); transition: transform 0.2s; }
.btn-super:active { transform: scale(0.97); }
.btn-super:disabled { background: #CBD5E1; box-shadow: none; cursor: not-allowed; color: #94A3B8; }

.loading-overlay { position: fixed; inset: 0; background: rgba(255,255,255,0.8); backdrop-filter: blur(4px); z-index: 999; display: flex; flex-direction: column; align-items: center; justify-content: center; display: none; }
.spinner { width: 40px; height: 40px; border: 4px solid var(--primary-light); border-top-color: var(--primary); border-radius: 50%; animation: spin 1s linear infinite; margin-bottom: 16px; }
@keyframes spin { to { transform: rotate(360deg); } }
