/* ===================================================
   Musculosamente Pro — Stylesheet
   =================================================== */

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

:root {
  /* DARK PREMIUM (DEFAULT) */
  --primary: #FF6B00;
  --primary-light: #FF9E44;
  --primary-gradient: linear-gradient(135deg, #FF6B00 0%, #FF8800 50%, #FF9E44 100%);
  --primary-glow: rgba(255, 107, 0, 0.25);
  --primary-rgb: 255, 107, 0;
  --bg: #080808;
  --bg2: #121212;
  --nav-bg: rgba(8, 8, 8, 0.97);
  --surface: #1a1a1a;
  --surface2: #252525;
  --surface3: #333333;
  --text: #ffffff;
  --text2: #a0a0a0;
  --text3: #666666;
  --border: rgba(255, 255, 255, 0.08);
  --success: #00ff88;
  --danger: #ff4d4d;
  --modal-bg: rgba(0,0,0,0.85);
  --glass: rgba(255, 255, 255, 0.03);

  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.8);
  --transition: 0.22s ease;

  /* Original variables mapping */
  --primary-light: #FF9E44;
  --accent: #FF8C33;
  --accent2: #43e97b;
  --accent3: #FF6B00;
  --border2: rgba(255, 107, 0, 0.3);
  --red: #ff4757; /* Redefined as --danger in new theme, but keeping for existing usage */
  --green: #2ed573; /* Redefined as --success in new theme, but keeping for existing usage */
}

[data-theme="light"] {
  --bg: #F2F2F7;
  --bg2: #FFFFFF;
  --surface: #FFFFFF;
  --surface2: #E5E5EA;
  --surface3: #D1D1D6;
  --text: #000000;
  --text2: #3A3A3C;
  --text3: #8E8E93;
  --border: rgba(0, 0, 0, 0.05);
  --glass: rgba(255, 255, 255, 0.7);
  --success: #34C759;
  --danger: #FF3B30;
}

[data-theme="barbie"] {
  --primary: #FF007F;
  --primary-light: #FF66B2;
  --primary-gradient: linear-gradient(135deg, #FF007F 0%, #FF3399 50%, #FF66B2 100%);
  --primary-rgb: 255, 0, 127;
  --bg: #FFF0F6;
  --bg2: #FFDEEB;
  --surface: #FFFFFF;
  --surface2: #FFC1DE;
  --surface3: #FFA3CF;
  --text: #4A0025;
  --text2: #910048;
  --text3: #C40062;
  --border: rgba(255, 0, 127, 0.1);
  --success: #2ECC71;
  --danger: #E74C3C;
}


html { font-size: 15px; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== SCREENS ===== */
.screen { display: none; }
.screen.active { display: flex !important; flex-direction: column; min-height: 100vh; }
.hidden { display: none !important; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--surface3); border-radius: 3px; }

/* ===================================================
   LOGIN SCREEN
   =================================================== */
#screen-login {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #09090b; /* Cinza 950 */
}

.login-orb { display: none; } /* Remove as manchas de cor */

.login-bg { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }

.login-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  animation: float 8s ease-in-out infinite;
}
.orb1 { width: 500px; height: 500px; background: radial-gradient(circle, #FF6B00, transparent); top: -100px; left: -100px; animation-delay: 0s; }
.orb2 { width: 400px; height: 400px; background: radial-gradient(circle, #FF8C33, transparent); bottom: -80px; right: -80px; animation-delay: -3s; }
.orb3 { width: 300px; height: 300px; background: radial-gradient(circle, #ffcc80, transparent); top: 50%; left: 50%; transform: translate(-50%,-50%); animation-delay: -5s; }

@keyframes float {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-30px) scale(1.05); }
}

.login-card {
  position: relative;
  background: linear-gradient(160deg, rgba(22,22,22,0.96) 0%, rgba(15,15,15,0.98) 100%);
  backdrop-filter: blur(24px);
  border: 1px solid var(--border2);
  border-radius: 24px;
  padding: 48px 40px;
  width: 420px;
  max-width: 95vw;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255,107,0,0.08) inset;
}

.login-logo { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 6px; }
.login-logo-img { height: 72px; width: auto; object-fit: contain; filter: drop-shadow(0 0 16px rgba(255,107,0,0.5)); }
.logo-icon { font-size: 2rem; filter: drop-shadow(0 0 12px var(--primary)); }
.logo-text { font-size: 1.8rem; font-weight: 800; letter-spacing: -0.5px; }
.logo-text span { color: var(--primary); }
.login-sub { color: var(--text2); font-size: 0.88rem; margin-bottom: 28px; text-align: center; }

.login-tabs { display: flex; gap: 8px; margin-bottom: 28px; background: var(--bg2); border-radius: 12px; padding: 4px; }
.login-tab {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px; border: none; border-radius: 10px; background: transparent;
  color: var(--text2); font-size: 0.9rem; font-weight: 600; cursor: pointer;
  transition: var(--transition);
}
.login-tab.active { background: var(--primary-gradient); color: #fff; box-shadow: 0 8px 20px var(--primary-glow); }
.login-tab:hover:not(.active) { color: var(--text); background: var(--surface); }

.login-form { display: flex; flex-direction: column; gap: 16px; }

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 0.82rem; font-weight: 600; color: var(--text2); text-transform: uppercase; letter-spacing: 0.5px; }
.form-group input, .form-group select, .form-group textarea {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  transition: var(--transition);
  width: 100%;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.form-group select option { background: var(--surface); }

.btn-login {
  margin-top: 8px;
  background: var(--primary-gradient);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 14px 24px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition);
  box-shadow: 0 4px 20px var(--primary-glow);
}
.btn-login:hover { transform: translateY(-2px); box-shadow: 0 8px 30px var(--primary-glow); }
.btn-arrow { transition: transform 0.2s; }
.btn-login:hover .btn-arrow { transform: translateX(4px); }

.login-hint { margin-top: 20px; font-size: 0.78rem; color: var(--text3); text-align: center; }

/* ===================================================
   NAVBAR
   =================================================== */
.navbar {
  height: 60px;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  flex-shrink: 0;
}
.navbar-student { background: var(--nav-bg); }

.nav-brand { display: flex; align-items: center; gap: 10px; }
.nav-logo-img { height: 34px; width: auto; object-fit: contain; filter: drop-shadow(0 0 6px rgba(255,107,0,0.4)); }
.logo-icon-sm { font-size: 1.3rem; filter: drop-shadow(0 0 6px var(--primary)); }
.nav-title { font-weight: 800; font-size: 1.05rem; }
.nav-badge {
  background: var(--primary-glow);
  border: 1px solid var(--border2);
  color: var(--primary-light);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.nav-actions { display: flex; align-items: center; gap: 12px; }
.nav-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text2);
  padding: 6px 14px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: var(--transition);
  display: flex; align-items: center; gap: 6px;
}
.nav-btn:hover { color: var(--text); border-color: var(--border2); }
.nav-student-name { 
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 800; font-size: 0.95rem; 
}
.nav-brand-text { font-size: 1.05rem; font-weight: 900; letter-spacing: -0.5px; white-space: nowrap; color: var(--text); }
.nav-brand-orange { 
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 900;
}
.menu-toggle-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text2); font-size: 1.3rem; padding: 6px 10px;
  border-radius: 8px; transition: var(--transition); line-height: 1;
}
.menu-toggle-btn:hover { background: var(--surface2); color: var(--text); }

/* ===================================================
   TRAINER LAYOUT
   =================================================== */


.trainer-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
  height: calc(100vh - 60px);
}

.trainer-main {
  flex: 1;
  overflow-y: auto;
  padding: 30px;
  background: var(--bg);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.trainer-layout.dashboard-view .trainer-main {
  padding: 40px;
}

/* Sidebar */
.trainer-sidebar {
  width: 280px;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
}

.sidebar-header {
  padding: 20px 16px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sidebar-header h2 { font-size: 1rem; font-weight: 700; }

.btn-add-student {
  background: var(--primary-gradient);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 2px 8px var(--primary-glow);
}
.btn-add-student:hover { filter: brightness(1.12); transform: translateY(-1px); }

.student-search { padding: 0 12px 12px; }
.student-search input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text);
  font-size: 0.85rem;
}
.student-search input:focus { outline: none; border-color: var(--primary); }

.student-list {
  list-style: none;
  overflow-y: auto;
  flex: 1;
  padding: 4px 8px 16px;
}

.student-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 3px;
}
.student-item:hover { background: var(--surface2); }
.student-item.active { background: var(--primary-glow); border: 1px solid var(--border2); }

.student-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
  flex-shrink: 0;
}
.student-item-info { flex: 1; min-width: 0; }
.student-item-name { font-weight: 600; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.student-item-meta { font-size: 0.75rem; color: var(--text2); }
.student-item-actions {
  display: flex; gap: 4px; flex-shrink: 0;
  opacity: 0; transition: opacity 0.18s;
}
.student-item:hover .student-item-actions { opacity: 1; }
.student-item-btn {
  width: 26px; height: 26px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--surface3);
  color: var(--text2); font-size: 0.75rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: var(--transition);
}
.student-item-btn:hover { color: var(--text); border-color: var(--border2); background: var(--surface2); }
.student-item-btn.danger:hover { color: var(--red); border-color: rgba(255,71,87,0.4); }

/* Dashboard Reformulado */
.trainer-dashboard-content {
  display: flex;
  flex-direction: column;
  gap: 25px;
  animation: fadeIn 0.4s ease-out;
}

.welcome-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 5px;
}

.quick-actions {
  display: flex;
  gap: 10px;
}

.quick-actions .btn-secondary {
  padding: 8px 15px;
  font-size: 0.8rem;
  border-radius: 12px;
}

.dashboard-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 15px;
}

.stat-group-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.stat-group-card h4 {
  font-size: 0.8rem;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.mini-stats-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.mini-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.m-value {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text);
}

.m-label {
  font-size: 0.7rem;
  color: var(--text2);
  white-space: nowrap;
}

.mini-stat.warning .m-value { color: var(--danger); }
.mini-stat.info .m-value { color: #3498db; }
.mini-stat.success .m-value { color: var(--success); }
.mini-stat.premium .m-value { color: var(--primary); }
.mini-stat.subscriber .m-value { color: #9b59b6; }
.mini-stat.expert .m-value { color: #f1c40f; }

.dashboard-secondary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.dashboard-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 20px;
  min-height: 250px;
  display: flex;
  flex-direction: column;
}

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

.card-header h3 {
  font-size: 0.95rem;
  font-weight: 700;
}

.scrollable {
  overflow-y: auto;
  flex: 1;
  max-height: 250px;
  padding-right: 5px;
}

.mini-list .empty-state {
  text-align: center;
  padding: 30px 10px;
  color: var(--text3);
  font-size: 0.85rem;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}

.activity-item:last-child { border-bottom: none; }

.activity-time {
  font-size: 0.7rem;
  color: var(--text3);
  margin-left: auto;
}

.badge {
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 800;
}

.badge.warning { background: rgba(241, 196, 15, 0.2); color: #f1c40f; }
.badge.danger { background: rgba(231, 76, 60, 0.2); color: #e74c3c; }

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

/* Student Panel Header */
.student-panel-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
}
.student-avatar-lg {
  width: 60px; height: 60px; border-radius: 50%;
  background: var(--primary-gradient);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; font-weight: 800; flex-shrink: 0;
}
.student-info-header { flex: 1; }
.student-info-header h2 { font-size: 1.3rem; font-weight: 800; }
.student-info-header p { color: var(--text2); font-size: 0.85rem; margin-top: 2px; }
.student-header-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Panel Tabs */
.panel-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
}
.panel-tabs::-webkit-scrollbar { display: none; } /* Esconde scrollbar das abas para visual mais limpo */
.panel-tab {
  padding: 10px 20px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text2);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  transition: var(--transition);
  margin-bottom: -1px;
  flex-shrink: 0;
}
.panel-tab.active { 
  background: var(--primary-gradient); 
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  border-bottom: 2px solid var(--primary); 
}
.panel-tab:hover:not(.active) { color: var(--text); }

/* Workout Cards */
.workout-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.workout-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.workout-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--primary-gradient);
}
.workout-card:hover { border-color: var(--border2); transform: translateY(-2px); box-shadow: var(--shadow); }

.workout-card-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 10px; }
.workout-card-name { font-weight: 700; font-size: 1rem; }
.workout-card-day { font-size: 0.78rem; color: var(--primary-light); background: var(--primary-glow); padding: 2px 10px; border-radius: 20px; font-weight: 600; }
.workout-card-count { font-size: 0.82rem; color: var(--text2); margin-bottom: 14px; }
.workout-card-actions { display: flex; gap: 8px; }
.workout-card-actions button { flex: 1; }

.workout-list-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 48px; color: var(--text2); text-align: center;
}
.workout-list-empty span { font-size: 3rem; opacity: 0.5; }

/* Buttons */
.btn-primary {
  background: var(--primary-gradient);
  color: #fff; border: none; border-radius: 10px;
  padding: 9px 18px; font-size: 0.88rem; font-weight: 700;
  cursor: pointer; transition: var(--transition);
  box-shadow: 0 2px 12px var(--primary-glow);
  white-space: nowrap;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 20px var(--primary-glow); }

.btn-secondary {
  background: linear-gradient(135deg, var(--surface2) 0%, var(--surface3) 100%);
  color: var(--text2); border: 1px solid var(--border);
  border-radius: 10px; padding: 9px 18px;
  font-size: 0.88rem; font-weight: 600; cursor: pointer;
  transition: var(--transition); white-space: nowrap;
}
.btn-secondary:hover { color: var(--text); border-color: var(--border2); filter: brightness(1.15); }

.btn-paste {
  background: linear-gradient(135deg, rgba(255,107,0,0.18) 0%, rgba(255,140,51,0.08) 100%);
  color: var(--primary); border: 1px solid var(--border2);
  border-radius: 10px; padding: 9px 18px;
  font-size: 0.88rem; font-weight: 700; cursor: pointer;
  transition: var(--transition); white-space: nowrap;
}
.btn-paste:hover { background: linear-gradient(135deg, rgba(255,107,0,0.28) 0%, rgba(255,140,51,0.15) 100%); transform: translateY(-1px); }

.paste-preview-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  display: flex; align-items: center; gap: 10px;
  font-size: 0.82rem;
}
.paste-preview-row.found { border-color: rgba(67,233,123,0.3); }
.paste-preview-row.not-found { border-color: rgba(255,71,87,0.25); opacity: 0.7; }
.paste-preview-icon { font-size: 1rem; flex-shrink: 0; }
.paste-preview-info { flex: 1; min-width: 0; }
.paste-preview-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.paste-preview-meta { font-size: 0.72rem; color: var(--text2); margin-top: 1px; }
.paste-preview-badge {
  font-size: 0.72rem; font-weight: 700; padding: 2px 8px;
  border-radius: 20px; flex-shrink: 0;
}
.paste-preview-badge.ok { background: rgba(67,233,123,0.15); color: var(--accent2); }
.paste-preview-badge.warn { background: rgba(255,71,87,0.12); color: var(--red); }

.btn-danger {
  background: linear-gradient(135deg, rgba(255,71,87,0.2) 0%, rgba(255,71,87,0.08) 100%);
  color: var(--red); border: 1px solid rgba(255,71,87,0.3);
  border-radius: 10px; padding: 9px 14px;
  font-size: 0.85rem; font-weight: 600; cursor: pointer;
  transition: var(--transition);
}
.btn-danger:hover { background: linear-gradient(135deg, rgba(255,71,87,0.32) 0%, rgba(255,71,87,0.16) 100%); }

.btn-icon {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 1rem; transition: var(--transition);
}
.btn-icon:hover { border-color: var(--primary); color: var(--primary); }

/* ===================================================
   WORKOUT BUILDER MODAL
   =================================================== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}

#modal-custom-foods {
  z-index: 1100;
}

.modal-box {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 20px;
  width: 600px;
  max-width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}
.modal-lg { width: 860px; }
.modal-video { width: 720px; }

.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.modal-header h3 { font-size: 1.1rem; font-weight: 800; }
.modal-close {
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text2); width: 30px; height: 30px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 0.9rem; transition: var(--transition);
}
.modal-close:hover { color: var(--red); border-color: var(--red); }

.modal-body { padding: 20px 24px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px;
  flex-shrink: 0;
}

/* Workout Form */
.workout-form-top { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }

/* Exercise Builder */
.exercise-builder {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}
.builder-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px; gap: 12px;
}
.builder-header h4 { font-size: 0.92rem; font-weight: 700; }
.class-filter-wrap { display: flex; align-items: center; gap: 8px; }
.class-filter-wrap label { font-size: 0.8rem; color: var(--text2); white-space: nowrap; }
.class-filter-wrap select {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 10px;
  color: var(--text); font-size: 0.82rem;
}

#exercise-search {
  width: 100%; background: var(--bg2); border: 1px solid var(--border);
  border-radius: 8px; padding: 9px 12px; color: var(--text);
  font-size: 0.85rem; margin-bottom: 10px;
}
#exercise-search:focus { outline: none; border-color: var(--primary); }

.exercise-picker-list {
  max-height: 200px; overflow-y: auto;
  display: grid; grid-template-columns: 1fr 1fr; gap: 5px;
}

.exercise-picker-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: 8px;
  background: var(--bg2); border: 1px solid var(--border);
  cursor: pointer; transition: var(--transition);
}
.exercise-picker-item:hover { border-color: var(--primary); background: var(--primary-glow); }
.exercise-picker-item .ex-thumb {
  width: 48px; height: 36px; border-radius: 5px;
  background: var(--surface3); overflow: hidden; flex-shrink: 0;
}
.exercise-picker-item .ex-thumb img { width: 100%; height: 100%; object-fit: cover; }
.exercise-picker-item .ex-name { font-size: 0.78rem; font-weight: 600; line-height: 1.3; }
.exercise-picker-item .ex-class { font-size: 0.68rem; color: var(--primary-light); }

/* Assembly Line */
.assembly-line {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.assembly-line h4 {
  font-size: 0.92rem; font-weight: 700;
  margin-bottom: 14px; display: flex; align-items: center; gap: 8px;
}
.count-badge {
  background: var(--primary); color: #fff;
  font-size: 0.75rem; padding: 2px 8px; border-radius: 20px;
}

.assembly-list { display: flex; flex-direction: column; gap: 8px; }
.assembly-empty {
  display: flex; flex-direction: column; align-items: center;
  gap: 8px; padding: 24px; color: var(--text3); text-align: center;
  font-size: 0.85rem;
}
.assembly-empty span { font-size: 2rem; }

/* Assembly Row */
.assembly-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex; align-items: center; gap: 10px;
}
.assembly-row .row-thumb {
  width: 60px; height: 44px; border-radius: 6px;
  background: var(--surface3); overflow: hidden; flex-shrink: 0;
  cursor: pointer; position: relative;
}
.assembly-row .row-thumb img { width: 100%; height: 100%; object-fit: cover; }
.assembly-row .row-thumb .play-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.4); font-size: 1.2rem;
  opacity: 0; transition: var(--transition);
}
.assembly-row .row-thumb:hover .play-overlay { opacity: 1; }
.no-thumb { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; color: var(--text3); font-size: 1.3rem; }

.row-info { flex: 1; min-width: 0; }
.row-name { font-weight: 700; font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-class { font-size: 0.72rem; color: var(--primary-light); margin-top: 1px; }

.row-sets-input {
  width: 55px; background: var(--bg2); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 8px; color: var(--text);
  font-size: 0.85rem; font-weight: 700; text-align: center;
}
.row-sets-input:focus { outline: none; border-color: var(--primary); }

.row-instructions {
  width: 160px; background: var(--bg2); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 8px; color: var(--text);
  font-size: 0.82rem; resize: none; height: 38px;
}
.row-instructions:focus { outline: none; border-color: var(--primary); }

.row-instructions::placeholder { color: var(--text3); }
.row-label { font-size: 0.7rem; color: var(--text3); }

.row-remove { flex-shrink: 0; }
.drag-handle {
  cursor: grab;
  color: var(--text3);
  font-size: 1.2rem;
  padding: 0 4px;
  user-select: none;
  transition: var(--transition);
}
.drag-handle:hover { color: var(--primary); }
.assembly-row.dragging { opacity: 0.4; background: var(--surface2); border: 1px dashed var(--primary); }
.assembly-row.drag-over { border-top: 2px solid var(--primary); transform: translateY(2px); }


/* ===================================================
   HISTORY
   =================================================== */
.history-empty {
  display: flex; flex-direction: column; align-items: center;
  gap: 12px; padding: 48px; color: var(--text2); text-align: center;
}
.history-empty span { font-size: 3rem; opacity: 0.5; }

.history-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.history-table th { background: var(--surface2); padding: 10px 14px; text-align: left; font-weight: 700; font-size: 0.78rem; color: var(--text2); text-transform: uppercase; letter-spacing: 0.5px; }
.history-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); }
.history-table tr:hover td { background: var(--surface); }

/* ===================================================
   STUDENT AREA
   =================================================== */


.student-container {
  flex: 1;
  max-width: 700px;
  margin: 0 auto;
  padding: 24px 16px;
  width: 100%;
}

.student-section-title { font-size: 1.5rem; font-weight: 800; margin-bottom: 6px; }
.student-section-sub { color: var(--text2); margin-bottom: 20px; }

.student-workout-grid { display: flex; flex-direction: column; gap: 12px; }

.student-workout-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex; align-items: center; gap: 16px;
  cursor: pointer; transition: var(--transition);
  position: relative; overflow: hidden;
}
.student-workout-card::before {
  content: ''; position: absolute; top: 0; left: 0;
  width: 4px; height: 100%;
  background: var(--primary-gradient);
}
.student-workout-card:hover { border-color: var(--border2); transform: translateX(4px); }

.swc-icon { font-size: 2rem; flex-shrink: 0; }
.swc-info { flex: 1; }
.swc-name { font-weight: 800; font-size: 1rem; }
.swc-day { font-size: 0.82rem; color: var(--primary-light); margin-top: 2px; }
.swc-count { font-size: 0.78rem; color: var(--text2); margin-top: 2px; }
.swc-arrow { color: var(--text3); font-size: 1.2rem; transition: var(--transition); }
.student-workout-card:hover .swc-arrow { color: var(--primary); }

.student-no-workouts {
  display: flex; flex-direction: column; align-items: center;
  gap: 12px; padding: 48px; color: var(--text2); text-align: center;
}
.student-no-workouts span { font-size: 3rem; opacity: 0.5; }

/* Session Header Base */
.session-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 16px 24px;
  box-shadow: var(--shadow);
}



.btn-back {
  order: 1;
  background: linear-gradient(135deg, var(--surface2) 0%, var(--surface3) 100%);
  border: 1px solid var(--border);
  color: var(--text2); border-radius: 12px; padding: 10px 18px;
  cursor: pointer; font-size: 0.85rem; font-weight: 700;
  transition: var(--transition); white-space: nowrap;
  display: flex; align-items: center; gap: 8px;
}
.btn-back:hover { color: var(--text); border-color: var(--border2); transform: translateX(-3px); }
.btn-primary { order: 5; }

.session-info { order: 2; text-align: center; flex: 1; }
.session-info h2 { 
  font-size: 1.25rem; font-weight: 850; 
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.session-info p { font-size: 0.85rem; color: var(--text2); margin-top: 2px; }

.btn-secondary { order: 3; }
.btn-pause-session { order: 4; }

.btn-finish-session {
  order: 5;
  background: linear-gradient(135deg, #28c96a, #1fb15b);
  color: #fff; border: none; border-radius: 12px;
  padding: 10px 20px; font-size: 0.9rem; font-weight: 800;
  cursor: pointer; transition: var(--transition); white-space: nowrap;
  box-shadow: 0 4px 12px rgba(40, 201, 106, 0.2);
}
.btn-finish-session:hover { transform: translateY(-2px); box-shadow: 0 6px 15px rgba(40, 201, 106, 0.3); }
.btn-pause-session, .btn-secondary {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 16px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
}
.btn-pause-session:hover, .btn-secondary:hover {
  background: var(--surface3);
  border-color: var(--primary);
}

/* Workout Info Bar */
.workout-info-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.wb-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: var(--transition);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.wb-item::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; width: 100%; height: 3px;
  background: var(--primary-gradient);
  opacity: 0.8;
}
.wb-item:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  background: var(--surface2);
}
.wb-label {
  font-size: 0.6rem;
  color: var(--text3);
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.8px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.wb-val {
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -0.5px;
}
#workout-session-timer {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.session-exercise-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
}
.biset-card {
  border-color: #60b3ff;
  border-width: 2px;
  box-shadow: 0 0 10px rgba(96, 179, 255, 0.2);
}
.sec-header {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--border);
}
.sec-num {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--primary-gradient); border: none;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.85rem; color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 10px var(--primary-glow);
}
.sec-info { flex: 1; min-width: 0; }
.sec-name { font-weight: 800; font-size: 0.95rem; display: flex; align-items: center; flex-wrap: wrap; }
.cluster-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: linear-gradient(135deg, #ff9f43, #ff4757);
  color: white; font-size: 0.65rem; font-weight: 800;
  padding: 2px 6px; border-radius: 4px; margin-left: 6px;
  vertical-align: middle; cursor: help; box-shadow: 0 2px 5px rgba(255, 71, 87, 0.4);
}
.biset-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: linear-gradient(135deg, #60b3ff, #0984e3);
  color: white; font-size: 0.65rem; font-weight: 800;
  padding: 2px 6px; border-radius: 4px; margin-left: 6px;
  vertical-align: middle; box-shadow: 0 2px 5px rgba(96, 179, 255, 0.4);
}
.sec-class { font-size: 0.75rem; color: var(--primary-light); margin-top: 2px; }
.sec-sets-badge {
  background: var(--primary-gradient); color: #fff;
  font-size: 0.75rem; font-weight: 800;
  padding: 3px 10px; border-radius: 20px;
  box-shadow: 0 2px 6px var(--primary-glow);
}

.sec-body { padding: 14px 16px; }
.sec-video { margin-bottom: 14px; }

.video-thumb-btn {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 10px; padding: 8px 12px; cursor: pointer;
  transition: var(--transition); width: 100%;
}
.video-thumb-btn:hover { border-color: var(--primary); }
.video-thumb-img {
  width: 80px; height: 56px; border-radius: 6px;
  object-fit: cover; flex-shrink: 0;
}
.video-thumb-placeholder {
  width: 80px; height: 56px; border-radius: 6px;
  background: var(--surface3); display: flex; align-items: center;
  justify-content: center; font-size: 1.5rem; flex-shrink: 0;
}
.video-label { text-align: left; }
.video-label p { font-weight: 700; font-size: 0.85rem; margin-bottom: 2px; color: #00d2ff; }
.video-label span { font-size: 0.75rem; color: var(--primary-light); }

.sec-instructions {
  background: linear-gradient(135deg, rgba(255,107,0,0.08) 0%, rgba(255,107,0,0.03) 100%);
  border: 1px solid var(--border2);
  border-radius: 8px; padding: 10px 14px;
  margin-bottom: 14px; font-size: 0.85rem;
  color: var(--primary-light);
}
.sec-instructions span { font-weight: 700; }

/* Previous load hint */
.prev-load-hint {
  background: rgba(67,233,123,0.08);
  border: 1px solid rgba(67,233,123,0.2);
  border-radius: 8px; padding: 8px 12px;
  font-size: 0.8rem; color: var(--accent2);
  margin-bottom: 12px;
}

/* Sets table */
.sets-table { width: 100%; border-collapse: collapse; }
.sets-table th {
  font-size: 0.72rem; font-weight: 700; color: var(--text2);
  text-transform: uppercase; letter-spacing: 0.5px;
  padding: 0 8px 8px; text-align: center;
}
.sets-table th:first-child { text-align: left; }
.sets-table td { padding: 5px 6px; }

.sets-table .set-num { font-size: 0.8rem; font-weight: 700; color: var(--text2); padding: 0 8px; }
.set-input {
  width: 100%; background: var(--bg2); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 10px; color: var(--text);
  font-size: 0.88rem; text-align: center; font-weight: 600;
  transition: var(--transition);
}
.set-input:focus { outline: none; border-color: var(--primary); background: var(--surface); }
.set-input.filled { border-color: var(--accent2); color: var(--accent2); }
.set-input.locked {
  background: rgba(67,233,123,0.07);
  border-color: rgba(67,233,123,0.35);
  color: var(--accent2);
  cursor: not-allowed;
}

/* Botão salvar/editar série */
.btn-set-save {
  width: 36px; height: 36px;
  border-radius: 8px;
  border: none;
  background: var(--primary-gradient);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
  box-shadow: 0 4px 10px var(--primary-glow);
}
.btn-set-save:hover { filter: brightness(1.15); transform: scale(1.08); }
.btn-set-save.edit-mode {
  border-color: rgba(67,233,123,0.4);
  background: rgba(67,233,123,0.08);
  color: var(--accent2);
}
.btn-set-save.edit-mode:hover { background: rgba(67,233,123,0.18); }

/* Linha salva */
.row-saved td { opacity: 0.75; }

/* ===================================================
   VIDEO MODAL
   =================================================== */
.video-embed-wrap {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  border-radius: 10px;
  overflow: hidden;
  transition: padding-bottom 0.3s ease;
}
.video-embed-wrap.ratio-9-16 {
  padding-bottom: 177.77% !important;
  max-width: 320px;
  margin: 0 auto;
}
.modal-box.modal-video.is-vertical {
  width: 380px;
  max-width: 95vw;
}
.video-embed-wrap iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border-radius: 10px;
}

/* ===================================================
   TOAST
   =================================================== */
#toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 9999;
  display: flex; flex-direction: column; gap: 10px;
}
.toast {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 0.88rem; font-weight: 600;
  box-shadow: var(--shadow);
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
  display: flex; align-items: center; gap: 10px;
  max-width: 320px;
}
.toast.success { border-color: var(--green); }
.toast.error { border-color: var(--red); }
.toast.info { border-color: var(--primary); }
.toast-icon { font-size: 1.1rem; }

@keyframes toastIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(40px); } }

/* ===================================================
   PERIODIZATION: MACROCICLO / MICROCICLO
   =================================================== */
.macro-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 20px; overflow: hidden; }
.macro-card.macro-active { border-color: rgba(255,107,0,0.3); }
.macro-card.macro-completed { opacity: 0.65; }
.macro-header { display: flex; align-items: flex-start; justify-content: space-between; padding: 18px; gap: 12px; flex-wrap: wrap; background: linear-gradient(135deg, rgba(255,107,0,0.08), rgba(255,107,0,0.02)); }
.macro-info { flex: 1; min-width: 200px; }
.macro-name { font-size: 1.15rem; font-weight: 850; color: var(--text); margin: 4px 0; }
.macro-meta { font-size: 0.75rem; color: var(--text3); font-weight: 600; }
.macro-status-badge { display: inline-block; font-size: 0.68rem; font-weight: 800; padding: 3px 10px; border-radius: 20px; text-transform: uppercase; letter-spacing: 0.5px; }
.macro-status-badge.active { background: rgba(40,201,106,0.15); color: #28c96a; }
.macro-status-badge.completed { background: var(--surface2); color: var(--text3); }
.macro-actions { display: flex; gap: 5px; flex-wrap: wrap; }
.btn-sm { background: var(--surface2); border: 1px solid var(--border); color: var(--text2); padding: 6px 10px; border-radius: 8px; font-size: 0.73rem; cursor: pointer; font-weight: 700; transition: all 0.2s; white-space: nowrap; }
.btn-sm:hover { background: var(--surface3); color: var(--text); }
.btn-sm.danger:hover { background: rgba(255,71,87,0.2); color: #ff4757; }
.macro-micros { padding: 0 14px 14px; display: flex; flex-direction: column; gap: 8px; }

.micro-card { background: var(--bg2); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; transition: all 0.2s; }
.micro-card.micro-active { border-color: rgba(40,201,106,0.4); background: linear-gradient(135deg, rgba(40,201,106,0.06), transparent); }
.micro-card.micro-past { opacity: 0.55; }
.micro-card.micro-future { border-style: dashed; }
.micro-header { display: flex; align-items: center; gap: 10px; padding: 11px 14px; cursor: pointer; transition: background 0.2s; }
.micro-header:hover { background: var(--surface2); }
.micro-expand { font-size: 0.8rem; color: var(--text3); width: 16px; text-align: center; flex-shrink: 0; }
.micro-info { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.micro-name { font-size: 0.88rem; font-weight: 750; color: var(--text); }
.micro-meta { font-size: 0.7rem; color: var(--text3); font-weight: 600; }
.micro-badge-active { font-size: 0.68rem; font-weight: 800; color: #28c96a; background: rgba(40,201,106,0.15); padding: 3px 8px; border-radius: 12px; white-space: nowrap; }
.micro-badge-future { font-size: 0.75rem; color: var(--text3); }
.micro-badge-past { font-size: 0.8rem; color: var(--text3); }
.micro-actions { display: flex; gap: 4px; flex-shrink: 0; }
.micro-body { border-top: 1px solid var(--border); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.micro-workout-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.micro-workout-name { flex: 1; font-size: 0.84rem; font-weight: 700; color: var(--text); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.micro-workout-day { 
  font-size: 0.68rem; color: #fff; background: var(--primary-gradient); 
  padding: 2px 10px; border-radius: 20px; font-weight: 700; margin-left: 6px; white-space: nowrap; 
  box-shadow: 0 2px 5px var(--primary-glow);
}
.micro-workout-count { font-size: 0.73rem; color: var(--text3); white-space: nowrap; }
.micro-workout-actions { display: flex; gap: 4px; flex-shrink: 0; }
.micro-empty { text-align: center; padding: 15px; font-size: 0.82rem; color: var(--text3); font-style: italic; }
.btn-add-micro-workout { background: transparent; border: 1px dashed var(--border); color: var(--primary); padding: 10px; border-radius: 10px; font-size: 0.82rem; font-weight: 700; cursor: pointer; transition: all 0.2s; text-align: center; }
.btn-add-micro-workout:hover { background: var(--primary-glow); border-color: var(--primary); }

.loose-workouts-section { margin-top: 20px; }
.loose-workouts-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.loose-workouts-header h4 { font-size: 0.95rem; font-weight: 800; color: var(--text2); margin: 0; }
.loose-empty { text-align: center; padding: 30px; color: var(--text3); }
.loose-empty span { font-size: 2rem; display: block; margin-bottom: 8px; }
.loose-empty p { font-size: 0.85rem; margin: 0; }

.create-macro-section { margin-top: 24px; padding-top: 20px; border-top: 1px dashed var(--border); }
.btn-create-macro { 
  width: 100%; padding: 16px; 
  background: linear-gradient(135deg, rgba(255,107,0,0.14), rgba(255,107,0,0.06)); 
  border: 1px dashed var(--primary); 
  color: var(--primary); 
  border-radius: var(--radius); 
  font-size: 0.92rem; font-weight: 800; cursor: pointer; transition: all 0.3s; display: flex; align-items: center; justify-content: center; gap: 10px; 
}
.btn-create-macro:hover { 
  background: var(--primary-gradient);
  color: #fff;
  border-style: solid; transform: translateY(-2px); 
  box-shadow: 0 8px 24px var(--primary-glow);
}
.btn-create-macro span { font-size: 1.3rem; }

/* ===================================================
   RESPONSIVE
   =================================================== */
@media (max-width: 850px) {
  .trainer-layout { flex-direction: column; height: auto; }
  .trainer-sidebar { width: 100%; height: auto; border-right: none; border-bottom: 1px solid var(--border); }
  .trainer-main { height: auto; padding: 16px; }
  .workout-form-top { grid-template-columns: 1fr; }
  .exercise-picker-list { grid-template-columns: 1fr; }
  .student-panel-header { flex-direction: column; align-items: flex-start; }
  .builder-header { flex-direction: column; align-items: flex-start; }
  .assembly-row { flex-wrap: wrap; }
  .row-instructions { width: 100%; }
}

/* ===================================================
   ADMIN PANEL
   =================================================== */
.admin-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.admin-sidebar {
  width: 240px; background: var(--bg2);
  border-right: 1px solid var(--border);
  padding: 20px 12px; display: flex; flex-direction: column; gap: 6px;
  flex-shrink: 0; overflow-x: hidden;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}
.admin-sidebar.menu-collapsed { width: 0; padding: 0; border-right: none; }
.admin-sidebar-title {
  font-size: 0.7rem; font-weight: 800; color: var(--text3);
  text-transform: uppercase; letter-spacing: 1.2px;
  padding: 0 14px; margin-bottom: 12px;
  margin-top: 10px;
}
.admin-nav-btn {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-radius: 12px;
  background: transparent; border: none; color: var(--text2);
  font-size: 0.95rem; font-weight: 600; cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); 
  text-align: left; width: 100%;
}
.admin-nav-btn:hover { background: var(--surface2); color: var(--text); transform: translateX(5px); }
.admin-nav-btn.active {
  background: var(--primary-gradient);
  color: #fff !important; 
  border: none;
  box-shadow: 0 6px 15px var(--primary-glow);
  font-weight: 800;
}

.admin-main {
  flex: 1; overflow-y: auto; padding: 32px;
  background: var(--bg);
  min-height: 0; /* Importante para flex scrollable */
}
.admin-section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
}
.admin-section-header h2 { font-size: 1.3rem; font-weight: 800; }

.admin-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.admin-trainer-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.admin-trainer-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--primary-gradient);
}
.admin-trainer-card:hover { border-color: var(--border2); transform: translateY(-2px); box-shadow: var(--shadow); }

.admin-trainer-avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--primary-gradient);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; font-weight: 800; margin-bottom: 12px;
  color: #fff;
}
.admin-trainer-name { font-weight: 800; font-size: 1rem; margin-bottom: 3px; }
.admin-trainer-user { font-size: 0.8rem; color: var(--text2); margin-bottom: 8px; }
.admin-trainer-stats {
  font-size: 0.78rem; color: var(--primary-light);
  background: var(--primary-glow); padding: 3px 10px;
  border-radius: 20px; display: inline-block; margin-bottom: 14px;
  font-weight: 600;
}
.admin-trainer-actions { display: flex; gap: 8px; }
.admin-trainer-actions button { flex: 1; }

.nav-badge-admin {
  background: linear-gradient(135deg, #ff4757, #ff6b81);
  color: #fff; font-size: 0.72rem; font-weight: 700;
  padding: 2px 10px; border-radius: 20px;
  text-transform: uppercase; letter-spacing: 0.5px;
  border: none;
}

/* ===================================================
   STUDENT SIDE MENU
   =================================================== */
.student-layout {
  display: flex; flex: 1; overflow: hidden;
  height: calc(100vh - 60px);
}

.student-side-menu {
  width: 240px; background: var(--bg2);
  border-right: 1px solid var(--border);
  padding: 16px 8px; display: flex; flex-direction: column; gap: 4px;
  flex-shrink: 0; overflow: hidden;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

/* Desktop Retrátil: colapsa para ícones */
.student-side-menu.menu-collapsed { width: 70px; }
.student-side-menu.menu-collapsed .smenu-icon { margin-right: 0; font-size: 1.3rem; }
.student-side-menu.menu-collapsed .student-profile-side { padding: 10px 0; }

/* Oculta seletor de tema e textos no menu colapsado */
aside.student-side-menu.menu-collapsed .theme-selector,
aside.student-side-menu.menu-collapsed .theme-btn span,
aside.student-side-menu.menu-collapsed #side-student-name,
aside.student-side-menu.menu-collapsed .smenu-item span:not(.smenu-icon) {
  display: none !important;
}

aside.student-side-menu.menu-collapsed .smenu-item {
  justify-content: center;
  gap: 0;
  padding: 12px 0;
}
.student-side-menu.menu-collapsed .profile-pic-uploader { width: 40px; height: 40px; }
.student-side-menu.menu-collapsed #profile-pic-placeholder { width: 40px; height: 40px; font-size: 1rem; }

.student-menu-content {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  /* Hide scrollbar for cleaner look but keep functionality */
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.student-menu-content::-webkit-scrollbar {
  display: none;
}

.smenu-item {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-radius: 10px;
  background: transparent; border: 1px solid transparent; color: var(--text2);
  font-size: 0.9rem; font-weight: 600; cursor: pointer;
  transition: var(--transition); text-align: left; width: 100%;
  white-space: nowrap; overflow: hidden;
}
.smenu-item:hover { background: var(--surface2); color: var(--text); }
.smenu-item.active {
  background: var(--primary-gradient);
  color: #fff; border: none;
  box-shadow: 0 8px 20px var(--primary-glow);
}
.smenu-icon { font-size: 1.1rem; flex-shrink: 0; }

/* Notification badge */
.notif-badge {
  background: linear-gradient(135deg, #ff4757, #ff3f55);
  color: #fff; font-size: 0.65rem; font-weight: 800;
  min-width: 18px; height: 18px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 4px; margin-left: auto; flex-shrink: 0;
  animation: pulse-badge 2s infinite;
}
@keyframes pulse-badge {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); box-shadow: 0 0 0 4px rgba(255,71,87,0.2); }
}

/* Panel tab notif badge */
.tab-notif {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--red); color: #fff;
  font-size: 0.6rem; font-weight: 800;
  width: 16px; height: 16px; border-radius: 8px;
  margin-left: 5px; vertical-align: middle;
}

/* Unread dot for student list */
.unread-dot {
  width: 10px; height: 10px; background: var(--red);
  border-radius: 50%; display: inline-block;
  box-shadow: 0 0 8px var(--red);
  animation: pulse-badge 2s infinite;
}

.student-main { flex: 1; overflow-y: auto; }
.student-section-content { min-height: 100%; }

.learning-shell {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.learning-hero {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(255,107,0,0.22), rgba(255,255,255,0.03));
  padding: 28px;
  box-shadow: var(--shadow);
}
.learning-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(255,255,255,0.14), transparent 32%);
  pointer-events: none;
}
.learning-hero-content {
  position: relative;
  z-index: 1;
  max-width: 700px;
}
.learning-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0,0,0,0.18);
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.learning-title {
  margin-top: 14px;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 900;
  line-height: 1.05;
}
.learning-subtitle {
  margin-top: 10px;
  color: var(--text2);
  font-size: 0.98rem;
  line-height: 1.6;
}
.learning-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 360px));
  gap: 18px;
  justify-content: start;
}
.learning-course-card {
  position: relative;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  border-radius: 22px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,107,0,0.18), rgba(5,5,5,0.92));
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.learning-course-card:hover {
  transform: translateY(-4px);
  border-color: var(--border2);
  box-shadow: var(--shadow-lg);
}
.learning-course-cover {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.65;
}
.learning-course-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 42%;
  background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.28) 24%, rgba(0,0,0,0.92) 100%);
}
.learning-course-body {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 52% 18px 20px;
  gap: 10px;
}
.learning-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.learning-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  font-weight: 800;
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(255,255,255,0.1);
  color: #fff;
}
.learning-course-title {
  font-size: 1.22rem;
  font-weight: 900;
  color: #fff;
}
.learning-course-copy {
  color: rgba(255,255,255,0.78);
  font-size: 0.92rem;
  line-height: 1.55;
  max-width: 92%;
}
.learning-viewer {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 20px;
}
.learning-sidebar,
.learning-player {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
}
.learning-sidebar {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: calc(100vh - 170px);
  overflow: auto;
}
.learning-sidebar-top {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.learning-course-meta {
  color: var(--text2);
  font-size: 0.82rem;
  line-height: 1.5;
}
.learning-module-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
}
.learning-module-card h4 {
  margin-bottom: 4px;
  font-size: 0.92rem;
  font-weight: 800;
}
.learning-module-card p {
  color: var(--text2);
  font-size: 0.78rem;
  line-height: 1.5;
}
.learning-lesson-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}
.learning-lesson-item {
  width: 100%;
  text-align: left;
  background: var(--surface2);
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 10px 12px;
  color: var(--text);
  cursor: pointer;
  transition: var(--transition);
}
.learning-lesson-item:hover,
.learning-lesson-item.active {
  border-color: rgba(255,107,0,0.35);
  transform: translateX(2px);
}
.learning-lesson-kicker {
  display: block;
  color: var(--primary);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  margin-bottom: 4px;
}
.learning-lesson-name {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
}
.learning-lesson-duration {
  display: block;
  color: var(--text3);
  font-size: 0.72rem;
  margin-top: 4px;
}
.learning-player {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.learning-player-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.learning-player-header h3 {
  font-size: 1.35rem;
  font-weight: 900;
}
.learning-player-header p {
  color: var(--text2);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-top: 8px;
}
.learning-video-wrap {
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: 18px;
  overflow: hidden;
  background: #000;
}
.learning-video-wrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
}
.learning-text-body {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px;
}
.learning-empty-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 40px 28px;
  text-align: center;
  color: var(--text2);
  box-shadow: var(--shadow);
}
.learning-empty-card span {
  display: block;
  font-size: 3rem;
  margin-bottom: 12px;
}
.learning-admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 20px 0 12px;
}
.learning-audience-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.learning-audience-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  min-height: 48px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  appearance: none;
  text-align: left;
  justify-content: center;
}
.learning-audience-option:hover {
  border-color: var(--border2);
  transform: translateY(-1px);
}
.learning-audience-option.active {
  background: var(--primary-gradient);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 8px 20px var(--primary-glow);
}
.learning-admin-module {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 14px;
}
.learning-admin-module-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.learning-admin-lessons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.learning-admin-lesson {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
}
.learning-admin-lesson-copy {
  min-width: 0;
}
.learning-admin-lesson-copy strong {
  display: block;
  font-size: 0.9rem;
}
.learning-admin-lesson-copy span {
  color: var(--text2);
  font-size: 0.78rem;
}
.learning-admin-lesson-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
@media (max-width: 980px) {
  .learning-viewer {
    grid-template-columns: 1fr;
  }
  .learning-sidebar {
    max-height: none;
  }
}
@media (min-width: 981px) {
  .learning-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 300px));
  }
}
@media (max-width: 640px) {
  .learning-shell {
    padding: 16px;
  }
  .learning-grid {
    grid-template-columns: 1fr;
  }
  .learning-course-card {
    max-width: 100%;
  }
  .learning-course-body {
    padding: 50% 20px 22px;
    gap: 12px;
  }
  .learning-badge {
    font-size: 0.8rem;
    padding: 7px 11px;
  }
  .learning-course-title {
    font-size: 1.72rem;
  }
  .learning-course-copy {
    font-size: 1.08rem;
    line-height: 1.65;
    max-width: 100%;
  }
  .learning-hero {
    padding: 20px;
  }
  .learning-player-header {
    flex-direction: column;
  }
  .learning-admin-header,
  .learning-admin-module-head,
  .learning-admin-lesson {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ===================================================
   CHAT
   =================================================== */
.chat-container { display: flex; flex-direction: column; height: calc(100vh - 60px); }
.chat-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.chat-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.chat-header-main {
  min-width: 0;
}
.chat-header h2 { font-size: 1.1rem; font-weight: 800; }
.chat-header p { color: var(--text2); font-size: 0.82rem; margin-top: 3px; }

.chat-messages {
  flex: 1; overflow-y: auto; padding: 20px;
  display: flex; flex-direction: column; gap: 10px;
}
.chat-empty { text-align: center; color: var(--text2); padding: 48px; font-size: 0.9rem; }
.chat-empty span { font-size: 2.5rem; display: block; margin-bottom: 10px; }

.chat-msg { display: flex; flex-direction: column; max-width: 72%; }
.chat-msg.from-trainer { align-self: flex-start; }
.chat-msg.from-student { align-self: flex-end; }

.chat-bubble {
  padding: 10px 14px; border-radius: 14px;
  font-size: 0.88rem; line-height: 1.5; word-break: break-word;
}
.chat-msg.from-trainer .chat-bubble {
  background: var(--surface2); border-bottom-left-radius: 4px;
}
.chat-msg.from-student .chat-bubble {
  background: var(--primary-gradient);
  color: #fff; border-bottom-right-radius: 4px;
}
.chat-time { font-size: 0.68rem; color: var(--text3); margin-top: 3px; }
.chat-msg.from-student .chat-time { text-align: right; }

.chat-input-area {
  padding: 14px 20px; border-top: 1px solid var(--border);
  background: var(--bg2); display: flex; gap: 10px; align-items: flex-end;
  flex-shrink: 0;
}
.chat-input {
  flex: 1; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 10px 14px; color: var(--text);
  font-family: inherit; font-size: 0.9rem; resize: none; max-height: 100px;
  transition: var(--transition);
}
.chat-input:focus { outline: none; border-color: var(--primary); }
.btn-chat-send:hover { transform: scale(1.06); filter: brightness(1.1); }
.btn-chat-send {
  background: var(--primary-gradient);
  color: #fff; border: none; border-radius: 10px; padding: 10px 16px;
  cursor: pointer; font-size: 1.1rem; box-shadow: 0 4px 12px var(--primary-glow);
  transition: var(--transition); flex-shrink: 0;
}
.btn-chat-whatsapp {
  background: linear-gradient(135deg, #25d366 0%, #1ebe5d 100%);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}
.btn-chat-whatsapp:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

/* ===================================================
   DIET
   =================================================== */
.diet-empty { text-align: center; color: var(--text2); padding: 48px; }
.diet-empty span { font-size: 3rem; display: block; margin-bottom: 12px; opacity: 0.6; }

.diet-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; margin-top: 16px;
  position: relative; overflow: hidden;
}
.diet-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, #43e97b, #2ed573);
}
.diet-card pre {
  white-space: pre-wrap; word-break: break-word;
  font-family: inherit; font-size: 0.9rem; line-height: 1.9; color: var(--text);
}
.diet-updated { font-size: 0.78rem; color: var(--text3); margin-top: 14px; }

.diet-editor-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px;
}
.diet-editor-header h3 { font-size: 1rem; font-weight: 800; }
.diet-editor textarea {
  width: 100%; min-height: 300px; resize: vertical;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 10px; padding: 16px; color: var(--text);
  font-family: inherit; font-size: 0.88rem; line-height: 1.9;
  transition: var(--transition);
}
.diet-editor textarea:focus { outline: none; border-color: var(--primary); }

/* ===================================================
   ANAMNESE
   =================================================== */
.anamnese-section {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; margin-bottom: 14px;
}
.anamnese-section h3 {
  font-size: 0.88rem; font-weight: 700; color: var(--primary-light);
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 14px;
}
.anamnese-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.anamnese-full { grid-column: 1 / -1; }
.anamnese-footer { display: flex; justify-content: flex-end; margin-top: 20px; }

/* ===================================================
   PROFILE & UPLOAD STYLES
   =================================================== */
.profile-pic-uploader {
  width: 60px; height: 60px; border-radius: 50%;
  border: 2px solid var(--primary); padding: 2px;
  cursor: pointer; transition: var(--transition);
  position: relative; overflow: hidden;
}
.profile-pic-uploader:hover { transform: scale(1.05); border-color: #fff; }

.posture-img-p {
  width: 120px; height: 160px; border-radius: 10px;
  object-fit: cover; border: 1px solid var(--border);
  position: relative;
}
.posture-remove-btn {
  position: absolute; top: 5px; right: 5px;
  background: rgba(0,0,0,0.6); color: #fff;
  border: none; border-radius: 50%; width: 20px; height: 20px;
  font-size: 0.7rem; cursor: pointer; display: flex;
  align-items: center; justify-content: center;
}

/* ===================================================
   DIET AUTO RESULT (from Dieta.html)
   =================================================== */
.diet-header-auto {
  background: #000; padding: 20px; border-radius: 15px;
  border-bottom: 4px solid var(--primary); margin-bottom: 20px;
}
.diet-macros-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
  margin-bottom: 20px;
}
@media (min-width: 600px) { .diet-macros-grid { grid-template-columns: repeat(4, 1fr); } }

.macro-box-auto {
  background: var(--surface2); padding: 15px; border-radius: 12px;
  text-align: center; border: 1px solid var(--border);
}
.macro-label-auto { font-size: 0.6rem; font-weight: 800; color: var(--text3); text-transform: uppercase; }
.macro-val-auto { font-size: 1.4rem; font-weight: 900; color: var(--text); }

.diet-option-card {
  background: var(--surface2); padding: 16px; border-radius: 15px;
  border: 1px solid var(--border); margin-bottom: 12px;
}
.diet-option-title {
  font-size: 0.9rem; font-weight: 800; color: var(--text);
  margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
}
.diet-option-item { font-size: 0.75rem; color: var(--text2); display: flex; justify-content: space-between; margin-bottom: 4px; }
.diet-option-qty { font-weight: 800; color: var(--text); }
/* ===================================================
   MOBILE OPTIMIZATION
   =================================================== */
/* ===================================================
   MOBILE OPTIMIZATION (Upgraded)
   =================================================== */
.sidebar-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px); z-index: 98;
  opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}

@media (max-width: 850px) {
  .modal-lg { width: 95vw; }
  .modal-box { width: 95vw; }
  
  /* Layout do Treinador Mobile com Sidebar Retrátil */
  .trainer-layout { 
    height: calc(100vh - 65px); 
    overflow: hidden; 
  }

  .trainer-sidebar {
    position: fixed;
    left: 0;
    top: 65px;
    height: calc(100vh - 65px);
    width: 250px;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    box-shadow: 10px 0 30px rgba(0,0,0,0.4);
    background: var(--bg2) !important;
    display: flex !important;
  }
  
  .trainer-sidebar.active {
    transform: translateX(0);
  }

  .trainer-main {
    width: 100%;
    height: 100%;
    padding: 15px;
    overflow-y: auto;
    display: block !important;
  }

  #trainer-menu-toggle-btn {
    display: block !important;
    margin-right: 15px;
  }

  /* Ajustes do Dashboard no Mobile */
  .dashboard-stats-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .dashboard-secondary-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .stat-group-card {
    padding: 15px;
  }

  .m-value {
    font-size: 1.2rem;
  }

  .quick-actions {
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 5px;
  }
  
  .quick-actions::-webkit-scrollbar { display: none; }

  /* Ajustes de Alunos no Mobile */
  .trainer-sidebar .sidebar-content-wrap {
    flex: 1;
    overflow-y: auto;
  }
  
  .trainer-sidebar .sidebar-content-wrap.hidden {
    display: none !important;
  }
  
  .trainer-sidebar .sidebar-content-wrap:not(.hidden) {
    display: flex !important;
    flex-direction: column;
  }


  /* Navbar Mobile Refined */
  .navbar { height: 65px; border-bottom: 1px solid var(--border); padding: 0 10px; }
  .nav-brand { gap: 8px; }
  .nav-brand-text { font-size: 0.9rem; }
  .nav-actions { gap: 4px; }
  .nav-btn { font-size: 0.75rem !important; padding: 6px 8px !important; }
  .cloud-status { scale: 1; margin: 0 2px; }
  .theme-cycle-btn { padding: 6px !important; }

  .trainer-main-nav {
    padding: 12px;
    gap: 4px;
    border-bottom: 1px solid var(--border);
  }
  
  .tnav-link { 
    padding: 10px 12px;
    font-size: 0.85rem;
  }
  
  .student-item-name { font-size: 0.9rem; max-width: 160px; }

  /* Estilo do botão voltar do treinador */
  .btn-back-trainer {
    display: flex !important;
    align-items: center;
    gap: 8px;
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 850;
    margin-bottom: 15px;
    cursor: pointer;
    width: fit-content;
  }
  .btn-back-trainer span { font-size: 1.2rem; }
}

@media (max-width: 600px) {
  .login-card { padding: 32px 20px; width: 100%; margin: 0 10px; }
  .login-logo-img { height: 50px; }
  .logo-text { font-size: 1.4rem; }
  
  .navbar { padding: 0 10px; }
  .nav-brand-text { font-size: 0.8rem; }
  .nav-badge { display: none; }
  .nav-actions { gap: 6px; }
  .nav-actions .nav-student-name { display: none; }
  .nav-actions .nav-btn { 
    padding: 5px; border: none; background: transparent; 
    width: auto; min-width: 40px; height: auto; 
    display: flex; flex-direction: column; align-items: center; justify-content: center; 
    font-size: 1.2rem; gap: 0; line-height: 1;
  }
  .nav-actions .nav-btn span { font-size: 0.65rem; font-weight: 800; text-transform: uppercase; margin-top: -2px; }
  .theme-selector { margin: 0; scale: 0.85; }
  .cloud-status { margin: 0; padding: 0; border: none; background: transparent; width: 28px; height: 28px; justify-content: center; font-size: 1rem; }
  
  .student-layout, .admin-layout { display: block; position: relative; }
  
  .student-side-menu, .admin-sidebar { 
    position: fixed; left: 0; top: 60px; bottom: 0; 
    z-index: 99; transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 280px !important;
    height: calc(100vh - 60px) !important;
    border-right: 1px solid var(--border);
    background: var(--bg);
  }
  
  .student-side-menu.menu-collapsed, .admin-sidebar.menu-collapsed { 
    transform: translateX(-100%); 
    width: 280px !important; 
  }
  .student-side-menu:not(.menu-collapsed), .admin-sidebar:not(.menu-collapsed) { 
    transform: translateX(0); 
  }
  
  .student-side-menu:not(.menu-collapsed) ~ .sidebar-backdrop,
  .admin-sidebar:not(.menu-collapsed) ~ .sidebar-backdrop {
    opacity: 1; pointer-events: auto;
  }
  
  .student-main, .admin-main { width: 100% !important; padding: 12px; }
}

.btn-back-trainer { display: none; } /* Esconde por padrão no desktop */

/* Status da Nuvem */
.cloud-status {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.75rem; font-weight: 700;
  padding: 4px 10px; border-radius: 20px;
  background: var(--surface2); border: 1px solid var(--border);
  margin-left: 10px;
}
.cloud-status.online { color: #28c96a; border-color: rgba(40, 201, 106, 0.3); }
.cloud-status.offline { color: #ff4757; border-color: rgba(255, 71, 87, 0.3); }
.cloud-status.syncing { color: var(--primary); border-color: rgba(255, 107, 0, 0.3); }
/* ===================================================
   REST TIMER
   =================================================== */
#rest-timer {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
  animation: timerSlideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  background: rgba(15, 15, 15, 0.9); backdrop-filter: blur(12px);
  border: 1px solid var(--border2); border-radius: 24px;
  padding: 16px 20px; display: flex; align-items: center; gap: 20px;
  z-index: 2000; box-shadow: var(--shadow-lg);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
#rest-timer.rest-timer-hidden { display: none !important; }

@keyframes timerSlideIn {
  from { opacity: 0; transform: translateX(-50%) translateY(40px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.timer-circle-wrap { position: relative; width: 70px; height: 70px; display: flex; align-items: center; justify-content: center; }
.timer-svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer-bg { fill: none; stroke: var(--surface3); stroke-width: 5; }
.timer-bar { 
  fill: none; stroke: var(--primary); stroke-width: 5; stroke-linecap: round;
  stroke-dasharray: 220; stroke-dashoffset: 0; transition: stroke-dashoffset 1s linear;
}
#timer-seconds { 
  position: absolute; font-size: 1.4rem; font-weight: 950; 
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 4px var(--primary-glow)); 
}

.timer-controls { display: flex; flex-direction: column; gap: 6px; }
.timer-adj { 
  background: var(--surface2); color: var(--text2); border: none; padding: 4px 10px; 
  border-radius: 6px; font-size: 0.7rem; cursor: pointer; font-weight: 700;
}
.timer-stop { 
  background: var(--red); color: #fff; border: none; padding: 6px 14px; 
  border-radius: 8px; font-size: 0.75rem; cursor: pointer; font-weight: 800;
  text-transform: uppercase;
}
.timer-stop:hover { filter: brightness(1.2); }

.timer-presets { display: flex; flex-direction: column; gap: 4px; }
.timer-preset-btn {
  background: var(--surface2); color: var(--text3); border: 1px solid var(--border); 
  padding: 4px 8px; border-radius: 6px; font-size: 0.65rem; cursor: pointer; 
  font-weight: 700; transition: var(--transition);
}
.timer-preset-btn:hover { background: var(--primary-glow); color: var(--primary); border-color: var(--primary); }

/* ===================================================
   CALENDAR & EVOLUTION
   =================================================== */
.evolution-chart-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow);
}
.calendar-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px;
  max-width: 350px; margin: 0 auto;
}
.cal-day {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  background: var(--surface2); border-radius: 8px; font-size: 0.75rem;
  color: var(--text3); border: 1px solid transparent;
}
.cal-day.active { background: var(--bg3); color: var(--text2); }
.cal-day.today { border: 2px solid var(--primary); color: var(--primary); font-weight: 900; }
.cal-day.completed { 
  background: var(--primary-gradient);
  color: #fff; font-weight: 800; border: none;
  box-shadow: 0 4px 12px var(--primary-glow);
}
.calendar-header-day { text-align: center; font-size: 0.65rem; color: var(--text3); font-weight: 800; text-transform: uppercase; margin-bottom: 4px; }

/* ===================================================
   PWA INSTALL BUTTON
   =================================================== */
.btn-install-pwa {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin-top: 16px;
  padding: 14px 20px;
  background: linear-gradient(135deg, #43e97b, #1dc958);
  color: #fff;
  border: none;
  border-radius: 14px;
  font-size: 1rem;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.3px;
  box-shadow: 0 4px 20px rgba(67, 233, 123, 0.35);
  animation: pulse-badge 2.5s infinite;
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn-install-pwa:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(67, 233, 123, 0.45); }
.btn-install-pwa span { font-size: 1.3rem; }

/* Esconde em desktop, mostra só em mobile */
@media (min-width: 768px) {
  .btn-install-pwa { display: none !important; }
}

/* ===================================================
   RICH TEXT EDITOR (RTE)
   =================================================== */
.rte-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px 10px 0 0;
  margin-bottom: 0;
}
.rte-btn {
  background: var(--surface3);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 10px;
  cursor: pointer;
  font-size: 0.8rem;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s;
  min-width: 32px;
}
.rte-btn:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
.rte-btn.rte-color { font-weight: 900; font-size: 1rem; min-width: 28px; padding: 3px 8px; }
.rte-divider { width: 1px; background: var(--border); align-self: stretch; margin: 2px 4px; }

.rte-body {
  min-height: 220px;
  max-height: 500px;
  overflow-y: auto;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 10px 10px;
  padding: 16px;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.7;
  outline: none;
}
.rte-body:focus { border-color: var(--primary); }
.rte-body:empty::before {
  content: attr(data-placeholder);
  color: var(--text3);
  pointer-events: none;
}
.rte-body h2 { font-size: 1.4rem; font-weight: 900; margin: 12px 0 6px; color: var(--text); }
.rte-body h4 { font-size: 1.1rem; font-weight: 700; margin: 10px 0 4px; color: var(--text2); }
.rte-body p  { margin-bottom: 8px; }

/* Estilos no lado do aluno */
.rte-student-view h2 { font-size: 1.4rem; font-weight: 900; margin: 14px 0 6px; color: var(--text); }
.rte-student-view h4 { font-size: 1.1rem; font-weight: 700; margin: 10px 0 4px; color: var(--text2); }
.rte-student-view p  { font-size: 1rem; line-height: 1.7; margin-bottom: 8px; }
.rte-student-view iframe { border-radius: 10px; }
/* ===================================================
   THEMES & THEME SELECTOR 
   =================================================== */

/* CLEAN LIGHT THEME (ESTILO APPLE) */
[data-theme="light"] {
  --bg: #F8F9FA;
  --bg2: #FFFFFF;
  --nav-bg: rgba(255, 255, 255, 0.85);
  --surface: #FFFFFF;
  --surface2: #E9ECEF;
  --surface3: #DEE2E6;
  --text: #212529;
  --text2: #495057;
  --text3: #ADB5BD;
  --border: rgba(0, 0, 0, 0.08);
  --glass: rgba(255, 255, 255, 0.8);
  --success: #28A745;
  --danger: #DC3545;
  --primary-glow: rgba(255, 107, 0, 0.15);
  --border2: rgba(255, 107, 0, 0.3);
}

/* FASHION BARBIE THEME (DELICATE PINK) */
[data-theme="barbie"] {
  --primary: #FF69B4;
  --primary-rgb: 255, 105, 180;
  --primary-light: #FFB6C1;
  --bg: #FFF0F5; /* LavenderBlush */
  --bg2: #FFE4E1; /* MistyRose */
  --nav-bg: rgba(255, 240, 245, 0.95);
  --surface: #FFFFFF;
  --surface2: #FFF5F7;
  --surface3: #FFDDF0;
  --text: #702963; /* Byzantium lightened */
  --text2: #A13D8D;
  --text3: #C080BA;
  --border: rgba(255, 105, 180, 0.15);
  --border2: rgba(255, 105, 180, 0.25);
  --success: #6AC983;
  --danger: #FF708C;
  --primary-glow: rgba(255, 105, 180, 0.2);
  --shadow: 0 4px 15px rgba(255, 105, 180, 0.1);
  --radius: 18px; /* Mais arredondado */
}

/* Seletor de Temas Premium */
.theme-selector {
  display: flex;
  background: var(--surface2);
  padding: 4px;
  border-radius: 14px;
  margin: 10px 14px 25px 14px;
  gap: 4px;
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
}

.nav-actions .theme-selector {
  margin: 0;
  padding: 2px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
}

.theme-btn {
  flex: 1;
  padding: 10px 4px;
  border: none;
  background: transparent;
  color: var(--text2);
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 11px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  appearance: none;
  -webkit-appearance: none;
}

.nav-actions .theme-btn {
  padding: 0 8px;
  height: 26px;
  font-size: 0.65rem;
  border-radius: 7px;
}

.theme-btn:hover {
  color: var(--text);
  background: rgba(0,0,0,0.03);
}

.theme-btn.active {
  background: var(--bg2);
  color: var(--primary);
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  transform: scale(1.02);
}

[data-theme="dark"] .theme-btn.active {
  background: var(--surface3) !important;
}

[data-theme="dark"] .theme-btn:hover {
  background: rgba(255,255,255,0.05) !important;
}

/* Ajustes Medidas */
.measurements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-top: 15px;
}
.measure-input-group {
  background: var(--surface);
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
}
.measure-input-group label {
  display: block;
  font-size: 0.7rem;
  color: var(--text2);
  margin-bottom: 5px;
}
.measure-input-group input {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 1.1rem;
  font-weight: bold;
  padding: 0;
}
.measure-input-group input:focus { outline: none; border-bottom: 1px solid var(--primary); }

/* Plano Expirado */
.plan-expired-msg {
  padding: 24px 16px;
  animation: fadeIn 0.4s ease;
}
.expired-card {
  background: linear-gradient(135deg, rgba(255,107,0,0.1), rgba(255,71,87,0.1));
  border: 1px solid var(--danger);
  border-radius: var(--radius);
  padding: 30px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.expired-card span { font-size: 3rem; margin-bottom: 5px; }
.expired-card h3 { color: var(--danger); font-size: 1.3rem; font-weight: 800; }
.expired-card p { color: var(--text2); font-size: 0.9rem; line-height: 1.5; max-width: 300px; }
.expired-card .btn-primary { margin-top: 10px; width: 100%; max-width: 240px; }

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

@media (max-width: 600px) {
  .student-panel-header { padding: 16px; gap: 12px; }
  .student-avatar-lg { width: 50px; height: 50px; font-size: 1.2rem; }
  .student-info-header h2 { font-size: 1.1rem; }
  .student-header-actions {
     display: grid;
     grid-template-columns: 1fr 1fr;
     width: 100%;
     gap: 8px;
  }
  .student-header-actions button {
     padding: 8px;
     font-size: 0.75rem;
     justify-content: center;
  }
}

/* --- Trainer Dashboard Improvements --- */
.trainer-welcome {
  height: auto;
  min-height: calc(100vh - 120px);
  padding: 40px 20px;
  justify-content: flex-start;
  display: flex;
}

.welcome-header {
  display: flex;
  align-items: center;
  gap: 25px;
  margin-bottom: 50px;
  text-align: left;
  width: 100%;
  max-width: 1000px;
}

.welcome-icon {
  font-size: 3.5rem;
  background: var(--surface);
  width: 110px;
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 28px;
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  flex-shrink: 0;
}

.welcome-text h2 {
  font-size: 2.4rem;
  font-weight: 850;
  margin-bottom: 6px;
  background: linear-gradient(135deg, var(--text) 30%, var(--text3) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.1;
}

.welcome-text p {
  font-size: 1.1rem;
  color: var(--text2);
}

.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  width: 100%;
  max-width: 1100px;
  margin-bottom: 50px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 32px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.stat-card:hover {
  transform: translateY(-8px);
  border-color: var(--primary);
  box-shadow: 0 20px 40px rgba(255,107,0,0.12);
  background: var(--surface2);
}

.stat-value {
  font-size: 3rem;
  font-weight: 950;
  display: inline-block;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 12px;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text3);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.stat-card.warning .stat-value { color: #ff9f43; }
.stat-card.info .stat-value { color: #00d2ff; }
.stat-card.success .stat-value { color: #28c96a; }

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 8px;
  color: var(--text2);
}

.sidebar-nav-item:hover {
  background: var(--surface2);
  color: var(--text);
}

.sidebar-nav-item.active {
  background: var(--primary-glow);
  color: var(--primary);
  font-weight: 700;
}

/* --- Admin Navigation & Sections --- */
.admin-nav-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 20px;
  border: none;
  background: none;
  color: var(--text2);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border-radius: 12px;
  margin-bottom: 4px;
  text-align: left;
}

.admin-nav-btn:hover {
  background: var(--surface2);
  color: var(--text);
}

.admin-nav-btn.active {
  background: var(--primary-gradient);
  color: #fff;
  box-shadow: 0 4px 15px var(--primary-glow);
}

.master-exercise-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.master-exercise-card:hover {
  transform: translateY(-5px);
  border-color: var(--primary);
  box-shadow: 0 10px 25px rgba(255,107,0,0.15);
}

.master-exercise-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--bg3);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  border: 1px solid var(--border);
}

.master-exercise-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.master-exercise-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  color: #fff;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.master-exercise-info h4 {
  font-size: 1.05rem;
  font-weight: 850;
  margin-bottom: 2px;
  color: var(--text);
}

.master-exercise-info p {
  font-size: 0.82rem;
  color: var(--text3);
}

.stat-group-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  transition: var(--transition);
}

.stat-group-card:hover {
  border-color: var(--primary-glow);
}

.stat-group-card h4 {
  font-size: 1.15rem;
  font-weight: 950;
  color: var(--text);
  margin-bottom: 5px;
}

/* --- Trainer Sidebar Improvements --- */
.trainer-main-nav {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.tnav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: none;
  color: var(--text2);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}

.tnav-link:hover {
  background: var(--surface2);
  color: var(--text);
}

.tnav-link.active {
  background: var(--primary-gradient);
  color: #fff;
  border: none;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.tnav-icon {
  font-size: 1.2rem;
}

.sidebar-content-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.trainer-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 60vh;
  text-align: center;
  padding: 40px;
  color: var(--text2);
  animation: fadeIn 0.5s ease;
}

.empty-icon {
  font-size: 4rem;
  margin-bottom: 20px;
  opacity: 0.3;
}

.trainer-empty-state h2 {
  font-size: 1.5rem;
  margin-bottom: 10px;
  color: var(--text);
}

.trainer-empty-state p {
  font-size: 0.95rem;
  max-width: 300px;
  line-height: 1.6;
}

/* --- Workout Volume Summary --- */
.workout-summary-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
}

.workout-summary-wrap h5 {
  margin: 0 0 12px 0;
  font-size: 0.85rem;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.muscle-group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
}

.muscle-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s;
}

.muscle-card:hover {
  border-color: var(--primary-glow);
  transform: translateY(-1px);
}

.muscle-name {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-right: 4px;
}

.muscle-sets {
  background: var(--primary-gradient);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 6px;
  min-width: 24px;
  text-align: center;
  box-shadow: 0 2px 5px var(--primary-glow);
}

.total-sets-bar {
  margin-top: 15px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  font-size: 0.9rem;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.total-sets-bar span {
  color: var(--success);
  font-weight: 800;
}

/* Workout Visibility Selector (Segmented Control) */
.workout-vis-container {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 12px 16px;
  border-radius: 16px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.workout-vis-label {
  font-size: 0.85rem;
  color: var(--text2);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}
.workout-vis-selector {
  display: flex;
  background: var(--bg2);
  border-radius: 12px;
  padding: 4px;
  gap: 4px;
  border: 1px solid var(--border);
  min-width: 320px;
}
.vis-option {
  flex: 1;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text3);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
  white-space: nowrap;
  user-select: none;
}
.vis-option:hover {
  background: var(--surface);
  color: var(--text2);
}
.vis-option.active {
  background: var(--primary-gradient);
  color: #fff;
  box-shadow: 0 4px 12px var(--primary-glow);
}

/* Estado visual para o que o aluno não vê (no painel do professor) */
.vis-hidden-student {
  opacity: 0.6;
  filter: grayscale(0.5);
  position: relative;
}
.vis-hidden-student::after {
  content: '👁️ Oculto para o Aluno';
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--surface2);
  color: var(--text3);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  border: 1px solid var(--border);
  z-index: 5;
}

#modal-templates {
  z-index: 1100;
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.template-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.template-card:hover {
  border-color: var(--primary);
  background: var(--surface);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.supplement-card-hover:hover {
  transform: translateY(-5px);
  border-color: var(--primary);
  box-shadow: 0 12px 30px rgba(0,0,0,0.2) !important;
}

.supplement-card-hover a:hover {
  background: var(--primary) !important;
  color: #fff !important;
  transform: scale(1.02);
}
.template-card span {
  font-size: 2rem;
}
.template-card-name {
  font-weight: 700;
  color: var(--text);
  font-size: 0.95rem;
}
.template-card-meta {
  color: var(--text3);
  font-size: 0.75rem;
}
.template-empty {
  text-align: center;
  padding: 40px;
  color: var(--text3);
}

/* ===================================================
   PROGRESS & STAGNATION
   =================================================== */
.stagnation-badge {
    background: rgba(255, 71, 87, 0.1);
    color: var(--red);
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 1px solid rgba(255, 71, 87, 0.3);
}
.stagnant-row {
    background: rgba(255, 71, 87, 0.05);
}
.stagnant-row td {
    border-left: 3px solid var(--red);
}

/* Plan Selector Interativo */
.plan-toggle-btn.active {
  background: var(--primary-gradient) !important;
  color: #fff !important;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.plan-toggle-btn:hover:not(.active) {
  background: var(--surface2) !important;
  color: var(--text) !important;
}

/* ===================================================
   ADMIN SPECIFIC STYLES
   =================================================== */
.master-exercise-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}
.master-exercise-card:hover {
  transform: translateY(-5px);
  border-color: var(--primary);
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
.master-exercise-thumb {
  position: relative;
  height: 120px;
  overflow: hidden;
  background: var(--bg3);
}
.master-exercise-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.master-exercise-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  color: #fff;
  padding: 4px 10px;
  border-radius: 10px;
  font-size: 0.65rem;
  font-weight: 800;
  z-index: 2;
}
.master-exercise-info {
  padding: 15px;
  flex-grow: 1;
}
.master-exercise-info h4 {
  margin: 0 0 5px;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text);
}
.master-exercise-info p {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text3);
}

.stat-group-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--shadow);
}
.stat-group-card h4 {
  margin: 0 0 20px;
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--text);
  border-bottom: 2px solid var(--primary);
  padding-bottom: 10px;
  display: inline-block;
}
.stat-group-card .form-group label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text2);
  margin-bottom: 6px;
}
.stat-group-card input, .stat-group-card select {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  color: var(--text);
  width: 100%;
  font-family: inherit;
  font-size: 0.9rem;
}
.stat-group-card input:focus {
  border-color: var(--primary);
  outline: none;
}

/* SUBSCRIPTION MODAL */
.subscription-modal {
    max-width: 900px !important;
}
.subscription-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-top: 10px;
}
.sub-card {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 30px 20px;
    text-align: center;
    position: relative;
    transition: transform 0.3s ease, border-color 0.3s ease;
}
.sub-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
}
.sub-card.premium {
    border: 2px solid var(--primary);
    box-shadow: 0 0 20px rgba(255, 107, 0, 0.15);
}
.sub-card h3 {
    margin-bottom: 10px;
    color: var(--text);
    font-size: 1.1rem;
}
.sub-price {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 20px;
    color: var(--primary);
}
.sub-price span {
    font-size: 0.9rem;
    color: var(--text3);
    font-weight: 400;
}
.sub-features {
    list-style: none;
    padding: 0;
    margin: 0 0 30px 0;
    text-align: left;
}
.sub-features li {
    margin-bottom: 10px;
    font-size: 0.8rem;
    color: var(--text2);
}
.sub-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: #000;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 4px 12px;
    border-radius: 20px;
    white-space: nowrap;
}
.premium-btn-sidebar {
    background: linear-gradient(45deg, var(--primary), #FF8C00) !important;
    color: #000 !important;
    font-weight: 800 !important;
    margin-top: 5px;
    border: none !important;
    box-shadow: 0 4px 15px rgba(255, 107, 0, 0.3);
}
.premium-btn-sidebar .smenu-icon {
    filter: brightness(0);
}
@media (max-width: 768px) {
    .subscription-grid {
        grid-template-columns: 1fr;
    }
}
