/* ============================================================
   FITCOACH PRO — Design System & Component Styles
   Mobile First · Light + Dark Mode · Premium UI
   ============================================================ */

/* ── Google Fonts ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@500;600;700;800&display=swap');

/* ── Design Tokens (Light Mode) ──────────────────────────── */
:root {
  /* Brand */
  --brand:        #6C63FF;
  --brand-light:  #8B83FF;
  --brand-dark:   #4E46E5;
  --green:        #43D787;
  --orange:       #FF8A00;
  --pink:         #FF6584;
  --cyan:         #00C6FB;
  --purple:       #A855F7;

  /* Surface */
  --bg:           #F4F6FB;
  --surface:      #FFFFFF;
  --surface-2:    #F0F2F8;
  --surface-3:    #E8EAF2;
  --border:       #E4E7F0;

  /* Text */
  --text-1:       #12131A;
  --text-2:       #4A4D6A;
  --text-3:       #8B8FAA;

  /* Shadows */
  --shadow-sm:    0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:    0 4px 16px rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.05);
  --shadow-lg:    0 12px 40px rgba(0,0,0,.12), 0 4px 16px rgba(0,0,0,.08);
  --shadow-brand: 0 8px 24px rgba(108,99,255,.30);

  /* Radius */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-full: 9999px;

  /* Nav */
  --nav-h: 72px;
  --header-h: 60px;

  /* Transitions */
  --ease: cubic-bezier(.4,0,.2,1);
  --dur: 220ms;

  /* Typography */
  --font-ui:      'Inter', -apple-system, sans-serif;
  --font-display: 'Plus Jakarta Sans', sans-serif;
}

/* ── Dark Mode Tokens ─────────────────────────────────────── */
body.dark {
  --bg:        #0F0F1A;
  --surface:   #1A1B2E;
  --surface-2: #22243A;
  --surface-3: #2C2E48;
  --border:    #2E3050;
  --text-1:    #F0F2FC;
  --text-2:    #9B9EC4;
  --text-3:    #5A5E82;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,.4);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.5);
}

/* ── Reset ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  height: 100%;
}

body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text-1);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}

button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; }
a { text-decoration: none; color: inherit; }

/* ── App Shell ────────────────────────────────────────────── */
#app {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  background: var(--bg);
}

/* ── Pages ────────────────────────────────────────────────── */
.page {
  display: none;
  padding: 0 0 calc(var(--nav-h) + 12px);
  min-height: 100vh;
  animation: pageIn var(--dur) var(--ease);
}

.page.visible { display: block; }

@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Bottom Nav ───────────────────────────────────────────── */
#bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  height: var(--nav-h);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -4px 24px rgba(0,0,0,.06);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 16px;
  border-radius: var(--r-md);
  transition: all var(--dur) var(--ease);
  color: var(--text-3);
  min-width: 56px;
}

.nav-item.active { color: var(--brand); }

.nav-item.active .nav-icon {
  background: var(--brand)12;
  transform: translateY(-2px);
}

.nav-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  transition: all var(--dur) var(--ease);
}

.nav-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .3px;
}

/* ── Page Header ──────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 12px;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 10;
}

.page-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  color: var(--text-1);
  letter-spacing: -.5px;
}

/* ── FAB Small ────────────────────────────────────────────── */
.fab-small {
  width: 40px;
  height: 40px;
  border-radius: var(--r-full);
  background: var(--brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-brand);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  flex-shrink: 0;
}
.fab-small:hover { transform: scale(1.08); }
.fab-small:active { transform: scale(.95); }

/* ── Dashboard Hero ───────────────────────────────────────── */
.dashboard-hero {
  padding: 20px 20px 0;
}

.hero-greeting {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 18px;
}

.greeting-text {
  font-size: 14px;
  color: var(--text-3);
  font-weight: 500;
  margin-bottom: 2px;
}

.hero-name {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -.4px;
}

.notif-btn {
  width: 42px;
  height: 42px;
  border-radius: var(--r-full);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  color: var(--text-2);
  flex-shrink: 0;
  margin-top: 4px;
}

.notif-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pink);
  border: 2px solid var(--surface);
}

/* ── Next Class Card ──────────────────────────────────────── */
.next-class-card {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  border-radius: var(--r-xl);
  padding: 20px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow-brand);
  transition: transform var(--dur) var(--ease);
}
.next-class-card:active { transform: scale(.98); }

.next-class-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,.7);
  margin-bottom: 6px;
}

.next-class-name {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 6px;
  letter-spacing: -.3px;
}

.next-class-meta {
  font-size: 13px;
  color: rgba(255,255,255,.8);
  margin-bottom: 16px;
}

.btn-hero {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,.2);
  color: #fff;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: var(--r-full);
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  backdrop-filter: blur(8px);
  transition: background var(--dur) var(--ease);
}
.btn-hero:hover { background: rgba(255,255,255,.3); }

.next-class-decoration {
  position: absolute;
  right: -20px;
  top: -20px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  pointer-events: none;
}
.next-class-decoration::after {
  content: '';
  position: absolute;
  right: 20px;
  top: 20px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
}

.next-class-empty {
  background: linear-gradient(135deg, #4A4D6A 0%, #2C2E48 100%);
  box-shadow: 0 8px 24px rgba(0,0,0,.2);
}

/* ── Stats Grid ───────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 16px 20px;
}

.stat-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 16px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  border: 1px solid var(--border);
}
.stat-card:active { transform: scale(.97); }

.stat-card-icon {
  font-size: 24px;
  margin-bottom: 10px;
  display: block;
}

.stat-card-val {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 800;
  display: block;
  line-height: 1;
  margin-bottom: 4px;
  letter-spacing: -.5px;
}

.stat-card-lbl {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .5px;
}

.stat-card.accent-purple .stat-card-val { color: var(--brand); }
.stat-card.accent-green  .stat-card-val { color: var(--green); }
.stat-card.accent-orange .stat-card-val { color: var(--orange); }
.stat-card.accent-pink   .stat-card-val { color: var(--pink); }

.stat-card.accent-purple::before { background: var(--brand)10; }
.stat-card.accent-green::before  { background: var(--green)10; }
.stat-card.accent-orange::before { background: var(--orange)10; }
.stat-card.accent-pink::before   { background: var(--pink)10; }

.stat-card::before {
  content: '';
  position: absolute;
  right: -10px;
  bottom: -10px;
  width: 70px;
  height: 70px;
  border-radius: 50%;
}

.active-badge {
  display: inline-block;
  background: var(--pink)20;
  color: var(--pink);
  font-size: 9px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--r-full);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-top: 4px;
}

/* ── Section Block ────────────────────────────────────────── */
.section-block {
  padding: 0 20px 20px;
}

.section-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--text-1);
}

.link-btn {
  font-size: 13px;
  font-weight: 600;
  color: var(--brand);
}

/* ── Quick Actions ────────────────────────────────────────── */
.quick-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.quick-action {
  background: var(--surface);
  border-radius: var(--r-md);
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur) var(--ease);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1);
  text-align: left;
}
.quick-action:active { transform: scale(.97); }

.qa-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

/* ── Activity List ────────────────────────────────────────── */
.activity-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border-radius: var(--r-md);
  padding: 12px 14px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.activity-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.activity-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.activity-text {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.activity-time {
  font-size: 11px;
  color: var(--text-3);
}

/* ── Search Bar ───────────────────────────────────────────── */
.search-bar-wrap {
  padding: 0 20px 12px;
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border-radius: var(--r-full);
  padding: 10px 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  color: var(--text-3);
}

.search-bar input {
  flex: 1;
  border: none;
  outline: none;
  background: none;
  font-size: 14px;
  color: var(--text-1);
}

.search-bar input::placeholder { color: var(--text-3); }

/* ── Filter Tabs ──────────────────────────────────────────── */
.filter-tabs {
  display: flex;
  gap: 8px;
  padding: 0 20px 16px;
  overflow-x: auto;
  scrollbar-width: none;
}
.filter-tabs::-webkit-scrollbar { display: none; }

.filter-tab {
  padding: 7px 16px;
  border-radius: var(--r-full);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: all var(--dur) var(--ease);
}

.filter-tab.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
  box-shadow: var(--shadow-brand);
}

/* ── Student Cards ────────────────────────────────────────── */
.students-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 20px 8px;
}

.student-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.student-card:active { transform: scale(.99); box-shadow: var(--shadow-md); }

.student-card-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.student-card-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}

.student-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-1);
}

.student-meta {
  font-size: 12px;
  color: var(--text-3);
}

.student-card-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.level-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.obj-badge {
  background: var(--surface-2);
  color: var(--text-2);
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 600;
}

.progress-bar-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.progress-bar-track {
  flex: 1;
  height: 4px;
  background: var(--surface-2);
  border-radius: var(--r-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: var(--r-full);
  transition: width .6s var(--ease);
}

.progress-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-3);
  min-width: 24px;
}

.icon-btn {
  width: 30px;
  height: 30px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  font-size: 18px;
  background: var(--surface-2);
  transition: all var(--dur) var(--ease);
}
.icon-btn:hover { background: var(--surface-3); }

/* ── Overlay Panel ────────────────────────────────────────── */
#overlay-panel {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  width: 100%;
  max-width: 430px;
  height: 100%;
  background: var(--bg);
  z-index: 200;
  overflow-y: auto;
  transition: transform .35s var(--ease);
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

#overlay-panel.open {
  transform: translateX(-50%) translateY(0);
}

/* ── Form ─────────────────────────────────────────────────── */
.form-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--border);
}

.form-header h2 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  flex: 1;
}

.form-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.back-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--r-full);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-1);
  flex-shrink: 0;
  transition: background var(--dur) var(--ease);
}
.back-btn:hover { background: var(--surface-3); }

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-input {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px 14px;
  font-size: 15px;
  color: var(--text-1);
  outline: none;
  width: 100%;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  -webkit-appearance: none;
}
.form-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(108,99,255,.15);
}

.form-textarea {
  resize: vertical;
  min-height: 90px;
  line-height: 1.5;
}

/* ── Avatar Upload ────────────────────────────────────────── */
.avatar-upload-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 8px 0;
}

.avatar-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 2.5px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  overflow: hidden;
  transition: border-color var(--dur) var(--ease);
}
.avatar-circle:hover { border-color: var(--brand); }

.avatar-hint {
  font-size: 12px;
  color: var(--text-3);
  font-weight: 500;
}

.avatar-upload-icon { filter: grayscale(1) opacity(.5); }

/* ── Level Selector ───────────────────────────────────────── */
.level-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.level-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
}

.level-option input { display: none; }

.level-option span {
  display: block;
  text-align: center;
  padding: 8px 6px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 2px solid transparent;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  width: 100%;
  transition: all var(--dur) var(--ease);
}

.level-option.selected span {
  background: var(--brand)15;
  border-color: var(--brand);
  color: var(--brand);
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn-primary {
  background: var(--brand);
  color: #fff;
  border-radius: var(--r-md);
  padding: 14px 24px;
  font-size: 15px;
  font-weight: 700;
  box-shadow: var(--shadow-brand);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  letter-spacing: .2px;
}
.btn-primary:active { transform: scale(.98); box-shadow: none; }

.btn-secondary {
  background: var(--surface-2);
  color: var(--text-2);
  border-radius: var(--r-md);
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  border: 1.5px solid var(--border);
  transition: background var(--dur) var(--ease);
}
.btn-secondary:hover { background: var(--surface-3); }

.btn-danger {
  background: #FF365020;
  color: #FF3650;
  border-radius: var(--r-md);
  padding: 13px 24px;
  font-size: 14px;
  font-weight: 700;
  border: 1.5px solid #FF365030;
}

.btn-link {
  background: none;
  color: var(--brand);
  font-size: 13px;
  font-weight: 600;
}

.btn-full { width: 100%; }

/* ── Profile View ─────────────────────────────────────────── */
.profile-header {
  padding: 24px 20px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  position: relative;
}

.profile-header .back-btn {
  position: absolute;
  top: 20px;
  left: 20px;
}

.profile-avatar-wrap { position: relative; }

.profile-avatar-ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 3px solid;
  opacity: .4;
}

.profile-name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  text-align: center;
  letter-spacing: -.3px;
}

.profile-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.edit-profile-btn {
  background: var(--brand)15;
  color: var(--brand);
  border-radius: var(--r-full);
  padding: 7px 20px;
  font-size: 13px;
  font-weight: 700;
}

/* ── Profile Stats ────────────────────────────────────────── */
.profile-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 0 20px 16px;
}

.stat-pill {
  background: var(--surface);
  border-radius: var(--r-md);
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--border);
}

.stat-val {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  color: var(--text-1);
  line-height: 1;
}

.stat-val small {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
}

.stat-lbl {
  font-size: 10px;
  color: var(--text-3);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .3px;
  text-align: center;
}

/* ── Profile Sections ─────────────────────────────────────── */
.profile-section {
  padding: 0 20px 20px;
}

.section-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 12px;
}

/* ── Progress Ring ────────────────────────────────────────── */
.big-progress {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto;
}

.progress-ring {
  width: 120px;
  height: 120px;
}

.progress-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  line-height: 1;
}

.progress-pct {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  display: block;
}

.progress-sub {
  font-size: 11px;
  color: var(--text-3);
  font-weight: 600;
}

.notes-box {
  background: var(--surface);
  border-radius: var(--r-md);
  padding: 14px 16px;
  font-size: 14px;
  color: var(--text-2);
  border: 1px solid var(--border);
  line-height: 1.6;
}

.history-placeholder { padding: 4px 0; }

/* ── Workout Cards ────────────────────────────────────────── */
.workouts-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 20px;
}

.workout-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform var(--dur) var(--ease);
}
.workout-card:active { transform: scale(.99); }

.workout-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.workout-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.workout-card-meta { flex: 1; min-width: 0; }

.workout-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.workout-detail {
  font-size: 12px;
  color: var(--text-3);
}

.fav-btn {
  font-size: 20px;
  color: var(--text-3);
  padding: 4px;
  transition: color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.fav-btn.active { color: #FFB800; }
.fav-btn:active { transform: scale(1.3); }

.workout-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.workout-students {
  font-size: 12px;
  color: var(--text-3);
  font-weight: 600;
}

/* ── Exercise List ────────────────────────────────────────── */
.exercise-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.exercise-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border-radius: var(--r-md);
  padding: 12px 14px;
  border: 1px solid var(--border);
}

.exercise-num {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-3);
  min-width: 20px;
  font-variant-numeric: tabular-nums;
}

.exercise-icon-sm { font-size: 20px; }

.exercise-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.exercise-nm { font-size: 14px; font-weight: 600; color: var(--text-1); }
.exercise-detail { font-size: 11px; color: var(--text-3); }

/* ── Exercise Library ─────────────────────────────────────── */
.exercise-library-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lib-exercise-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border-radius: var(--r-md);
  padding: 14px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--dur) var(--ease);
}
.lib-exercise-card:active { background: var(--brand)08; border-color: var(--brand); }

.lib-ex-icon { font-size: 24px; }
.lib-ex-name { font-size: 14px; font-weight: 600; color: var(--text-1); }
.lib-ex-cat  { font-size: 11px; color: var(--text-3); }

/* ── Editable Exercise Items ──────────────────────────────── */
.exercise-list-editable { display: flex; flex-direction: column; gap: 8px; }

.exercise-edit-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border-radius: var(--r-md);
  padding: 10px 12px;
  border: 1px solid var(--border);
}

.mini-input {
  width: 40px;
  text-align: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 4px 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-1);
  outline: none;
}

.exercise-mini-inputs { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--text-3); margin-left: auto; }

.icon-btn-sm {
  width: 26px;
  height: 26px;
  border-radius: var(--r-sm);
  background: #FF365015;
  color: #FF3650;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ── Calendar / Week Strip ────────────────────────────────── */
.week-strip {
  display: flex;
  gap: 8px;
  padding: 8px 20px 16px;
  overflow-x: auto;
  scrollbar-width: none;
}
.week-strip::-webkit-scrollbar { display: none; }

.day-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1.5px solid var(--border);
  min-width: 48px;
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  position: relative;
}

.day-chip.today { border-color: var(--brand)40; }

.day-chip.active {
  background: var(--brand);
  border-color: var(--brand);
  box-shadow: var(--shadow-brand);
}

.day-name {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .3px;
  color: var(--text-3);
}

.day-num {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  color: var(--text-1);
}

.day-chip.active .day-name,
.day-chip.active .day-num { color: #fff; }

.day-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--brand);
  position: absolute;
  bottom: 5px;
}
.day-chip.active .day-dot { background: rgba(255,255,255,.8); }

/* ── Day Schedule ─────────────────────────────────────────── */
.day-schedule { padding: 0 20px; }

.day-label {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.today-badge {
  background: var(--brand)15;
  color: var(--brand);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--r-full);
}

.class-timeline { display: flex; flex-direction: column; gap: 10px; }

.class-block {
  display: flex;
  gap: 12px;
  cursor: pointer;
}

.class-time-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  min-width: 44px;
  padding-top: 4px;
}

.class-time {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-1);
}

.class-dur {
  font-size: 10px;
  color: var(--text-3);
  font-weight: 600;
}

.class-bar {
  flex: 1;
  background: var(--surface);
  border-radius: var(--r-md);
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-left: 4px solid;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur) var(--ease);
}
.class-bar:hover { transform: translateX(2px); }

.class-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.class-info { flex: 1; min-width: 0; }
.class-name { display: block; font-size: 14px; font-weight: 700; color: var(--text-1); }
.class-loc  { display: block; font-size: 11px; color: var(--text-3); margin-top: 2px; }

/* ── Color Picker ─────────────────────────────────────────── */
.color-picker {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.color-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 3px solid transparent;
  transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease);
  outline: 2px solid transparent;
  outline-offset: 2px;
}
.color-dot.selected {
  transform: scale(1.15);
  outline-color: var(--text-1);
}

/* ── Attendance ───────────────────────────────────────────── */
.attendance-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-3);
}

.attendance-list { display: flex; flex-direction: column; gap: 8px; }

.attendance-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface);
  border-radius: var(--r-md);
  padding: 10px 14px;
  border: 1px solid var(--border);
}

.att-toggle-group {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.att-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  font-size: 14px;
  color: var(--text-3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--dur) var(--ease);
}

.att-present.active  { background: var(--green)20; color: var(--green); }
.att-late.active     { background: var(--orange)20; color: var(--orange); }
.att-absent.active   { background: #FF365020; color: #FF3650; }

/* ── Challenge Cards ──────────────────────────────────────── */
.challenge-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  margin-bottom: 12px;
}

.challenge-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.challenge-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.challenge-info { flex: 1; }
.challenge-name { display: block; font-size: 15px; font-weight: 700; }
.challenge-meta { display: block; font-size: 12px; color: var(--text-3); margin-top: 2px; }
.challenge-pct  { font-size: 18px; font-weight: 800; }

.challenge-progress {}
.challenge-track {
  height: 8px;
  background: var(--surface-2);
  border-radius: var(--r-full);
  overflow: hidden;
  margin-bottom: 6px;
}
.challenge-fill { height: 100%; border-radius: var(--r-full); transition: width .6s var(--ease); }
.challenge-nums { display: flex; gap: 4px; font-size: 12px; color: var(--text-2); font-weight: 600; }

/* ── Resources ────────────────────────────────────────────── */
.resources-grid { display: flex; flex-direction: column; gap: 10px; }

.resource-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border-radius: var(--r-md);
  padding: 14px 16px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform var(--dur) var(--ease);
}
.resource-card:active { transform: scale(.99); }

.resource-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.resource-info { flex: 1; }
.resource-name  { display: block; font-size: 15px; font-weight: 700; color: var(--text-1); }
.resource-count { display: block; font-size: 12px; color: var(--text-3); margin-top: 2px; }

/* ── More Page ────────────────────────────────────────────── */
.teacher-summary-card {
  margin: 0 20px 20px;
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.teacher-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  flex-shrink: 0;
}

.teacher-name  { font-size: 16px; font-weight: 700; color: var(--text-1); }
.teacher-school { font-size: 12px; color: var(--text-3); margin-top: 2px; }

.more-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 20px;
}

.more-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform var(--dur) var(--ease);
}
.more-card:active { transform: scale(.99); }

.more-card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.more-card-label {
  flex: 1;
  text-align: left;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-1);
}

.more-card-arrow { color: var(--text-3); }

/* ── Settings ─────────────────────────────────────────────── */
.settings-section {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 16px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.settings-section-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-3);
}

.lang-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.lang-btn {
  padding: 10px 12px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 2px solid transparent;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
  transition: all var(--dur) var(--ease);
  text-align: center;
}
.lang-btn.active {
  background: var(--brand)15;
  border-color: var(--brand);
  color: var(--brand);
}

.theme-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
}

.toggle-switch input { display: none; }

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--surface-3);
  border-radius: var(--r-full);
  transition: background var(--dur) var(--ease);
  cursor: pointer;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--dur) var(--ease);
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
}

.toggle-switch input:checked + .toggle-slider { background: var(--brand); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(22px); }

.about-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
}

/* ── Workout Detail ───────────────────────────────────────── */
.workout-detail-hero {
  padding: 20px;
  margin: 0 0 4px;
}

.workout-stats-row {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.workout-badges { display: flex; gap: 8px; }

/* ── Empty States ─────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 48px 32px;
  text-align: center;
}

.empty-icon {
  font-size: 52px;
  margin-bottom: 8px;
  filter: grayscale(.3);
}

.empty-state h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-1);
}

.empty-state p {
  font-size: 14px;
  color: var(--text-3);
  margin-bottom: 8px;
}

.empty-state-small {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 32px 20px;
  text-align: center;
}

.empty-state-small .empty-icon { font-size: 36px; }
.empty-state-small p { font-size: 14px; color: var(--text-3); }

/* ── Toast ────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: calc(var(--nav-h) + 16px);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--text-1);
  color: var(--bg);
  padding: 12px 20px;
  border-radius: var(--r-full);
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 1000;
  opacity: 0;
  transition: all .3s var(--ease);
  max-width: 90%;
  box-shadow: var(--shadow-lg);
  pointer-events: none;
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast-success .toast-icon { color: var(--green); }
.toast-error .toast-icon   { color: var(--pink); }

/* ── Install Banner ───────────────────────────────────────── */
#install-banner {
  position: fixed;
  bottom: calc(var(--nav-h) + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  width: calc(100% - 32px);
  max-width: 400px;
  background: var(--surface);
  border-radius: var(--r-xl);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  z-index: 150;
  opacity: 0;
  pointer-events: none;
  transition: all .3s var(--ease);
}

#install-banner.show {
  opacity: 1;
  pointer-events: all;
  transform: translateX(-50%) translateY(0);
}

.install-icon { font-size: 32px; flex-shrink: 0; }

.install-text { flex: 1; }
.install-title { font-size: 14px; font-weight: 700; color: var(--text-1); display: block; }
.install-desc  { font-size: 12px; color: var(--text-3); }

.install-actions { display: flex; gap: 8px; }

.btn-install {
  background: var(--brand);
  color: #fff;
  border-radius: var(--r-full);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: var(--shadow-brand);
  white-space: nowrap;
}

.btn-later {
  color: var(--text-3);
  font-size: 13px;
  font-weight: 600;
  padding: 8px;
}

/* ── Utility ──────────────────────────────────────────────── */
.muted { color: var(--text-3); font-size: 13px; }

/* ── Desktop Centered Layout ──────────────────────────────── */
@media (min-width: 430px) {
  #app {
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    box-shadow: 0 0 60px rgba(0,0,0,.08);
  }
}

/* ── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 4px; }

/* ── Reduced Motion ───────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}