@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=Quicksand:wght@500;600;700&display=swap');

:root {
  --bg-primary: #0a0a0a;
  --bg-secondary: #111111;
  --bg-card: #141414;
  --bg-card-hover: #1a1a1a;
  --text-primary: #ffffff;
  --text-secondary: #c0c0c0;
  --gold: #c8a45e;
  --gold-gradient: linear-gradient(135deg, #c8a45e 0%, #d4af37 50%, #b8942e 100%);
  --transition: 0.3s ease;
  --font-heading: 'Playfair Display', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
}

.portal-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background-color: var(--bg-secondary);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  padding: 24px;
  display: flex;
  flex-direction: column;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  margin-bottom: 40px;
}

.sidebar-logo img {
  height: 30px;
  border-radius: 4px;
}

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

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 8px;
  transition: all var(--transition);
}

.nav-item:hover, .nav-item.active {
  background: rgba(200, 164, 94, 0.1);
  color: var(--gold);
}

.nav-item svg {
  width: 18px;
  height: 18px;
}

.logout-btn {
  margin-top: auto;
  color: #ff4757;
}

.logout-btn:hover {
  background: rgba(255, 71, 87, 0.1);
  color: #ff4757;
}

/* Main Content */
.main-content {
  flex: 1;
  padding: 40px;
  overflow-y: auto;
}

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

.page-title {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 600;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gold-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: var(--bg-primary);
}

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

.card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 24px;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Login Specific */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg-primary);
}

.login-card {
  background: var(--bg-card);
  padding: 40px;
  border-radius: 16px;
  width: 100%;
  max-width: 400px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  text-align: center;
}

.login-logo-img {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 16px;
  display: block;
  border: 2px solid rgba(200, 164, 94, 0.5);
  box-shadow: 0 0 24px rgba(200, 164, 94, 0.2);
}

.login-logo {
  font-family: 'Quicksand', var(--font-body);
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: 3px;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 8px;
}

.login-subtitle {
  color: var(--text-secondary);
  margin-bottom: 32px;
  font-size: 0.9rem;
}

.form-group {
  margin-bottom: 20px;
  text-align: left;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.form-group input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-primary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: var(--font-body);
}

.form-group input:focus {
  outline: none;
  border-color: var(--gold);
}

.btn-login {
  width: 100%;
  padding: 14px;
  background: var(--gold-gradient);
  color: var(--bg-primary);
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all var(--transition);
  margin-top: 10px;
}

.btn-login:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

.error-message {
  color: #ff4757;
  font-size: 0.85rem;
  margin-top: 12px;
  display: none;
}
/* File Cards */
.file-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: var(--bg-primary);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  margin-bottom: 12px;
  transition: all var(--transition);
}
.file-card:hover {
  border-color: var(--gold);
}
.file-info {
  display: flex;
  align-items: center;
  gap: 12px;
}
.file-icon {
  width: 40px;
  height: 40px;
  background: rgba(200, 164, 94, 0.1);
  color: var(--gold);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.file-details h4 {
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 4px;
}
.file-details p {
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.file-actions {
  display: flex;
  gap: 8px;
}
.btn-icon {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px;
  border-radius: 4px;
  transition: all var(--transition);
}
.btn-icon:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}
.btn-icon.delete:hover {
  background: rgba(255, 71, 87, 0.1);
  color: #ff4757;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(5px);
}
.modal-overlay.active {
  display: flex;
}
.modal-content {
  background: var(--bg-card);
  width: 90%;
  max-width: 500px;
  border-radius: 16px;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
}
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
}
.modal-close:hover {
  color: var(--text-primary);
}

/* Upload Zone */
.upload-zone {
  border: 2px dashed rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 40px 20px;
  text-align: center;
  margin-bottom: 24px;
  cursor: pointer;
  transition: all var(--transition);
}
.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--gold);
  background: rgba(200, 164, 94, 0.05);
}
.upload-icon {
  color: var(--gold);
  margin-bottom: 12px;
}
.upload-text {
  color: var(--text-secondary);
  font-size: 0.9rem;
}
.btn-primary {
  padding: 10px 20px;
  background: var(--gold-gradient);
  color: var(--bg-primary);
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-primary:hover {
  opacity: 0.9;
}

/* =========================================
   STUDENT DETAILS & TABS
   ========================================= */
.student-detail-section {
  display: none;
  animation: fadeIn 0.4s ease forwards;
}

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

.student-header {
  background: var(--bg-card);
  padding: 32px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.student-header-info h2 {
  font-family: var(--font-heading);
  font-size: 2rem;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.student-header-info p {
  color: var(--gold);
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-outline {
  padding: 10px 20px;
  background: transparent;
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-outline:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(200, 164, 94, 0.05);
}

/* Tabs */
.tabs-nav {
  display: flex;
  gap: 32px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 32px;
}

.tab-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.1rem;
  font-weight: 500;
  padding: 0 0 16px 0;
  cursor: pointer;
  position: relative;
  transition: color var(--transition);
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  color: var(--gold);
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--gold-gradient);
  border-radius: 2px 2px 0 0;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.4s ease forwards;
}

/* =========================================
   WEEKLY SCHEDULE GRID (AGENDA)
   ========================================= */
.weekly-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 16px;
  margin-bottom: 40px;
}

.day-column {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition), border-color var(--transition);
}

.day-column:hover {
  transform: translateY(-4px);
  border-color: rgba(200, 164, 94, 0.3);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.day-header {
  background: rgba(255, 255, 255, 0.02);
  padding: 16px;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.day-name {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--gold);
  font-weight: 600;
  display: block;
  margin-bottom: 4px;
}

.day-date {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.day-content {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 200px;
}

/* Workout & Diet Cards inside Agenda */
.agenda-card {
  background: var(--bg-secondary);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 12px;
  font-size: 0.85rem;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition);
}

.agenda-card:hover {
  background: rgba(255, 255, 255, 0.05);
}

.agenda-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 3px;
  border-radius: 3px 0 0 3px;
}

.agenda-card.workout::before {
  background: #ff4757;
}

.agenda-card.diet::before {
  background: #2ed573;
}

.agenda-card-title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.agenda-card-desc {
  color: var(--text-secondary);
  font-size: 0.75rem;
  line-height: 1.4;
}

.add-agenda-btn {
  margin-top: auto;
  width: 100%;
  padding: 8px;
  background: transparent;
  border: 1px dashed rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition);
  font-size: 0.85rem;
}

.add-agenda-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(200, 164, 94, 0.05);
}

@media (max-width: 1200px) {
  .weekly-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}

/* =========================================
   V2 — GESTÃO DE ALUNOS
   ========================================= */
.section-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.students-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.student-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  transition: border-color var(--transition);
}

.student-card:hover {
  border-color: rgba(200, 164, 94, 0.35);
}

.student-card-main {
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  flex: 1;
  min-width: 220px;
}

.student-card-info h3 {
  color: var(--text-primary);
  font-size: 1.1rem;
}

.student-card-info > span {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.student-badges {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.badge {
  font-size: 0.72rem;
  padding: 2px 10px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
}

.badge.on {
  border-color: rgba(200, 164, 94, 0.5);
  color: var(--gold);
  background: rgba(200, 164, 94, 0.08);
}

.student-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-sm {
  padding: 8px 14px;
  font-size: 0.85rem;
}

.btn-danger {
  padding: 12px 20px;
  background: #ff4757;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-danger:hover:not(:disabled) { opacity: 0.9; }
.btn-danger:disabled { opacity: 0.4; cursor: not-allowed; }

.danger-box {
  background: rgba(255, 71, 87, 0.08);
  border: 1px solid rgba(255, 71, 87, 0.3);
  border-radius: 8px;
  padding: 14px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.danger-box ul { margin: 8px 0 0 20px; }

.confirm-check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  cursor: pointer;
}

.confirm-check input { accent-color: #ff4757; width: 18px; height: 18px; }

.modal-msg { margin-top: 12px; font-size: 0.85rem; min-height: 1.2em; }

/* =========================================
   V2 — INPUTS E CONTROLES
   ========================================= */
.select-input,
.search-input {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-primary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.9rem;
}

.select-input:focus,
.search-input:focus { outline: none; border-color: var(--gold); }

.search-input { margin-bottom: 12px; padding: 12px 16px; }

.modal-lg {
  max-width: 720px;
  max-height: 88vh;
  overflow-y: auto;
}

/* Modais empilhados sobre o editor de dia */
#exercisePickerModal, #foodPickerModal, #mealModal, #supplementModal { z-index: 1100; }

.filter-pills {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.filter-pills.scroll-x {
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 6px;
  -webkit-overflow-scrolling: touch;
}

.pill {
  padding: 7px 16px;
  border-radius: 20px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
  font-family: var(--font-body);
}

.pill:hover { border-color: var(--gold); color: var(--gold); }

.pill.active {
  background: var(--gold-gradient);
  border-color: transparent;
  color: var(--bg-primary);
  font-weight: 600;
}

.day-pills { display: flex; gap: 8px; flex-wrap: wrap; }

.picker-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 46vh;
  overflow-y: auto;
  padding-right: 4px;
}

.picker-group-title {
  font-family: var(--font-heading);
  color: var(--gold);
  font-size: 0.95rem;
  margin: 14px 0 4px;
  position: sticky;
  top: 0;
  background: var(--bg-card);
  padding: 4px 0;
}

.picker-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  background: var(--bg-primary);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-body);
}

.picker-item:hover {
  border-color: var(--gold);
  background: rgba(200, 164, 94, 0.06);
}

.picker-item-detail { color: var(--text-secondary); font-size: 0.78rem; white-space: nowrap; }

.chip {
  font-size: 0.7rem;
  padding: 2px 10px;
  border-radius: 20px;
  background: rgba(200, 164, 94, 0.12);
  color: var(--gold);
  white-space: nowrap;
}

.chip-alt {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-secondary);
}

/* =========================================
   V2 — CONSTRUTOR DE TREINO
   ========================================= */
.builder-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.builder-hint { color: var(--text-secondary); font-size: 0.9rem; }

.save-indicator {
  font-size: 0.82rem;
  color: var(--text-secondary);
  transition: color var(--transition);
}
.save-indicator.saving { color: var(--gold); }
.save-indicator.saved { color: #4cd137; }
.save-indicator.error { color: #ff4757; }

.day-column.today {
  border-color: rgba(200, 164, 94, 0.5);
  box-shadow: 0 0 0 1px rgba(200, 164, 94, 0.3);
}

.day-column.today .day-header { background: rgba(200, 164, 94, 0.08); }

.workout-card, .rest-card { border-left: 3px solid var(--gold); }
.rest-card { border-left-color: rgba(200, 164, 94, 0.4); }

.mini-exercise-list {
  list-style: none;
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mini-exercise-list li {
  color: var(--text-secondary);
  font-size: 0.74rem;
  line-height: 1.4;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  padding-top: 4px;
}

.mini-detail { color: var(--gold); font-weight: 600; }
.mini-more { color: var(--gold); font-style: italic; }

.edit-hint {
  display: block;
  margin-top: 8px;
  color: var(--gold);
  font-size: 0.75rem;
  opacity: 0.7;
}

.empty-note { color: var(--text-secondary); font-size: 0.88rem; }

.rest-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  margin-bottom: 16px;
  cursor: pointer;
  color: var(--text-secondary);
}

.rest-toggle input { accent-color: var(--gold); width: 18px; height: 18px; }

.day-editor-fields { display: flex; gap: 12px; }

.exercise-row {
  background: var(--bg-primary);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 10px;
}

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

.exercise-order {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(200, 164, 94, 0.15);
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.exercise-name-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  flex-wrap: wrap;
}

.exercise-name { font-weight: 600; font-size: 0.92rem; }

.exercise-row-tools { display: flex; gap: 2px; }
.exercise-row-tools .btn-icon:disabled { opacity: 0.25; cursor: default; }

.exercise-row-controls {
  display: grid;
  grid-template-columns: 90px 130px 110px 1fr;
  gap: 10px;
}

.exercise-row-controls label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.exercise-row-controls input {
  padding: 10px 12px;
  background: var(--bg-secondary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.85rem;
}

.exercise-row-controls input:focus { outline: none; border-color: var(--gold); }

.day-editor-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-wrap: wrap;
}

.duplicate-row { display: flex; gap: 8px; align-items: center; }
.duplicate-row .select-input { width: auto; min-width: 120px; }

/* =========================================
   V2 — CONSTRUTOR DE DIETA
   ========================================= */
.goals-card { margin-bottom: 20px; }

.goals-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.goals-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.goals-grid input {
  padding: 10px 12px;
  background: var(--bg-primary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border-radius: 8px;
  font-family: var(--font-body);
}

.goals-grid input:focus { outline: none; border-color: var(--gold); }

.macro-bars { display: flex; flex-direction: column; gap: 8px; }

.macro-bar-row {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 12px;
}

.macro-bar-label { font-size: 0.78rem; color: var(--text-secondary); }

.macro-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  overflow: hidden;
}

.macro-bar-fill {
  height: 100%;
  background: var(--gold-gradient);
  border-radius: 4px;
  transition: width 0.4s ease;
}

.macro-bar-fill.over { background: #ff4757; }

.macro-bar-value { font-size: 0.78rem; color: var(--text-secondary); white-space: nowrap; }

.meals-wrap { display: flex; flex-direction: column; gap: 16px; }

.meal-card { padding: 20px; }

.meal-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.meal-card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 1rem;
}

.meal-card-title strong { color: var(--gold); font-family: var(--font-heading); font-size: 1.05rem; }
.meal-card-title .edit-hint { margin-top: 0; }

.meal-time { color: var(--text-secondary); font-size: 0.8rem; }

.meal-card-tools { display: flex; align-items: center; gap: 8px; }

.meal-kcal {
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 600;
  background: rgba(200, 164, 94, 0.1);
  padding: 3px 12px;
  border-radius: 20px;
  white-space: nowrap;
}

.meal-item {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.88rem;
}

.meal-item.readonly { grid-template-columns: 1fr auto auto; }

.meal-item-name { color: var(--text-primary); }

.meal-item-qty {
  color: var(--text-secondary);
  font-size: 0.82rem;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
}

.meal-item-qty input {
  width: 64px;
  padding: 6px 8px;
  background: var(--bg-primary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border-radius: 6px;
  font-size: 0.82rem;
  text-align: right;
}

.meal-item-qty input:focus { outline: none; border-color: var(--gold); }

.meal-item-macros { color: var(--text-secondary); font-size: 0.76rem; white-space: nowrap; }

.macro-preview {
  display: flex;
  gap: 16px;
  padding: 14px;
  background: rgba(200, 164, 94, 0.06);
  border: 1px solid rgba(200, 164, 94, 0.2);
  border-radius: 8px;
  color: var(--gold);
  font-size: 0.9rem;
  font-weight: 600;
  flex-wrap: wrap;
}

.custom-food-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.custom-food-grid input, .custom-food-grid select { width: 100%; }

.custom-food-grid .form-group { margin-bottom: 8px; }

.custom-food-grid .form-group input {
  padding: 10px 12px;
  background: var(--bg-primary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border-radius: 8px;
  font-family: var(--font-body);
}

.supplements-card { margin-top: 24px; }

.supplement-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.supplement-row:first-child { border-top: none; }

.supplement-info { display: flex; flex-direction: column; gap: 2px; }
.supplement-info strong { color: var(--text-primary); font-size: 0.95rem; }
.supplement-info span { color: var(--text-secondary); font-size: 0.82rem; }

.add-agenda-btn.big { padding: 14px; font-size: 0.95rem; }

/* =========================================
   V2 — PAINEL DO ALUNO
   ========================================= */
.view { display: none; }
.view.active { display: block; animation: fadeIn 0.4s ease forwards; }

.overview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.student-exercise {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  background: var(--bg-secondary);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 8px;
}

.student-exercise-name { font-size: 0.82rem; font-weight: 600; color: var(--text-primary); }
.student-exercise-detail { font-size: 0.74rem; color: var(--gold); }
.student-exercise-notes { font-size: 0.72rem; color: var(--text-secondary); font-style: italic; }

/* =========================================
   V2 — SELETOR DE IDIOMA (PT/EN)
   ========================================= */
.lang-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  display: flex;
  gap: 8px;
  z-index: 1200;
}

.lang-toggle.inline {
  position: static;
  padding: 4px 16px 12px;
}

.lang-flag {
  background: transparent;
  border: 2px solid transparent;
  border-radius: 8px;
  padding: 4px 6px;
  cursor: pointer;
  opacity: 0.45;
  transition: all var(--transition);
  display: flex;
  align-items: center;
}

.lang-flag svg { display: block; border-radius: 3px; }

.lang-flag:hover { opacity: 0.85; }

.lang-flag.active {
  opacity: 1;
  border-color: rgba(200, 164, 94, 0.55);
  background: rgba(200, 164, 94, 0.08);
}

/* =========================================
   V2 — RESPONSIVIDADE MOBILE
   ========================================= */
@media (max-width: 768px) {
  .portal-container { flex-direction: column; }

  .sidebar {
    width: 100%;
    padding: 12px 16px;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-direction: row;
    align-items: center;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 900;
  }

  .sidebar-logo { margin-bottom: 0; flex-shrink: 0; }

  .sidebar-nav {
    flex-direction: row;
    gap: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1;
  }

  .nav-item {
    padding: 8px 12px;
    white-space: nowrap;
    font-size: 0.85rem;
  }

  .logout-btn { margin-top: 0; margin-left: auto; }

  .lang-toggle.inline { padding: 0 4px; align-items: center; }

  .main-content { padding: 20px 16px; }

  .header { margin-bottom: 24px; }
  .page-title { font-size: 1.5rem; }

  .student-header { padding: 20px; flex-direction: column; align-items: flex-start; gap: 16px; }
  .student-header-info h2 { font-size: 1.5rem; }

  .tabs-nav { gap: 16px; overflow-x: auto; }
  .tab-btn { font-size: 0.95rem; white-space: nowrap; }

  .weekly-grid { grid-template-columns: 1fr; }
  .day-content { min-height: unset; }

  .student-card-actions { width: 100%; justify-content: flex-end; }

  .modal-content { width: 94%; padding: 20px 16px; }

  .modal-lg {
    width: 100%;
    height: 100%;
    max-height: 100vh;
    border-radius: 0;
  }

  .exercise-row-controls { grid-template-columns: 1fr 1fr; }
  .exercise-row-controls .obs-field { grid-column: 1 / -1; }

  .goals-grid { grid-template-columns: 1fr 1fr; }

  .meal-item { grid-template-columns: 1fr auto; }
  .meal-item-macros { grid-column: 1 / -1; }

  .custom-food-grid { grid-template-columns: 1fr 1fr; }

  .overview-grid { grid-template-columns: 1fr; }

  .day-editor-footer { flex-direction: column-reverse; align-items: stretch; }
  .day-editor-footer .btn-primary { width: 100%; }
  .duplicate-row { justify-content: space-between; }

  .picker-list { max-height: 55vh; }
}

