/* =====================================================
   REACHPT — Dashboard Styles
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=Inter:wght@300;400;500;600&display=swap');

/* ── CSS Variables ───────────────────────────────── */
:root {
  --green-900: #0D2B1D;
  --green-800: #1B4332;
  --green-700: #2D6A4F;
  --green-600: #40916C;
  --green-500: #52B788;
  --green-400: #74C69D;
  --green-300: #95D5B2;
  --green-200: #B7E4C7;
  --green-100: #D8F3DC;
  --green-50:  #F0FAF3;

  --amber-600: #D97706;
  --amber-500: #F59E0B;
  --amber-400: #FBBF24;
  --amber-100: #FEF3C7;

  --red-500: #EF4444;
  --red-100: #FEE2E2;

  --blue-500: #3B82F6;
  --blue-100: #DBEAFE;

  --purple-500: #8B5CF6;
  --purple-100: #EDE9FE;

  --slate-900: #0A1628;
  --slate-800: #1E2A3B;
  --slate-700: #2D3F55;
  --slate-600: #3D5166;
  --slate-500: #556070;
  --slate-400: #64748B;
  --slate-300: #94A3B8;
  --slate-200: #CBD5E1;
  --slate-100: #F1F5F9;
  --slate-50:  #F8FAFC;

  --white: #FFFFFF;
  --off-white: #F7F8FA;

  --sidebar-width: 260px;
  --topbar-height: 64px;

  --font-display: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 4px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.09);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.14);
  --shadow-glow: 0 0 30px rgba(82,183,136,0.25);

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── Reset ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: var(--font-body);
  background: var(--off-white);
  color: var(--slate-900);
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; font-family: inherit; }
textarea, input { font-family: inherit; }

/* ── Sidebar ─────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--slate-900);
  color: var(--white);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 200;
  transition: transform 0.3s var(--ease-out);
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--white);
}

.sidebar-logo em {
  font-style: normal;
  color: var(--green-400);
}

.logo-icon {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--green-500), var(--green-700));
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.sidebar-close {
  display: none;
  background: rgba(255,255,255,0.08);
  color: var(--white);
  border: none;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 0.9rem;
  cursor: pointer;
}

.patient-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.05);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255,255,255,0.06);
}

.patient-avatar {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--green-500), var(--green-700));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.patient-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
}

.patient-detail {
  font-size: 0.72rem;
  color: var(--green-400);
  font-weight: 500;
  margin-top: 2px;
}

.sidebar-nav {
  padding: 8px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.92rem;
  color: var(--slate-400);
  transition: all 0.2s;
  position: relative;
  cursor: pointer;
}

.nav-item:hover {
  background: rgba(255,255,255,0.06);
  color: var(--white);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(82,183,136,0.2), rgba(64,145,108,0.15));
  color: var(--green-300);
  border: 1px solid rgba(82,183,136,0.2);
}

.nav-icon { font-size: 1.1rem; flex-shrink: 0; }

.nav-badge {
  margin-left: auto;
  background: var(--slate-700);
  color: var(--slate-300);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-family: var(--font-display);
}

.nav-badge.unread {
  background: var(--green-600);
  color: var(--white);
  animation: badge-pulse 2s ease-in-out infinite;
}

@keyframes badge-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(82,183,136,0.4); }
  50% { box-shadow: 0 0 0 4px rgba(82,183,136,0); }
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,0.06);
  margin-top: auto;
}

.next-session-mini {
  background: rgba(255,255,255,0.04);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,0.06);
}

.nsm-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green-400);
  margin-bottom: 4px;
}

.nsm-time {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--white);
}

.nsm-pt {
  font-size: 0.78rem;
  color: var(--slate-400);
  margin-top: 2px;
}

/* ── Main Wrap ───────────────────────────────────── */
.main-wrap {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Topbar ──────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(247,248,250,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--slate-100);
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-menu-btn {
  display: none;
  background: var(--slate-100);
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 1rem;
  color: var(--slate-700);
  cursor: pointer;
  transition: background 0.2s;
}

.topbar-menu-btn:hover { background: var(--slate-200); }

.breadcrumb-page {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--slate-900);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.streak-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #FEF3C7, #FDE68A);
  border: 1px solid var(--amber-400);
  border-radius: var(--radius-full);
  padding: 6px 14px;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--amber-600);
  cursor: default;
}

.topbar-notif {
  position: relative;
  background: var(--slate-100);
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
}

.topbar-notif:hover { background: var(--slate-200); }

.notif-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: var(--green-500);
  border-radius: 50%;
  border: 2px solid var(--off-white);
}

.topbar-avatar {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--green-500), var(--green-700));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--white);
  cursor: pointer;
}

/* ── Sections ────────────────────────────────────── */
.dash-section {
  display: none;
  flex: 1;
}

.dash-section.active { display: block; }

.section-content {
  padding: 28px 28px 48px;
  max-width: 1100px;
}

h1 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--slate-900);
  margin-bottom: 6px;
}

.section-sub {
  font-size: 0.95rem;
  color: var(--slate-400);
  margin-bottom: 28px;
  line-height: 1.6;
}

.section-header-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.section-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.meta-tag {
  background: var(--green-50);
  color: var(--green-700);
  border: 1px solid var(--green-200);
  border-radius: var(--radius-full);
  padding: 4px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  font-family: var(--font-display);
}

/* ── Cards ───────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  border: 1px solid var(--slate-100);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s;
}

.card:hover { box-shadow: var(--shadow-md); }

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

.card-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--slate-900);
}

.card-link {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--green-600);
  transition: color 0.2s;
  cursor: pointer;
}

.card-link:hover { color: var(--green-800); }

/* ── Welcome Bar ─────────────────────────────────── */
.welcome-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.welcome-bar h1 { margin-bottom: 4px; }
.welcome-bar p {
  font-size: 0.92rem;
  color: var(--slate-400);
}

.welcome-date {
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--slate-400);
  background: var(--slate-100);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

/* ── KPI Cards ───────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 18px 18px 14px;
  border: 1px solid var(--slate-100);
  display: flex;
  align-items: flex-start;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s var(--ease-out);
  position: relative;
  overflow: hidden;
}

.kpi-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.2s;
  background: radial-gradient(circle at 50% 0%, rgba(82,183,136,0.06), transparent 70%);
}

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

.kpi-card:hover::after { opacity: 1; }

.kpi-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.kpi-icon.green  { background: var(--green-50);  border: 1px solid var(--green-100); }
.kpi-icon.amber  { background: var(--amber-100); border: 1px solid #FDE68A; }
.kpi-icon.blue   { background: var(--blue-100);  border: 1px solid #BFDBFE; }
.kpi-icon.purple { background: var(--purple-100);border: 1px solid #DDD6FE; }

.kpi-body { flex: 1; min-width: 0; }

.kpi-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--slate-400);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

.kpi-value {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--slate-900);
  line-height: 1;
  margin-bottom: 4px;
}

.kpi-delta {
  font-size: 0.75rem;
  font-weight: 600;
}

.kpi-delta.up    { color: var(--green-600); }
.kpi-delta.down  { color: var(--red-500); }
.kpi-delta.neutral { color: var(--slate-400); }

.kpi-spark {
  position: absolute;
  bottom: 0; right: 0;
  width: 80px; height: 40px;
  opacity: 0.4;
}

.kpi-ring-wrap {
  position: absolute;
  bottom: 10px; right: 10px;
}

.kpi-ring { width: 44px; height: 44px; }

.streak-mini-cal {
  display: flex;
  gap: 4px;
  position: absolute;
  bottom: 12px; right: 12px;
}

.smc-day {
  width: 8px; height: 24px;
  border-radius: 4px;
  background: var(--slate-100);
}

.smc-day.done {
  background: linear-gradient(to top, var(--green-500), var(--green-400));
}

.smc-day.today {
  background: linear-gradient(to top, var(--amber-500), var(--amber-400));
  box-shadow: 0 0 8px rgba(245,158,11,0.4);
}

/* ── Overview Cols ───────────────────────────────── */
.overview-cols {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 16px;
  margin-bottom: 16px;
}

.right-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Exercise Preview List ───────────────────────── */
.exercise-preview-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

.ex-preview-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: var(--slate-50);
  border-radius: var(--radius-md);
  border: 1px solid var(--slate-100);
  transition: all 0.2s;
  cursor: pointer;
}

.ex-preview-item:hover {
  background: var(--green-50);
  border-color: var(--green-200);
}

.ex-preview-item.done {
  opacity: 0.6;
  background: var(--green-50);
}

.ex-check {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 2px solid var(--slate-200);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  flex-shrink: 0;
  transition: all 0.2s var(--ease-spring);
  background: transparent;
}

.ex-preview-item.done .ex-check {
  background: var(--green-500);
  border-color: var(--green-500);
  color: var(--white);
}

.ex-preview-emoji { font-size: 1.4rem; flex-shrink: 0; }

.ex-preview-info { flex: 1; }

.ex-preview-name {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--slate-900);
}

.ex-preview-meta {
  font-size: 0.78rem;
  color: var(--slate-400);
  margin-top: 2px;
}

.ex-preview-tag {
  font-size: 0.72rem;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-family: var(--font-display);
}

.ex-preview-tag.easy   { background: var(--green-50); color: var(--green-700); }
.ex-preview-tag.medium { background: var(--amber-100); color: var(--amber-600); }
.ex-preview-tag.hard   { background: var(--red-100);   color: var(--red-500); }

/* ── Buttons ─────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--green-600) 0%, var(--green-700) 100%);
  color: var(--white);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.92rem;
  padding: 13px 24px;
  border-radius: var(--radius-full);
  box-shadow: 0 4px 14px rgba(64,145,108,0.35);
  transition: all 0.2s var(--ease-spring);
  border: none;
  cursor: pointer;
}

.btn-primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 20px rgba(64,145,108,0.45);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--white);
  color: var(--slate-700);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 12px 22px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--slate-200);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background: var(--slate-50);
  border-color: var(--green-400);
  color: var(--green-700);
  transform: translateY(-1px);
}

.full-width { width: 100%; }

/* ── Session Card ────────────────────────────────── */
.session-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.session-pt-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.pt-photo {
  width: 52px; height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--green-100);
  flex-shrink: 0;
}

.pt-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--slate-900);
}

.pt-cred {
  font-size: 0.78rem;
  color: var(--slate-400);
  margin-top: 2px;
}

.online-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--green-600);
  margin-top: 4px;
}

.session-time-row {
  display: flex;
  gap: 20px;
}

.session-detail { display: flex; flex-direction: column; gap: 2px; }

.sd-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--slate-400);
}

.sd-val {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--slate-900);
}

/* ── Message Bubble ──────────────────────────────── */
.msg-bubble {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  position: relative;
}

.msg-bubble.incoming {
  background: var(--slate-50);
  border: 1px solid var(--slate-100);
  border-top-left-radius: 4px;
}

.msg-bubble-text {
  font-size: 0.9rem;
  color: var(--slate-700);
  line-height: 1.7;
  margin-bottom: 6px;
}

.msg-time {
  font-size: 0.72rem;
  color: var(--slate-400);
  font-weight: 500;
}

/* ── Streak Calendar ─────────────────────────────── */
.streak-total {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--amber-600);
  background: var(--amber-100);
  border: 1px solid #FDE68A;
  padding: 4px 12px;
  border-radius: var(--radius-full);
}

.week-cal {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

.wc-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.wc-day-name {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--slate-400);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.wc-day-circle {
  width: 42px; height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  background: var(--slate-100);
  color: var(--slate-400);
  transition: all 0.2s var(--ease-spring);
}

.wc-day.done .wc-day-circle {
  background: linear-gradient(135deg, var(--green-500), var(--green-600));
  color: var(--white);
  box-shadow: 0 4px 12px rgba(82,183,136,0.3);
}

.wc-day.today .wc-day-circle {
  background: linear-gradient(135deg, var(--amber-400), var(--amber-500));
  color: var(--white);
  box-shadow: 0 4px 12px rgba(245,158,11,0.35);
  animation: today-pulse 2s ease-in-out infinite;
}

.wc-day.missed .wc-day-circle {
  background: var(--red-100);
  color: var(--red-500);
}

@keyframes today-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.wc-day-pts {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--green-600);
}

/* ── Exercise Progress Bar ───────────────────────── */
.exercise-progress-bar-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.epb-label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--slate-700);
  white-space: nowrap;
}

.epb-track {
  flex: 1;
  height: 10px;
  background: var(--slate-100);
  border-radius: 5px;
  overflow: hidden;
  min-width: 100px;
}

.epb-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green-400), var(--green-600));
  border-radius: 5px;
  transition: width 0.8s var(--ease-out);
}

.epb-pct {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--green-600);
  min-width: 38px;
  text-align: right;
}

/* ── Exercise Cards Grid ─────────────────────────── */
.exercises-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.exercise-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 2px solid var(--slate-100);
  overflow: hidden;
  transition: all 0.25s var(--ease-out);
  cursor: pointer;
}

.exercise-card:hover {
  border-color: var(--green-300);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.exercise-card.done {
  border-color: var(--green-300);
  background: var(--green-50);
}

.exercise-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 12px;
  background: linear-gradient(135deg, var(--slate-50), var(--white));
}

.exercise-card.done .exercise-card-top {
  background: linear-gradient(135deg, var(--green-50), var(--green-100));
}

.exercise-emoji { font-size: 2.2rem; }

.exercise-done-badge {
  width: 32px; height: 32px;
  background: var(--green-500);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 1rem;
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.3s var(--ease-spring);
}

.exercise-card.done .exercise-done-badge {
  opacity: 1;
  transform: scale(1);
}

.exercise-card-body { padding: 0 16px 16px; }

.exercise-name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--slate-900);
  margin-bottom: 4px;
}

.exercise-desc {
  font-size: 0.82rem;
  color: var(--slate-400);
  line-height: 1.6;
  margin-bottom: 12px;
}

.exercise-meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.exercise-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--slate-100);
  border-radius: var(--radius-full);
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--slate-600);
  font-family: var(--font-display);
}

.exercise-chip.pain-chip { background: var(--amber-100); color: var(--amber-600); }

.exercise-card-footer {
  display: flex;
  gap: 8px;
}

.ex-btn-start {
  flex: 1;
  background: linear-gradient(135deg, var(--green-500), var(--green-700));
  color: var(--white);
  border: none;
  border-radius: var(--radius-full);
  padding: 10px 16px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.84rem;
  cursor: pointer;
  transition: all 0.2s var(--ease-spring);
}

.ex-btn-start:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 12px rgba(64,145,108,0.3);
}

.exercise-card.done .ex-btn-start {
  background: var(--green-100);
  color: var(--green-700);
  box-shadow: none;
}

.ex-btn-info {
  width: 38px; height: 38px;
  background: var(--slate-100);
  border: none;
  border-radius: 50%;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  flex-shrink: 0;
}

.ex-btn-info:hover { background: var(--slate-200); }

/* ── Exercise Library ────────────────────────────── */
.library-intro {
  color: var(--slate-500);
  font-size: 0.92rem;
  line-height: 1.6;
  max-width: 720px;
  margin: -8px 0 20px;
}

.library-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.library-search-wrap {
  position: relative;
  flex: 1 1 260px;
  min-width: 220px;
}

.library-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.85rem;
  opacity: 0.6;
}

.library-search-input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  border: 2px solid var(--slate-100);
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--slate-900);
  background: var(--white);
  transition: border-color 0.2s;
}

.library-search-input:focus {
  outline: none;
  border-color: var(--green-400);
}

.library-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.category-chip {
  background: var(--slate-100);
  color: var(--slate-600);
  border: none;
  border-radius: var(--radius-full);
  padding: 8px 16px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
  white-space: nowrap;
}

.category-chip:hover { background: var(--slate-200); }

.category-chip.active {
  background: linear-gradient(135deg, var(--green-500), var(--green-700));
  color: var(--white);
}

.library-empty {
  text-align: center;
  color: var(--slate-400);
  font-size: 0.9rem;
  padding: 40px 0;
}

.library-grid .exercise-card { cursor: pointer; }

.exercise-category-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--green-50);
  color: var(--green-700);
  border-radius: var(--radius-full);
  padding: 3px 10px;
  font-size: 0.68rem;
  font-weight: 700;
  font-family: var(--font-display);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.exercise-phase-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--slate-100);
  color: var(--slate-600);
  border-radius: var(--radius-full);
  padding: 3px 10px;
  font-size: 0.68rem;
  font-weight: 700;
  font-family: var(--font-display);
}

.library-card-tags {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

/* ── Charts ──────────────────────────────────────── */
.progress-charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.chart-card canvas { width: 100% !important; }

.chart-legend {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.78rem;
  color: var(--slate-400);
}

.legend-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.legend-dot.green  { background: var(--green-500); }
.legend-dot.amber  { background: var(--amber-500); }
.legend-dot.red    { background: var(--red-500); }

/* ── Milestones ──────────────────────────────────── */
.milestones-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.milestone-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.milestone-dot-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.milestone-dot {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 800;
  flex-shrink: 0;
  transition: all 0.2s;
}

.milestone-dot.done   { background: var(--green-500); color: var(--white); }
.milestone-dot.active { background: var(--amber-400); color: var(--white); box-shadow: 0 0 10px rgba(251,191,36,0.4); }
.milestone-dot.future { background: var(--slate-100); color: var(--slate-300); }

.milestone-line {
  width: 2px;
  flex: 1;
  min-height: 20px;
  background: var(--slate-100);
  margin: 4px 0;
}

.milestone-dot.done + .milestone-line { background: var(--green-200); }

.milestone-body { flex: 1; padding-top: 4px; }

.milestone-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--slate-900);
  margin-bottom: 2px;
}

.milestone-sub {
  font-size: 0.76rem;
  color: var(--slate-400);
}

.milestone-date {
  font-size: 0.72rem;
  color: var(--green-600);
  font-weight: 600;
  margin-top: 3px;
}

/* ── Log Cards ───────────────────────────────────── */
.log-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.log-card { display: flex; flex-direction: column; gap: 12px; }

.log-sub {
  font-size: 0.85rem;
  color: var(--slate-400);
  line-height: 1.6;
}

/* Pain Scale */
.pain-scale {
  display: flex;
  gap: 6px;
  justify-content: space-between;
}

.pain-btn {
  flex: 1;
  aspect-ratio: 1;
  max-width: 46px;
  border: 2px solid var(--slate-200);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--slate-600);
  cursor: pointer;
  transition: all 0.15s var(--ease-spring);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pain-btn:hover {
  border-color: var(--amber-400);
  background: var(--amber-100);
  transform: scale(1.12);
}

.pain-btn.selected {
  transform: scale(1.15);
}

.pain-btn[data-val="0"].selected,
.pain-btn[data-val="1"].selected,
.pain-btn[data-val="2"].selected {
  background: var(--green-500); border-color: var(--green-500); color: var(--white);
}

.pain-btn[data-val="3"].selected,
.pain-btn[data-val="4"].selected,
.pain-btn[data-val="5"].selected {
  background: var(--amber-400); border-color: var(--amber-400); color: var(--white);
}

.pain-btn[data-val="6"].selected,
.pain-btn[data-val="7"].selected,
.pain-btn[data-val="8"].selected {
  background: #F97316; border-color: #F97316; color: var(--white);
}

.pain-btn[data-val="9"].selected,
.pain-btn[data-val="10"].selected {
  background: var(--red-500); border-color: var(--red-500); color: var(--white);
}

.pain-selected-label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--slate-700);
  text-align: center;
  min-height: 22px;
}

.pain-faces-row {
  display: flex;
  justify-content: space-between;
  font-size: 1.3rem;
  padding: 0 2px;
}

/* ROM Slider */
.rom-slider-wrap { display: flex; flex-direction: column; gap: 10px; }

.rom-label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--slate-600);
}

.rom-slider {
  width: 100%;
  -webkit-appearance: none;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, var(--green-400) 0%, var(--green-400) 65%, var(--slate-200) 65%);
  outline: none;
  cursor: pointer;
  transition: background 0.1s;
}

.rom-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--green-500), var(--green-700));
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(64,145,108,0.4);
  transition: transform 0.15s var(--ease-spring);
}

.rom-slider::-webkit-slider-thumb:hover { transform: scale(1.15); }

.rom-value-display {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 2.5rem;
  color: var(--green-700);
  text-align: center;
  line-height: 1;
}

.rom-reference { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }

.ref-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--slate-500);
}

.ref-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.ref-dot.green  { background: var(--green-500); }
.ref-dot.amber  { background: var(--amber-500); }
.ref-dot.blue   { background: var(--blue-500); }

/* Symptoms */
.symptom-list { display: flex; flex-direction: column; gap: 8px; }

.symptom-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--slate-200);
  cursor: pointer;
  transition: all 0.15s;
  font-size: 0.88rem;
  color: var(--slate-700);
  font-weight: 500;
  background: var(--white);
}

.symptom-item:hover {
  border-color: var(--amber-400);
  background: var(--amber-100);
}

.symptom-item.checked {
  border-color: var(--amber-500);
  background: var(--amber-100);
  color: var(--amber-700);
}

.symptom-check {
  width: 20px; height: 20px;
  border-radius: 4px;
  border: 2px solid var(--slate-300);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  flex-shrink: 0;
  transition: all 0.15s;
}

.symptom-item.checked .symptom-check {
  background: var(--amber-500);
  border-color: var(--amber-500);
  color: var(--white);
}

/* PT Note */
.pt-note-input {
  width: 100%;
  padding: 14px;
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  color: var(--slate-700);
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
  line-height: 1.6;
  background: var(--slate-50);
}

.pt-note-input:focus {
  border-color: var(--green-400);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(82,183,136,0.1);
}

.note-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.note-chars {
  font-size: 0.75rem;
  color: var(--slate-400);
}

/* Log History Table */
.log-history-table { width: 100%; }

.lht-header {
  display: grid;
  grid-template-columns: 110px 80px 80px 110px 1fr;
  padding: 8px 14px;
  background: var(--slate-50);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
}

.lht-header span {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--slate-400);
}

.lht-row {
  display: grid;
  grid-template-columns: 110px 80px 80px 110px 1fr;
  padding: 10px 14px;
  border-bottom: 1px solid var(--slate-50);
  align-items: center;
  transition: background 0.15s;
  border-radius: var(--radius-sm);
}

.lht-row:hover { background: var(--slate-50); }

.lht-row span {
  font-size: 0.85rem;
  color: var(--slate-700);
}

.lht-pain-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  font-weight: 800;
  font-size: 0.8rem;
  font-family: var(--font-display);
}

/* ── Messages Layout ─────────────────────────────── */
.messages-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
  height: calc(100vh - var(--topbar-height) - 80px);
  min-height: 500px;
}

.msg-sidebar {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--slate-100);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px;
}

.msg-contact {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.15s;
}

.msg-contact:hover { background: var(--slate-50); }
.msg-contact.active { background: var(--green-50); border: 1px solid var(--green-100); }

.msg-contact-avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--green-100);
}

.support-avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--green-500), var(--green-700));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

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

.msg-contact-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--slate-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.msg-contact-last {
  font-size: 0.78rem;
  color: var(--slate-400);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.msg-contact-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.msg-unread-dot {
  background: var(--green-500);
  color: var(--white);
  border-radius: 10px;
  font-size: 0.68rem;
  font-weight: 800;
  width: 18px; height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.msg-time-small {
  font-size: 0.7rem;
  color: var(--slate-400);
}

/* Message Thread */
.msg-thread {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--slate-100);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.msg-thread-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--slate-100);
  background: var(--slate-50);
}

.pt-photo-sm {
  width: 40px; height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--green-100);
}

.messages-list {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.messages-list::-webkit-scrollbar { width: 4px; }
.messages-list::-webkit-scrollbar-track { background: transparent; }
.messages-list::-webkit-scrollbar-thumb { background: var(--slate-200); border-radius: 2px; }

.msg-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.msg-row.outgoing { align-items: flex-end; }
.msg-row.incoming { align-items: flex-start; }

.msg-sender {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--slate-400);
  margin-bottom: 2px;
  padding: 0 6px;
}

.msg-bubble-outer {
  max-width: 72%;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 0.9rem;
  line-height: 1.65;
  word-break: break-word;
}

.msg-row.incoming .msg-bubble-outer {
  background: var(--slate-100);
  color: var(--slate-800);
  border-bottom-left-radius: 4px;
}

.msg-row.outgoing .msg-bubble-outer {
  background: linear-gradient(135deg, var(--green-500), var(--green-700));
  color: var(--white);
  border-bottom-right-radius: 4px;
}

.msg-ts {
  font-size: 0.68rem;
  color: var(--slate-400);
  padding: 0 6px;
}

/* Msg Input */
.msg-input-bar {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid var(--slate-100);
  background: var(--white);
}

.msg-textarea {
  flex: 1;
  border: 1.5px solid var(--slate-200);
  border-radius: 22px;
  padding: 10px 16px;
  font-size: 0.9rem;
  color: var(--slate-800);
  resize: none;
  outline: none;
  max-height: 120px;
  transition: border-color 0.2s;
  background: var(--slate-50);
  line-height: 1.5;
}

.msg-textarea:focus {
  border-color: var(--green-400);
  background: var(--white);
}

.msg-send-btn {
  width: 42px; height: 42px;
  border-radius: 50%;
  padding: 0;
  flex-shrink: 0;
  font-size: 1rem;
}

/* ── Session Layout ──────────────────────────────── */
.session-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 16px;
}

.session-main-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.video-placeholder {
  background: linear-gradient(135deg, var(--slate-900) 0%, var(--green-900) 100%);
  border-radius: var(--radius-lg);
  height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.video-bg-art {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vb-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(82,183,136,0.15);
  animation: ring-pulse 4s ease-in-out infinite;
}

.vb-r1 { width: 200px; height: 200px; animation-delay: 0s; }
.vb-r2 { width: 320px; height: 320px; animation-delay: 0.8s; }
.vb-r3 { width: 440px; height: 440px; animation-delay: 1.6s; }

@keyframes ring-pulse {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.02); }
}

.video-content {
  position: relative;
  z-index: 1;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.video-pt-avatar {
  width: 80px; height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid rgba(255,255,255,0.2);
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}

.video-pt-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--white);
}

.video-status {
  font-size: 0.88rem;
  color: var(--green-300);
  font-weight: 500;
}

.video-countdown {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 2rem;
  color: var(--white);
  min-height: 40px;
  display: flex;
  align-items: center;
}

.video-join-btn {
  background: rgba(255,255,255,0.15);
  border: 2px solid rgba(255,255,255,0.3);
  backdrop-filter: blur(10px);
  box-shadow: none;
}

.video-join-btn:hover {
  background: rgba(255,255,255,0.25);
  border-color: rgba(255,255,255,0.5);
}

.session-controls {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.ctrl-btn {
  width: 52px; height: 52px;
  background: var(--white);
  border: 1.5px solid var(--slate-200);
  border-radius: 50%;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s var(--ease-spring);
  cursor: pointer;
}

.ctrl-btn:hover {
  transform: scale(1.1);
  border-color: var(--green-400);
  box-shadow: 0 4px 12px rgba(64,145,108,0.2);
}

.ctrl-btn.danger {
  background: var(--red-500);
  border-color: var(--red-500);
}

.ctrl-btn.danger:hover {
  background: #DC2626;
  border-color: #DC2626;
  box-shadow: 0 4px 12px rgba(239,68,68,0.35);
}

.agenda-list { display: flex; flex-direction: column; gap: 12px; }

.agenda-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.agenda-num {
  width: 24px; height: 24px;
  background: var(--green-100);
  color: var(--green-700);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 800;
  flex-shrink: 0;
}

.agenda-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--slate-900);
  margin-bottom: 2px;
}

.agenda-time {
  font-size: 0.75rem;
  color: var(--slate-400);
}

/* ── Exercise Modal ──────────────────────────────────── */
[hidden] { display: none !important; }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10,22,40,0.7);
  backdrop-filter: blur(8px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-box {
  background: var(--white);
  border-radius: var(--radius-xl);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
}

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

.modal-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
}

.modal-close {
  width: 32px; height: 32px;
  background: var(--slate-100);
  border: none;
  border-radius: 50%;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.modal-close:hover { background: var(--slate-200); }

.modal-video-area {
  margin: 0;
}

.modal-video-placeholder {
  height: 220px;
  background: linear-gradient(135deg, var(--slate-900), var(--green-900));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.mvp-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--green-300);
}

.mvp-sub {
  font-size: 0.8rem;
  color: var(--slate-400);
}

.modal-body { padding: 20px 22px; display: flex; flex-direction: column; gap: 16px; }

.modal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.modal-instructions {
  font-size: 0.9rem;
  color: var(--slate-700);
  line-height: 1.75;
}

.modal-instructions ol {
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal-tips {
  background: var(--green-50);
  border: 1px solid var(--green-100);
  border-left: 4px solid var(--green-500);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 0.85rem;
  color: var(--green-800);
  line-height: 1.65;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 22px;
  border-top: 1px solid var(--slate-100);
}

/* ── Toast ───────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--slate-900);
  color: var(--white);
  border-radius: var(--radius-full);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.92rem;
  box-shadow: var(--shadow-lg);
  z-index: 600;
  transition: transform 0.4s var(--ease-spring);
  white-space: nowrap;
}

.toast.show { transform: translateX(-50%) translateY(0); }

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close { display: flex; }
  .main-wrap { margin-left: 0; }
  .topbar-menu-btn { display: flex; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .overview-cols { grid-template-columns: 1fr; }
  .progress-charts-grid { grid-template-columns: 1fr; }
  .session-layout { grid-template-columns: 1fr; }
  .messages-layout { grid-template-columns: 1fr; height: auto; }
  .msg-sidebar { max-height: 200px; }
  .log-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .section-content { padding: 16px 16px 40px; }
  .exercises-grid { grid-template-columns: 1fr; }
  .toast { white-space: normal; text-align: center; max-width: 90vw; }
  .library-toolbar { flex-direction: column; align-items: stretch; }
  .library-filters { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
}
