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

:root {
  /* Color Palette - Deep Obsidian Black & Neon Green Vitam */
  --bg-primary: hsl(220, 20%, 4%);
  --bg-secondary: hsl(220, 15%, 8%);
  --bg-glass: rgba(10, 15, 26, 0.72);
  --border-glass: rgba(255, 255, 255, 0.05);
  --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.55);
  
  --text-primary: hsl(210, 40%, 98%);
  --text-secondary: hsl(215, 20%, 75%);
  --text-muted: hsl(215, 12%, 50%);
  
  /* Semantic Accent Colors */
  --color-brand-green: hsl(120, 100%, 45%);      /* Signature Neon Green Vitam */
  --color-brand-green-dark: hsl(120, 100%, 35%); /* Darker Neon Green for contrast */
  --color-accent-blue: hsl(195, 100%, 50%);      /* Electric Sky Blue */
  --color-accent-green: hsl(120, 100%, 40%);
  --color-accent-orange: hsl(24, 95%, 50%);
  --color-accent-purple: hsl(260, 85%, 62%);     /* Electric Violet */
  --color-danger: hsl(0, 84%, 60%);
  --color-success: hsl(142, 70%, 45%);
  --color-warning: hsl(38, 92%, 50%);
  
  /* Font Family */
  --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  /* Layout Constants */
  --sidebar-width: 280px;
  --transition-speed: 0.25s;
  --border-radius: 16px;
}

/* Base Styles & Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(at 0% 0%, hsla(220,25%,4%,1) 0, transparent 50%), 
    radial-gradient(at 50% 0%, hsla(120,100%,45%,0.06) 0, transparent 50%),
    radial-gradient(at 100% 80%, hsla(120,100%,45%,0.04) 0, transparent 50%);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  overflow: hidden;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: hsl(220, 15%, 15%);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: hsl(120, 100%, 30%);
}

/* Layout Wrapper */
.app-container {
  display: flex;
  width: 100%;
  height: 100vh;
  position: relative;
}

/* Sidebar Navigation */
.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0; /* Impede que o flexbox esprema a sidebar */
  background-color: var(--bg-glass);
  backdrop-filter: blur(16px);
  border-right: 1px solid var(--border-glass);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  height: 100%;
  z-index: 10;
  transition: transform var(--transition-speed) ease; /* Anima apenas o transform do mobile, evitando saltos de largura */
}

/* ECG Heartbeat Pulse Animation */
@keyframes ecg-heartbeat {
  0%, 100% {
    filter: drop-shadow(0 0 3px rgba(0, 230, 0, 0.6));
    opacity: 0.8;
  }
  50% {
    filter: drop-shadow(0 0 7.5px rgba(0, 230, 0, 0.95)) brightness(1.15);
    opacity: 1;
  }
}

.sidebar svg path {
  animation: ecg-heartbeat 3.2s infinite ease-in-out;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--color-accent-blue), var(--color-accent-purple));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px rgba(0, 191, 255, 0.35);
}

.logo-icon svg {
  fill: #fff;
  width: 22px;
  height: 22px;
}

.logo-text {
  font-size: 1.25rem;
  font-weight: 700;
  background: linear-gradient(to right, #fff, var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 0.5px;
}

.nav-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  overflow-y: auto;
  flex-grow: 1;
  padding-right: 0.25rem;
}

.nav-item {
  width: 100%;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid transparent;
  border-left: 3px solid transparent;
  cursor: pointer;
}

.nav-link svg {
  width: 20px;
  height: 20px;
  stroke: var(--text-secondary);
  fill: none;
  stroke-width: 2;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link:hover {
  background-color: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
}

.nav-link:hover svg {
  stroke: var(--text-primary);
}

.nav-link.active {
  background: linear-gradient(135deg, rgba(0, 230, 0, 0.12), rgba(0, 230, 0, 0.03));
  color: var(--color-brand-green);
  border-color: rgba(0, 230, 0, 0.15);
  border-left: 3.5px solid var(--color-brand-green);
  box-shadow: inset 0 0 10px rgba(0, 230, 0, 0.05);
}

.nav-link.active svg {
  stroke: var(--color-brand-green);
}

/* Submenu do Sidebar */
.submenu {
  list-style: none;
  padding-left: 0.5rem;
  margin-top: 0.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
  max-height: 0;
  opacity: 0;
}

.submenu.open {
  max-height: 500px;
  opacity: 1;
}

.submenu .nav-link {
  padding: 0.65rem 1rem 0.65rem 1.75rem;
  font-size: 0.88rem;
  border-left: 2px solid transparent;
}

.submenu .nav-link.active {
  border-left-color: var(--color-brand-green);
  background: linear-gradient(135deg, rgba(0, 230, 0, 0.08), rgba(0, 230, 0, 0.01));
}

.submenu-trigger {
  position: relative;
}

.submenu-trigger .chevron-icon {
  margin-left: auto;
  width: 14px;
  height: 14px;
  stroke: var(--text-secondary);
  fill: none;
  stroke-width: 2.5;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.submenu-trigger:hover .chevron-icon {
  stroke: var(--text-primary);
}

.submenu-trigger.open .chevron-icon {
  transform: rotate(90deg);
}


.sidebar-footer {
  margin-top: auto;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-glass);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-avatar {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #1e293b, #334155);
  border: 2px solid var(--border-glass);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--color-brand-green);
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.user-role {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Main Content Area */
.main-content {
  flex-grow: 1;
  min-width: 0; /* Previne que conteúdos largos expandam e desalinhem o flexbox */
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden; /* Contém transbordamentos e impede scroll horizontal global */
  scrollbar-gutter: stable; /* Evita que o surgimento do scroll vertical cause pulos/saltos de largura no conteúdo */
  padding: 2rem 2.5rem;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Top Header Bar */
.top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-glass);
}

.page-title-container h1 {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.page-title-container p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-control-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Botão premium de cadastrar novo aluno */
.btn-cadastrar-aluno {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.1rem;
  border-radius: 10px;
  border: 1px solid rgba(0, 230, 0, 0.35);
  background: linear-gradient(135deg, rgba(0, 230, 0, 0.12), rgba(0, 230, 0, 0.04));
  color: var(--color-brand-green);
  font-family: var(--font-main);
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.2px;
  white-space: nowrap;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 0 0 rgba(0, 230, 0, 0);
}

.btn-cadastrar-aluno svg {
  flex-shrink: 0;
  transition: transform 0.22s ease;
}

.btn-cadastrar-aluno:hover {
  background: linear-gradient(135deg, rgba(0, 230, 0, 0.22), rgba(0, 230, 0, 0.08));
  border-color: rgba(0, 230, 0, 0.6);
  box-shadow: 0 0 14px rgba(0, 230, 0, 0.2), 0 4px 12px rgba(0,0,0,0.3);
  transform: translateY(-1px);
}

.btn-cadastrar-aluno:hover svg {
  transform: rotate(8deg) scale(1.1);
}

.btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  padding: 0.6rem 1.2rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-accent-blue), var(--color-accent-purple));
  border: none;
  color: #ffffff;
  box-shadow: 0 4px 15px hsla(195, 100%, 50%, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, hsl(195, 100%, 55%), hsl(260, 90%, 68%));
  box-shadow: 0 6px 20px hsla(195, 100%, 50%, 0.4);
}

.btn:active, .btn-cadastrar-aluno:active, .btn-primary:active {
  transform: scale(0.97) translateY(0);
  box-shadow: none;
}

.select-dropdown {
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  padding: 0.6rem 2.5rem 0.6rem 1rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
}

/* Glassmorphic Tabs (Cards) */
.tab-content {
  display: none;
  animation: fadeIn var(--transition-speed) ease;
  width: 100%;
}

.tab-content.active {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.card {
  background-color: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--border-radius);
  padding: 1.75rem;
  box-shadow: var(--card-shadow);
  backdrop-filter: blur(16px);
  position: relative;
  overflow: visible; /* Alterado para visible para evitar corte de comboboxes e calendários customizados expandidos */
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s ease, box-shadow 0.3s ease;
  min-width: 0; /* Evita que o card force a largura de grids/flex pais (ex: grid-vo2-superior) a estourar no mobile */
}

.card:hover {
  border-color: hsla(120, 100%, 45%, 0.15);
  box-shadow: 0 12px 40px hsla(120, 100%, 45%, 0.03), var(--card-shadow);
  transform: translateY(-2px);
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(to right, transparent, hsla(120, 100%, 45%, 0.18), transparent);
}

.card-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-primary);
}

.card-title svg {
  width: 22px;
  height: 22px;
  stroke: var(--color-brand-green);
  fill: none;
  stroke-width: 2;
}

/* Grid Layouts */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.grid-2-1 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
  min-width: 0;
}
.grid-2-1 > * {
  min-width: 0;
}

.grid-1-2 {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 1.5rem;
  min-width: 0;
}
.grid-1-2 > * {
  min-width: 0;
}

/* Profile Summary Box */
.profile-box {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.profile-avatar-large {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--color-brand-green), hsla(120, 100%, 25%, 0.8));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  box-shadow: 0 8px 20px rgba(0, 230, 0, 0.35);
}

.profile-details-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem 3rem;
  flex-grow: 1;
}

.profile-detail-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0; /* filho de .profile-details-grid (display: grid) — sem isso
    não encolhe abaixo do conteúdo intrínseco (ex: os inputs de Período com
    largura fixa) e empurra a coluna seguinte pra fora da viewport no mobile */
}

.profile-detail-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.profile-detail-value {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* Metric Display Widgets */
.metric-widget {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  position: relative;
  transition: all 0.3s ease;
}

.metric-widget:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(0, 191, 255, 0.15);
}

.metric-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.metric-value-container {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.metric-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.metric-unit {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.metric-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  align-self: flex-start;
}

/* Ícone antes do texto em cada badge — reforça o significado sem depender
   só da cor (daltonismo afeta ~8% dos homens). */
.metric-badge::before {
  font-size: 0.7rem;
  line-height: 1;
}

.badge-blue {
  background-color: rgba(0, 191, 255, 0.1);
  color: var(--color-accent-blue);
  border: 1px solid rgba(0, 191, 255, 0.2);
}
.badge-blue::before {
  content: "•";
}

.badge-green {
  background-color: rgba(16, 185, 129, 0.1);
  color: var(--color-accent-green);
  border: 1px solid rgba(16, 185, 129, 0.2);
}
.badge-green::before {
  content: "✓";
}

.badge-orange {
  background-color: rgba(245, 158, 11, 0.1);
  color: var(--color-accent-orange);
  border: 1px solid rgba(245, 158, 11, 0.2);
}
.badge-orange::before {
  content: "!";
}

.badge-purple {
  background-color: rgba(139, 92, 246, 0.1);
  color: var(--color-accent-purple);
  border: 1px solid rgba(139, 92, 246, 0.2);
}

.badge-red {
  background-color: rgba(239, 68, 68, 0.1);
  color: var(--color-danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}
.badge-red::before {
  content: "✕";
}

.metric-footer {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Custom Table Layouts */
.custom-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.95rem;
}

.custom-table th {
  padding: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border-glass);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 1px;
}

.custom-table td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border-glass);
  color: var(--text-primary);
  font-weight: 400;
}

.custom-table tr:hover td {
  background-color: rgba(255, 255, 255, 0.015);
}

.custom-table input {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  width: 90px;
  font-size: 0.9rem;
  text-align: center;
}

.custom-table input:focus {
  outline: none;
  border-color: var(--color-accent-blue);
  background: rgba(255, 255, 255, 0.05);
}

/* Beautiful Interactive Human Body Visualizer */
.body-visualizer-container {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.01);
  border-radius: 12px;
  border: 1px solid var(--border-glass);
}

.body-svg {
  height: 380px;
  width: auto;
}

.body-part-hotspot {
  fill: rgba(0, 191, 255, 0.08);
  stroke: rgba(0, 191, 255, 0.2);
  stroke-width: 1.5;
  cursor: pointer;
  transition: all 0.2s ease;
}

.body-part-hotspot:hover, .body-part-hotspot.active {
  fill: rgba(0, 191, 255, 0.3);
  stroke: var(--color-accent-blue);
  filter: drop-shadow(0 0 5px rgba(0, 191, 255, 0.5));
}

.body-visualizer-tooltip {
  background: var(--bg-secondary);
  border: 1px solid var(--color-accent-blue);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  position: absolute;
  pointer-events: none;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  display: none;
  z-index: 100;
  font-size: 0.78rem;
  width: auto;
  min-width: 160px;
  white-space: nowrap;
}

.tooltip-title {
  font-weight: 700;
  color: var(--color-accent-blue);
  text-transform: uppercase;
  font-size: 0.75rem;
  margin-bottom: 0.25rem;
}

.tooltip-value {
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
}

/* Form Styles */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.form-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.form-input,
.form-textarea,
.form-select {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: var(--font-main);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  width: 100%;
}

.password-input-wrapper {
  position: relative;
  display: flex;
}

.password-input-wrapper .form-input {
  padding-right: 2.75rem;
}

.password-toggle-btn {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: color 0.2s ease, background 0.2s ease;
}

.password-toggle-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--color-brand-green);
  background-color: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 10px hsla(120, 100%, 45%, 0.22);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.5;
}

.form-select {
  padding: 0.75rem 2.5rem 0.75rem 1rem;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1.2rem;
  height: 46px;
  box-sizing: border-box;
}

/* Estilo premium e consistente para o campo de data e seus seletores internos */
input[type="date"].form-input {
  color: var(--text-primary);
  font-family: var(--font-main);
  height: 46px;
  line-height: 1.5;
  box-sizing: border-box;
}

input[type="date"].form-input::-webkit-datetime-edit {
  color: var(--text-primary);
  padding: 0;
}

input[type="date"].form-input::-webkit-datetime-edit-fields-wrapper {
  background: transparent;
}

input[type="date"].form-input::-webkit-datetime-edit-text,
input[type="date"].form-input::-webkit-datetime-edit-month-field,
input[type="date"].form-input::-webkit-datetime-edit-day-field,
input[type="date"].form-input::-webkit-datetime-edit-year-field {
  color: var(--text-primary);
}

input[type="date"].form-input::-webkit-datetime-edit-month-field:focus,
input[type="date"].form-input::-webkit-datetime-edit-day-field:focus,
input[type="date"].form-input::-webkit-datetime-edit-year-field:focus {
  background-color: var(--color-accent-blue);
  color: #000;
  border-radius: 3px;
}

input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1) brightness(0.8) sepia(100%) saturate(1000%) hue-rotate(80deg); /* verde neon combinando com --color-accent-blue */
  cursor: pointer;
  opacity: 0.6;
  transition: all 0.2s ease;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
  transform: scale(1.1);
}

/* Hover consistente para campos interativos de formulários */
.form-input:hover,
.form-textarea:hover {
  border-color: rgba(0, 230, 0, 0.35);
  background-color: rgba(255, 255, 255, 0.04);
}

.form-select:hover,
.select-dropdown:hover {
  border-color: rgba(0, 230, 0, 0.35);
  background-color: rgba(255, 255, 255, 0.04);
}

/* Custom Glassmorphic Calendar Popover */
.calendar-popover {
  position: absolute;
  background-color: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: 14px;
  padding: 1.25rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.65), 0 0 15px rgba(0, 230, 0, 0.1);
  z-index: 3000;
  display: none;
  flex-direction: column;
  gap: 1rem;
  font-family: var(--font-main);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}

.calendar-popover.active {
  display: flex;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
}

.cal-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
  text-transform: capitalize;
}

.cal-nav-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  color: var(--color-accent-blue);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  transition: all 0.2s ease;
}

.cal-nav-btn:hover {
  background-color: rgba(0, 230, 0, 0.15);
  border-color: rgba(0, 230, 0, 0.3);
  transform: scale(1.05);
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.calendar-day:hover {
  background-color: rgba(0, 230, 0, 0.1);
  border-color: rgba(0, 230, 0, 0.25);
  color: var(--color-accent-blue);
}

.calendar-day.active {
  background: linear-gradient(135deg, var(--color-accent-blue), var(--color-accent-green));
  color: #000 !important;
  font-weight: 700;
  border-color: transparent;
  box-shadow: 0 0 10px rgba(0, 230, 0, 0.45);
}

.calendar-day.today {
  border-color: var(--color-accent-blue);
  color: var(--color-accent-blue);
  font-weight: 600;
}

.calendar-day.other-month {
  color: var(--text-muted);
  opacity: 0.45;
}

.calendar-day.other-month:hover {
  background-color: rgba(255, 255, 255, 0.02);
  border-color: transparent;
  color: var(--text-muted);
}

/* Customização dos options do Select para garantir legibilidade universal em qualquer SO */
.form-select option {
  background-color: #ffffff !important;
  color: #0f172a !important;
  padding: 0.5rem;
}

.checkbox-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  padding: 0.5rem 0;
}

.checkbox-custom {
  width: 20px;
  height: 20px;
  border: 1px solid var(--border-glass);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.checkbox-custom svg {
  width: 14px;
  height: 14px;
  stroke: #fff;
  stroke-width: 3;
  fill: none;
  opacity: 0;
  transition: all 0.1s ease;
}

input[type="checkbox"] {
  display: none;
}

input[type="checkbox"]:checked + .checkbox-custom {
  background: linear-gradient(135deg, var(--color-accent-blue), var(--color-accent-purple));
  border-color: transparent;
  box-shadow: 0 0 8px rgba(0, 191, 255, 0.4);
}

input[type="checkbox"]:checked + .checkbox-custom svg {
  opacity: 1;
}

/* Radio Group styling */
.radio-group-horizontal {
  display: flex;
  gap: 1.5rem;
}

.radio-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.radio-custom {
  width: 20px;
  height: 20px;
  border: 1px solid var(--border-glass);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.radio-circle {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  opacity: 0;
  transition: all 0.1s ease;
}

input[type="radio"] {
  display: none;
}

input[type="radio"]:checked + .radio-custom {
  border-color: var(--color-brand-green);
  box-shadow: 0 0 8px hsla(120, 100%, 45%, 0.35);
}

input[type="radio"]:checked + .radio-custom .radio-circle {
  background: var(--color-brand-green);
  opacity: 1;
}

/* Anamnese Step controls */
.form-step {
  display: none;
}
.form-step.active {
  display: block;
}

.form-steps-nav {
  display: flex;
  justify-content: space-between;
  margin-bottom: 2rem;
  position: relative;
}

.form-steps-nav::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--border-glass);
  z-index: 1;
  transform: translateY(-50%);
}

.form-step-dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--bg-secondary);
  border: 2px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--text-muted);
  position: relative;
  z-index: 2;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-step-dot.active {
  background-color: var(--bg-primary);
  border-color: var(--color-brand-green);
  color: var(--color-brand-green);
  box-shadow: 0 0 12px hsla(120, 100%, 45%, 0.4);
}

.form-step-dot.completed {
  background-color: var(--color-brand-green);
  border-color: var(--color-brand-green);
  color: #fff;
}

/* Quote Card for Prognosis */
.quote-card {
  background: linear-gradient(135deg, rgba(0, 191, 255, 0.08), rgba(138, 43, 226, 0.08));
  border-left: 4px solid var(--color-accent-blue);
  padding: 1.5rem;
  border-radius: 0 var(--border-radius) var(--border-radius) 0;
  font-style: italic;
  color: var(--text-primary);
  margin-top: 1rem;
}

.quote-author {
  font-style: normal;
  font-weight: 700;
  color: var(--text-secondary);
  margin-top: 0.75rem;
  text-align: right;
  font-size: 0.85rem;
}

/* Charts Wrapper */
.chart-wrapper {
  position: relative;
  height: 300px;
  width: 100%;
  margin-top: 1rem;
}

/* Spinner de carregamento para botões em ação assíncrona (ver App.setButtonLoading) */
@keyframes btn-spinner-rotate {
  to {
    transform: rotate(360deg);
  }
}

.btn-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: btn-spinner-rotate 0.6s linear infinite;
  flex-shrink: 0;
}

button.is-loading {
  cursor: wait;
  opacity: 0.85;
}

/* Overlay de carregamento global — cobre o main-content durante troca de
   aba (dado ainda não buscado) ou qualquer operação com o servidor. Ver
   App.mostrarCarregando()/App.esconderCarregando(). */
.global-loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--bg-glass);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.global-loading-overlay.active {
  display: flex;
  opacity: 1;
}

.global-loading-spinner {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.08);
  border-top-color: var(--color-brand-green);
  animation: btn-spinner-rotate 0.7s linear infinite;
  box-shadow: 0 0 18px rgba(0, 230, 0, 0.25);
}

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

/* Elementos de Navegação e Responsividade Mobile Sênior */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background-color: rgba(10, 15, 26, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-glass);
  padding: 0 1.25rem;
  align-items: center;
  justify-content: space-between;
  z-index: 99;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.menu-toggle-btn {
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.menu-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-accent-blue);
}

.drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.drawer-overlay.active {
  opacity: 1;
  visibility: visible;
}

.sidebar-close-btn {
  display: none;
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.sidebar-close-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-danger);
}

/* Container de Tabela com rolagem horizontal com máscara vítrea lateral */
.table-scroll-container {
  position: relative;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Responsive Grid Adjustments */
@media (max-width: 1200px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid-2-1, .grid-1-2 {
    grid-template-columns: 1fr !important;
  }
}

/* Utilitários globais de alinhamento */
.text-center {
  text-align: center !important;
}
.text-left {
  text-align: left !important;
}
.text-right {
  text-align: right !important;
}

/* Correção crítica de altura para inputs e botões dentro de tabelas */
.custom-table input,
.custom-table select,
.custom-table .form-input,
.custom-table .btn {
  min-height: 32px !important;
  height: 32px !important;
  padding: 0.25rem 0.5rem !important;
  font-size: 0.85rem !important;
  border-radius: 6px !important;
  line-height: 1 !important;
  text-align: center;
}

/* Scroll horizontal preventivo para tabelas de dados no mobile */
.table-container {
  overflow-x: auto;
  width: 100%;
  -webkit-overflow-scrolling: touch;
}
.table-container:not(.borg-container) .custom-table {
  min-width: 580px; /* Previne esmagamento dos dados, forçando scroll horizontal polido */
}

@media (max-width: 960px) {
  body {
    overflow-y: auto;
  }
  
  .mobile-header {
    display: flex;
  }
  
  .app-container {
    padding-top: 60px; /* Compensa o header fixo */
    height: auto;
    min-height: calc(100vh - 60px);
  }
  
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    transform: translateX(-100%);
    height: 100vh;
    z-index: 999;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.8);
    transition: transform var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
    border-right: 1px solid rgba(0, 230, 0, 0.15);
  }
  
  .sidebar.drawer-open {
    transform: translateX(0);
  }
  
  .sidebar-close-btn {
    display: flex;
  }
  
  .main-content {
    padding: 1.25rem 1rem;
    height: auto;
    gap: 1.25rem;
    width: 100%;
    overflow-x: hidden;
  }
  
  .top-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    padding-bottom: 1.25rem;
  }
  
  .header-controls {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    width: 100%;
  }
  
  .header-control-group {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
    width: 100%;
  }
  
  .header-control-group label {
    margin-bottom: 0rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
  }
  
  .select-dropdown, .header-controls .btn {
    width: 100% !important;
    flex-grow: unset;
    text-align: left;
    justify-content: center;
  }
  
  .header-controls .btn {
    text-align: center;
  }
  
  .card {
    padding: 1.25rem;
    border-radius: 12px;
  }
  
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr !important;
    gap: 1.25rem;
  }
  
  /* Grid 2x2 elegante para os indicadores do Dashboard no mobile */
  .grid-4.metrics-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.75rem;
  }
  
  .metrics-grid .metric-widget {
    padding: 0.85rem;
    gap: 0.35rem;
  }
  
  .metrics-grid .metric-value {
    font-size: 1.4rem;
  }
  
  .metrics-grid .metric-label {
    font-size: 0.75rem;
  }
  
  .metrics-grid .metric-badge {
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
  }
  
  .metrics-grid .metric-footer {
    font-size: 0.65rem;
  }
  
  /* Inputs e toque geral (fora das tabelas) */
  .form-input, .form-select, .form-textarea, .btn {
    min-height: 44px; /* Otimizado para dedão no celular */
  }
  
  .profile-box {
    flex-direction: column;
    text-align: left;
    gap: 1.25rem;
  }
  
  .profile-avatar-large {
    width: 70px;
    height: 70px;
    font-size: 1.75rem;
    align-self: center;
  }
  
  .profile-details-grid {
    grid-template-columns: repeat(2, 1fr); /* 2 Colunas no mobile para maior compactação e beleza */
    gap: 1rem;
    width: 100%;
  }
  
  .profile-detail-item {
    border-bottom: 1px solid var(--border-glass);
    padding-bottom: 0.5rem;
    align-items: flex-start;
  }
  
  .profile-detail-item:last-child {
    border-bottom: none;
  }

  /* Inputs de Período (PTR) têm largura fixa de 110px no desktop — no
     mobile isso não cabe na coluna de 2fr, então encolhem pra caber. */
  #trainPeriodoInicio, #trainPeriodoFim {
    width: 100% !important;
    min-width: 0 !important;
  }
}

@media (max-width: 600px) {
  /* Títulos responsivos de seção no mobile */
  .page-title-container h1 {
    font-size: 1.4rem !important;
  }
  
  .page-title-container p {
    font-size: 0.8rem !important;
  }
  
  /* Silhueta SVG mais enxuta no celular */
  .body-svg {
    height: 300px;
  }
  
  /* Botões do painel VO2 estimador no mobile */
  .card div[style*="display: flex; gap: 0.75rem"] {
    flex-direction: column !important;
    gap: 0.75rem !important;
  }
  
  .card div[style*="display: flex; gap: 0.75rem"] button,
  .card div[style*="display: flex; gap: 0.75rem"] .btn {
    width: 100% !important;
  }
  
  /* Escala de Borg mais compacta no celular */
  .borg-container .borg-table td {
    padding: 0.3rem 0.4rem !important;
    font-size: 0.7rem !important;
  }
  
  /* Botões de ação em abas ganham largura total e empilhamento perfeito */
  .card > div[style*="justify-content: flex-end"],
  .card > div[style*="justify-content: space-between"] {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100% !important;
    gap: 0.75rem !important;
  }
  
  .card > div[style*="justify-content"] .btn:not([style*="display: none"]):not([style*="display:none"]),
  .card > div[style*="justify-content"] div:not([style*="display: none"]):not([style*="display:none"]) {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.75rem !important;
  }
  
  .card > div[style*="justify-content"] .btn:not([style*="display: none"]):not([style*="display:none"]) {
    justify-content: center !important;
  }

  /* Botões "Iniciar Treino" (PTR), Iniciar/Finalizar Teste e Adicionar
     Estágio (VO2), Adicionar Exercício/Calcular e Salvar (1RM) moram em
     containers com justify-content em linha e são alcançados pela regra
     genérica acima (.card > div[style*="justify-content"] .btn), que além
     de esticar a largura pra 100% (comportamento desejado, igual aos
     demais botões de ação do app no mobile) também vira flex-direction:
     column dentro do próprio botão, empilhando ícone e texto — corrigimos
     só isso aqui, mantendo os 100% de largura. */
  #btnStartTraining, #btnStartVo2Test, #btnFinishVo2Test, #btnAddVo2Estagio,
  #btnAdd1rmExercise, #btnSave1rm {
    flex-direction: row !important;
  }

  /* Alinhamento do timer do VO2 no mobile quando ativo */
  #vo2TestTimerContainer:not([style*="display: none"]):not([style*="display:none"]) {
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
    width: auto !important;
  }
  
  /* Centralização do status do teste VO2 no mobile */
  #vo2TestStatus {
    text-align: center !important;
    justify-content: center !important;
    align-items: center !important;
  }
}

/* ==========================================================================
   ESTILOS PREMIUM E SIMETRIA DA ABA TESTE VO2 MÁX (VITAM)
   ========================================================================== */

.grid-vo2-superior {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 1.5rem;
  align-items: stretch; /* Estica a Escala de Borg (coluna da direita) para alinhar perfeitamente com a flex-column da esquerda */
}

.grid-vo2-inferior {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr; /* Proporção ideal: mais espaço para Variáveis e tamanho exato para Resultado */
  gap: 1.5rem;
  align-items: stretch; /* Estica ambas para terem exatamente a mesma altura */
}

/* Alinhamento de altura e comportamento dos containers de tabelas */
.vo2-stages-container {
  max-height: none;
  overflow-y: visible;
  flex-grow: 1;
}

.borg-container {
  max-height: none;
  overflow-y: visible !important;
  overflow-x: auto !important;
  flex-grow: 1; /* Permite esticar verticalmente para preencher o card */
}

/* Grid customizado e de largura contida para os inputs de recuperação (sempre 3 colunas compactas lado a lado) */
.recovery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 0.5rem !important;
  max-width: 250px !important;
  width: 100% !important;
}

/* Estilo para os inputs de recuperação de frequência cardíaca para que NÃO cortem no mobile ou telas pequenas */
.compact-recovery-input {
  padding: 0.25rem 0.35rem !important;
  font-size: 0.8rem !important;
  text-align: center !important;
  width: 100% !important;
  min-width: 0 !important;
  border-radius: 6px !important;
  height: 32px !important;
  min-height: 32px !important; /* Neutraliza min-height: 44px de mobile */
}

/* Oculta as setas de spinner padrão de inputs numéricos de recuperação */
.compact-recovery-input::-webkit-outer-spin-button,
.compact-recovery-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.compact-recovery-input[type=number] {
  -moz-appearance: textfield;
}

@media (min-width: 850px) {
  .grid-vo2-superior .flex-column {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    height: 100%;
  }

  .grid-vo2-superior .card {
    display: flex;
    flex-direction: column;
  }

  .grid-vo2-superior .borg-card {
    height: 100%; /* Estica o card de Borg para ter 100% da altura da coluna da esquerda */
    display: flex;
    flex-direction: column;
  }

  .grid-vo2-inferior .card {
    display: flex;
    flex-direction: column;
    height: 100%;
  }

  .vo2-stages-container {
    overflow-y: auto;
    padding-right: 0.25rem;
  }

  .borg-container {
    overflow-y: visible !important;
    overflow-x: auto !important;
    padding-right: 0.25rem;
  }
}

/* Estilização Avançada da Escala de Borg (Efeito Cápsula) */
.borg-table {
  border-collapse: separate !important;
  border-spacing: 0 4px !important; /* Espaçamento entre as cápsulas */
  width: 100%;
  min-width: 260px; /* Garante largura mínima legível para gerar rolagem horizontal caso falte espaço lateral */
}

.borg-table th {
  padding: 0.5rem !important;
  font-size: 0.75rem !important;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 1px;
  border-bottom: none !important;
  text-align: center !important;
}

.borg-row {
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.borg-row:hover {
  transform: translateX(6px); /* Efeito interativo sutil de empurrão lateral */
  filter: brightness(1.3);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.45);
}

.borg-row td {
  padding: 0.45rem 0.5rem !important;
  font-weight: 700;
  text-align: center;
  border-bottom: none !important; /* Remove as bordas normais das tabelas */
}

.borg-num {
  font-size: 0.95rem;
  font-weight: 800 !important;
  border-radius: 8px 0 0 8px; /* Cantos arredondados esquerdos da cápsula */
  width: 50px;
}

.borg-text {
  font-size: 0.75rem !important;
  letter-spacing: 0.5px;
  border-radius: 0 8px 8px 0; /* Cantos arredondados direitos da cápsula */
}

/* Cores de esforço customizadas e gradativas da Escala de Borg */
.borg-z0 { background: rgba(255, 255, 255, 0.06); border-left: 4px solid #ffffff; }
.borg-z1 { background: rgba(16, 185, 129, 0.08); border-left: 4px solid #10b981; }
.borg-z2 { background: rgba(6, 182, 212, 0.05); border-left: 4px solid #06b6d4; }
.borg-z3 { background: rgba(59, 130, 246, 0.08); border-left: 4px solid #3b82f6; }
.borg-z4 { background: rgba(245, 158, 11, 0.05); border-left: 4px solid #f59e0b; }
.borg-z5 { background: rgba(249, 115, 22, 0.08); border-left: 4px solid #f97316; }
.borg-z6 { background: rgba(239, 68, 68, 0.06); border-left: 4px solid #ef4444; }
.borg-z7 { background: rgba(185, 28, 28, 0.09); border-left: 4px solid #b91c1c; }
.borg-z8 { background: rgba(127, 29, 29, 0.25); border-left: 4px solid #7f1d1d; }
.borg-z8 td { color: #f87171 !important; }

/* Card Premium Glow Verde Neon Vitam */
.card-premium-glow {
  background: linear-gradient(135deg, rgba(0, 230, 0, 0.12), rgba(0, 230, 0, 0.02)) !important;
  border: 1px solid rgba(0, 230, 0, 0.25) !important;
  box-shadow: 0 8px 32px 0 rgba(0, 230, 0, 0.08), var(--card-shadow) !important;
  position: relative;
  overflow: hidden;
}

.card-premium-glow::before {
  content: '' !important;
  background: linear-gradient(to right, transparent, rgba(0, 230, 0, 0.4), transparent) !important;
}

/* Ajustes de Responsividade Específicos para o VO2 */
@media (max-width: 850px) {
  .grid-vo2-superior,
  .grid-vo2-inferior {
    grid-template-columns: 1fr !important;
    gap: 1.25rem;
  }
  
  .vo2-stages-container {
    height: auto !important; /* Altura auto no celular */
    max-height: none !important;
  }

  .borg-container {
    height: auto !important;
    max-height: none !important;
    overflow-y: visible !important;
    overflow-x: auto !important;
  }

  .borg-table {
    border-spacing: 0 3px !important;
  }

  .borg-row td {
    padding: 0.35rem 0.4rem !important;
  }

  .borg-num {
    font-size: 0.85rem;
    width: 40px;
  }

  .borg-text {
    font-size: 0.7rem !important;
  }
}

/* Grid customizado para os Dados Pessoais da Anamnese */
.grid-anamnese-pessoais {
  display: grid;
  grid-template-columns: 2fr 1.2fr 0.6fr 1.2fr;
  gap: 1.5rem;
}

@media (max-width: 960px) {
  .grid-anamnese-pessoais {
    grid-template-columns: 1fr 1fr !important;
  }
  .grid-anamnese-pessoais .form-group:first-child {
    grid-column: span 2;
  }
}

@media (max-width: 600px) {
  .grid-anamnese-pessoais {
    grid-template-columns: 1fr !important;
  }
  .grid-anamnese-pessoais .form-group:first-child {
    grid-column: span 1;
  }
}

/* ==========================================================================
   ESTILOS PREMIUM MÓDULO DE TREINAMENTO PERIODIZADO (PTR)
   ========================================================================== */

/* Carrossel de Semanas (Week Selector) */
.week-selector-scroll {
  overflow-x: auto;
  width: 100%;
  padding: 0.25rem 0.25rem 0.75rem 0.25rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 191, 255, 0.25) rgba(255, 255, 255, 0.02);
  -webkit-overflow-scrolling: touch;
}

/* Custom scrollbar para o carrossel de semanas seguindo o padrão premium glass */
.week-selector-scroll::-webkit-scrollbar {
  height: 6px;
}

.week-selector-scroll::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 10px;
}

.week-selector-scroll::-webkit-scrollbar-thumb {
  background: rgba(0, 191, 255, 0.25);
  border-radius: 10px;
  border: 1px solid rgba(0, 191, 255, 0.1);
  transition: all 0.3s ease;
}

.week-selector-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--color-accent-blue);
  box-shadow: 0 0 8px rgba(0, 191, 255, 0.5);
}

.week-selector-container {
  display: flex;
  gap: 0.75rem;
  width: max-content;
}

.week-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 2px solid var(--border-glass);
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.week-btn:hover {
  border-color: rgba(0, 230, 0, 0.4);
  color: var(--text-primary);
  transform: translateY(-2px);
}

.week-btn.active {
  background: var(--bg-primary);
  border-color: var(--color-brand-green) !important;
  color: var(--color-brand-green) !important;
  box-shadow: 0 0 12px rgba(0, 230, 0, 0.4), inset 0 0 8px rgba(0, 230, 0, 0.1);
  transform: translateY(-2px) scale(1.05);
}

/* Seletor de Treinos A, B, C, D (Workout Tabs) */
.workout-tabs-container {
  width: 100%;
}

.workout-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  padding: 0.5rem;
  border-radius: var(--border-radius);
  box-shadow: var(--card-shadow);
  backdrop-filter: blur(12px);
}

.workout-tab-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 0.75rem 1rem;
  cursor: pointer;
  text-align: center;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  min-width: 0; /* Prevents button from expanding beyond grid column width */
}

.workout-tab-letter {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-secondary);
}

.workout-tab-focus {
  display: block; /* Restores ellipsis by making the span block-level inside its parent wrapper */
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  width: 100%; /* Ensures text truncates inside the constrained button width */
}

.workout-tab-btn:hover {
  background: rgba(255, 255, 255, 0.02);
}

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

.workout-tab-btn.active {
  background: linear-gradient(135deg, rgba(0, 230, 0, 0.12), rgba(0, 230, 0, 0.03));
  border-color: rgba(0, 230, 0, 0.2);
  box-shadow: inset 0 0 10px rgba(0, 230, 0, 0.05);
}

.workout-tab-btn.active .workout-tab-letter {
  color: var(--color-brand-green);
  text-shadow: 0 0 8px rgba(0, 230, 0, 0.3);
}

.workout-tab-btn.active .workout-tab-focus {
  color: var(--text-secondary);
}

/* Grid de Exercícios */
.exercise-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  width: 100%;
}

/* Card de Exercício */
.exercise-card {
  background-color: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  box-shadow: var(--card-shadow);
  backdrop-filter: blur(12px);
  position: relative;
  overflow: visible;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.exercise-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(to right, transparent, var(--border-glass), transparent);
  transition: all 0.3s ease;
}

.exercise-card:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 230, 0, 0.15);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55), 0 0 15px rgba(0, 230, 0, 0.04);
}

.exercise-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}

.exercise-title-container {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.exercise-order {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.exercise-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.exercise-onerm-badge {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* Corpo do Card de Exercício */
.exercise-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--border-glass);
  padding: 0.75rem;
  border-radius: 12px;
}

.exercise-metric-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.exercise-metric-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.exercise-metric-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.exercise-weight-highlight {
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
}

.exercise-weight-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--color-accent-blue);
  text-shadow: 0 0 10px rgba(0, 230, 0, 0.2);
}

.exercise-weight-unit {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* Rodapé / Logger Executivo */
.exercise-logger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: auto;
  border-top: 1px solid var(--border-glass);
  padding-top: 0.75rem;
}

.exercise-log-input-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.exercise-log-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.exercise-log-input {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  width: 76px;
  font-size: 0.9rem;
  font-weight: 700;
  text-align: center;
  height: 34px;
}

.exercise-log-input:focus {
  outline: none;
  border-color: var(--color-accent-blue);
  background: rgba(255, 255, 255, 0.05);
}

/* Checkbox de Conclusão */
.exercise-check-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid var(--border-glass);
  background: rgba(255, 255, 255, 0.02);
  color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.exercise-check-btn svg {
  width: 18px;
  height: 18px;
  stroke: transparent;
  stroke-width: 3.5;
  fill: none;
  transition: all 0.2s ease;
}

.exercise-check-btn:hover {
  border-color: var(--color-accent-blue);
  background: rgba(0, 230, 0, 0.03);
}

.exercise-check-btn.completed {
  background: linear-gradient(135deg, var(--color-accent-blue), var(--color-accent-purple));
  border-color: transparent;
  box-shadow: 0 0 10px rgba(0, 230, 0, 0.5);
  color: #fff;
}

.exercise-check-btn.completed svg {
  stroke: #fff;
}

/* Estado de Card Completado */
.exercise-card.completed {
  opacity: 0.65;
  border-color: rgba(0, 230, 0, 0.3) !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4), inset 0 0 15px rgba(0, 230, 0, 0.02) !important;
}

.exercise-card.completed::before {
  background: linear-gradient(to right, transparent, var(--color-accent-blue), transparent) !important;
}

.exercise-card-done-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(0, 230, 0, 0.1);
  color: var(--color-accent-blue);
  border: 1px solid rgba(0, 230, 0, 0.2);
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: none;
}

.exercise-card.completed .exercise-card-done-badge {
  display: block;
}

.exercise-card.completed .exercise-onerm-badge {
  display: none; /* Oculta para dar espaço para o done badge */
}

/* Pulsing neon badge for methods */
.method-badge {
  background: rgba(249, 115, 22, 0.1);
  color: var(--color-accent-orange);
  border: 1px solid rgba(249, 115, 22, 0.2);
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  animation: pulse-orange 2s infinite;
}

@keyframes pulse-orange {
  0% {
    box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.4);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(249, 115, 22, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(249, 115, 22, 0);
  }
}

/* ==========================================================================
   METODO DROP SET (PTR)
   ========================================================================== */

/* Painel de configuração no Modal */
.dropset-config-panel {
  grid-column: span 2;
  background: rgba(249, 115, 22, 0.04);
  border: 1px dashed rgba(249, 115, 22, 0.3);
  border-radius: 12px;
  padding: 1.25rem;
  margin-top: 0.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  animation: fadeInDropSet 0.3s ease;
}

@keyframes fadeInDropSet {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

.dropset-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.dropset-title {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--color-accent-orange);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Stepper de seleção de quantidade de drops */
.stepper-control {
  display: flex;
  align-items: center;
  background: rgba(10, 15, 26, 0.5);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  padding: 2px;
}

.stepper-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  width: 28px;
  height: 28px;
  font-size: 1.2rem;
  font-weight: 800;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  outline: none;
  font-family: var(--font-main);
}

.stepper-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-accent-orange);
}

.stepper-value {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-primary);
  min-width: 65px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Linhas de input no painel do Drop Set */
.drop-inputs-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.drop-input-row {
  display: grid;
  grid-template-columns: 80px 1.1fr 1.1fr 90px;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem;
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid rgba(255, 255, 255, 0.02);
  border-radius: 8px;
}

.drop-number-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.drop-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(10, 15, 26, 0.6);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  padding: 0.35rem 0.5rem;
}

.drop-input-wrap:focus-within {
  border-color: var(--color-accent-orange);
}

.drop-input-field {
  background: transparent;
  border: none;
  color: var(--text-primary);
  width: 100%;
  font-size: 0.9rem;
  font-weight: 700;
  outline: none;
  text-align: right;
  font-family: var(--font-main);
}

.drop-input-unit {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* Select de Intensidade % dentro da linha do Drop Set/Pirâmide, seguindo o padrão .form-select */
.drop-pct-select {
  height: 38px;
  padding: 0.4rem 2.2rem 0.4rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 700;
  background-size: 1rem;
  background-position: right 0.65rem center;
  border-radius: 8px;
}

.drop-connector {
  display: flex;
  justify-content: center;
  color: rgba(249, 115, 22, 0.4);
  margin: -0.15rem 0;
  font-size: 0.9rem;
  font-weight: bold;
}

.btn-auto-calc {
  background: transparent;
  border: 1px solid rgba(249, 115, 22, 0.3);
  color: var(--color-accent-orange);
  padding: 0.35rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  text-align: center;
}

.btn-auto-calc:hover {
  background: rgba(249, 115, 22, 0.1);
}

/* Escada Visual no Card */
.dropset-cascade-view {
  grid-column: span 2;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.25rem 0;
}

.dropset-step {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(90deg, rgba(20, 27, 45, 0.6), rgba(249, 115, 22, 0.03));
  border: 1px solid rgba(255, 255, 255, 0.03);
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  transition: all 0.2s ease;
  position: relative;
}

.dropset-step::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--color-accent-orange);
  border-radius: 3px 0 0 3px;
}

.dropset-step.step-1 { opacity: 1.0; border-color: rgba(249, 115, 22, 0.2); }
.dropset-step.step-2 { opacity: 0.92; transform: scale(0.98); margin-left: 4px; }
.dropset-step.step-3 { opacity: 0.84; transform: scale(0.96); margin-left: 8px; }
.dropset-step.step-4 { opacity: 0.76; transform: scale(0.94); margin-left: 12px; }
.dropset-step.step-5 { opacity: 0.68; transform: scale(0.92); margin-left: 16px; }
.dropset-step.step-6 { opacity: 0.60; transform: scale(0.90); margin-left: 20px; }

.dropset-step .step-name {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dropset-step .step-details {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.dropset-step .step-weight {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--color-accent-blue);
  text-shadow: 0 0 8px rgba(0, 191, 255, 0.25);
}

.dropset-step .step-weight-unit {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.dropset-step .step-multiplier {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 700;
}

.dropset-step .step-reps {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.dropset-step .step-pct {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Compactação para muitos drops (5 ou 6) */
.compact-cascade .dropset-step {
  padding: 0.35rem 0.6rem;
  gap: 0.25rem;
}
.compact-cascade .dropset-step .step-weight {
  font-size: 0.95rem;
}
.compact-cascade .dropset-step .step-reps {
  font-size: 0.9rem;
}

/* Resumo de Cargas Drop Set Colapsado */
.dropset-summary-row {
  grid-column: span 2;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.4rem;
  background: rgba(249, 115, 22, 0.02);
  border: 1px solid rgba(249, 115, 22, 0.08);
  padding: 0.6rem;
  border-radius: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE 10+ */
  -webkit-overflow-scrolling: touch;
}

.dropset-summary-row::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

.summary-chip {
  background: rgba(10, 15, 26, 0.6);
  border: 1px solid var(--border-glass);
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-accent-blue);
  flex-shrink: 0;
}

.summary-arrow {
  color: var(--color-accent-orange);
  font-weight: 800;
  font-size: 0.8rem;
  flex-shrink: 0;
}

/* Estilos compactos quando houver mais de 3 drops */
.dropset-summary-row.many-drops {
  gap: 0.25rem;
  padding: 0.45rem 0.6rem;
}

.dropset-summary-row.many-drops .summary-chip {
  padding: 0.2rem 0.4rem;
  font-size: 0.72rem;
  border-radius: 5px;
}

.dropset-summary-row.many-drops .summary-arrow {
  font-size: 0.7rem;
}

/* Botão de Alternância de Drops (Expandir/Recolher) */
.btn-toggle-drops {
  grid-column: span 2;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  padding: 0.45rem;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  font-family: var(--font-main);
  transition: all 0.2s ease;
  outline: none;
}

.btn-toggle-drops:hover {
  background: rgba(249, 115, 22, 0.05);
  border-color: rgba(249, 115, 22, 0.25);
  color: var(--color-accent-orange);
}

.btn-toggle-drops svg {
  transition: transform 0.25s ease;
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.5;
}

.btn-toggle-drops.expanded svg {
  transform: rotate(180deg);
}

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

.dropset-cascade-view {
  animation: slideDownDrops 0.25s ease-out;
}

/* Responsividade específica do Treino */
@media (max-width: 960px) {
  .workout-tabs {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.5rem;
  }
  
  .workout-tab-btn {
    padding: 0.6rem 0.75rem;
  }
  
  .workout-tab-letter {
    font-size: 1rem;
  }
  
  .workout-tab-focus {
    font-size: 0.7rem;
  }
  
  .grid-4-train-meta {
    grid-template-columns: 1fr 1fr !important;
    gap: 0.75rem !important;
  }
}

@media (max-width: 600px) {
  .workout-tabs {
    grid-template-columns: 1fr !important;
    gap: 0.5rem;
  }
  
  .workout-tab-btn {
    flex-direction: row;
    justify-content: space-between;
    padding: 0.75rem 1rem;
  }
  
  .workout-tab-focus {
    text-align: right;
    max-width: 70%;
  }
  
  .grid-4-train-meta {
    grid-template-columns: 1fr !important;
    gap: 0.5rem !important;
  }
}

/* Botão de remoção de exercício dentro do card */
.btn-remove-exercise,
.btn-edit-exercise {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.4;
  transition: all 0.2s ease;
  border-radius: 6px;
}

.btn-remove-exercise {
  color: var(--color-danger);
}

.btn-edit-exercise {
  color: var(--color-accent-blue);
}

.btn-remove-exercise:hover {
  opacity: 1 !important;
  background: rgba(239, 68, 68, 0.1);
  transform: scale(1.1);
}

.btn-edit-exercise:hover {
  opacity: 1 !important;
  background: rgba(0, 191, 255, 0.1);
  transform: scale(1.1);
}

/* Ocultar/desativar lixeira e editar se o exercício já estiver marcado como concluído */
.exercise-card.completed .btn-remove-exercise,
.exercise-card.completed .btn-edit-exercise {
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden;
}

/* ==========================================================================
   POPUP / MODAL GLASSMORPHIC E AUTOCOMPLETE (PTR)
   ========================================================================== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(10, 15, 26, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 1.25rem;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  background: rgba(20, 27, 45, 0.95);
  border: 1px solid rgba(0, 230, 0, 0.2);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 25px rgba(0, 230, 0, 0.05);
  max-width: 500px;
  width: 100%;
  min-width: 0; /* Impede que o conteúdo interno (grids/inputs) force o card a estourar a largura da tela no mobile */
  max-height: calc(100vh - 2.5rem);
  padding: 1.75rem;
  backdrop-filter: blur(16px);
  transform: scale(0.95);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.modal-overlay.active .modal-card {
  transform: scale(1);
}

/* Responsividade de grids em telas de celular: os grids fixos (.grid-2/.grid-3/.grid-4)
   usados em toda a aplicação (modais de edição, dashboards, formulários) não possuíam
   nenhuma sobreposição para telas pequenas, forçando colunas estreitas e ilegíveis. */
@media (max-width: 600px) {
  .modal-card {
    padding: 1.25rem;
  }

  .grid-2,
  .grid-3,
  .grid-4,
  .grid-2-1 {
    grid-template-columns: 1fr !important;
  }

  /* Área de toque mínima recomendada (44x44px) para controles compactos de desktop */
  .stepper-btn,
  .modal-close-btn {
    min-width: 44px;
    min-height: 44px;
  }
}

/* Faixa intermediária (tablets/celulares grandes): grids de 3-4 colunas viram 2 colunas
   para evitar campos comprimidos demais antes de colapsar totalmente em 600px. */
@media (max-width: 768px) and (min-width: 601px) {
  .grid-3,
  .grid-4 {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 0.75rem;
}

.modal-header h3 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-danger);
  transform: rotate(90deg);
}

.modal-body {
  width: 100%;
  overflow-y: auto;
  padding-right: 0.25rem;
}

/* O modal de prompt (usado por App.showPrompt — ex: "Adicionar Exercício"
   no Teste de 1RM) só tem um campo curto, mas herdava o overflow-y:auto
   genérico de .modal-body. Como definir overflow-y != visible faz o
   navegador também cortar overflow-x, o dropdown do select customizado
   (position: absolute, abre PARA BAIXO do campo) ficava cortado assim que
   passava da borda inferior do modal-body — parecia "não abrir", mas só
   estava invisível. Este modal nunca precisa de scroll interno, então é
   seguro liberar o overflow aqui. */
#promptModal .modal-body {
  overflow: visible;
}

/* Mesmo bug do #promptModal acima: o modal "Adicionar Exercício ao Modelo"
   também só tem um campo curto (Nome do Exercício) com o dropdown de busca
   posicionado abaixo dele — herdar o overflow-y:auto genérico cortava esse
   dropdown na borda inferior do modal-body, fazendo-o parecer minúsculo e
   forçando uma barra de rolagem interna em vez de abrir fluido. */
#templateExerciseSelectorModal .modal-body {
  overflow: visible;
}

.modal-body form {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  width: 100%;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  border-top: 1px solid var(--border-glass);
  padding-top: 1rem;
}

/* Dropdown de Autocomplete com visualização sênior */
.exercise-filter-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: rgba(15, 22, 38, 0.98);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 2100;
  margin-top: 4px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  display: none; /* Controlado via JS */
}

/* O modal "Adicionar Exercício ao Modelo" tem só este campo, então a lista
   pode ficar bem maior sem disputar espaço com outros campos do form —
   ao contrário do modal "Gerenciar Exercício" do PTR, que reusa a mesma
   classe mas tem vários outros campos abaixo. */
#templateExerciseSelectorModal .exercise-filter-dropdown {
  width: 300px;
  max-width: 100%;
  height: 300px;
  max-height: 300px;
}

/* Custom scrollbar to match premium scrollbar layout */
.exercise-filter-dropdown::-webkit-scrollbar {
  width: 6px;
}
.exercise-filter-dropdown::-webkit-scrollbar-track {
  background: rgba(15, 22, 38, 0.5);
}
.exercise-filter-dropdown::-webkit-scrollbar-thumb {
  background: hsl(220, 15%, 15%);
  border-radius: 3px;
}
.exercise-filter-dropdown::-webkit-scrollbar-thumb:hover {
  background: var(--color-accent-green);
}

.exercise-filter-item {
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.exercise-filter-item:hover {
  background: rgba(0, 191, 255, 0.12);
  color: var(--text-primary);
  padding-left: 1.25rem;
}

.exercise-filter-group {
  padding: 0.4rem 1rem 0.2rem 1rem;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--color-accent-blue);
  background: rgba(255, 255, 255, 0.02);
  border-top: 1px solid rgba(255, 255, 255, 0.02);
}

.exercise-filter-group:first-child {
  border-top: none;
}

/* Switch Toggle Customizado Sênior */
.form-group-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  padding: 0.75rem 1rem;
  border-radius: 12px;
  margin-top: 0.25rem;
}

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.1);
  transition: .3s;
  border: 1px solid var(--border-glass);
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: var(--text-secondary);
  transition: .3s;
}

input:checked + .slider {
  background-color: rgba(0, 230, 0, 0.15);
  border-color: rgba(0, 230, 0, 0.4);
}

input:checked + .slider:before {
  transform: translateX(20px);
  background-color: var(--color-accent-green);
}

.slider.round {
  border-radius: 24px;
}

.slider.round:before {
  border-radius: 50%;
}

/* ==========================================================================
   VIDEO PLAYER GLASSMORPHIC & PLAY BUTTONS (PTR)
   ========================================================================== */

.video-aspect-container {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* Aspect Ratio 16:9 Cinemático */
  height: 0;
  overflow: hidden;
  border-radius: 8px;
  background: #000;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.8);
}

.video-aspect-container iframe,
.video-aspect-container video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
  border: none;
}

.btn-video-exercise {
  background: transparent;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.15rem;
  color: var(--color-accent-green);
  border-radius: 50%;
  transition: all 0.2s ease;
  animation: play-pulse 2s infinite;
  vertical-align: middle;
  margin-left: 0.5rem;
}

.btn-video-exercise:hover {
  transform: scale(1.2);
  color: #fff;
  background: rgba(0, 230, 0, 0.1);
}

.btn-video-exercise svg {
  display: block;
}

@keyframes play-pulse {
  0% {
    filter: drop-shadow(0 0 2px rgba(0, 230, 0, 0.3));
  }
  50% {
    filter: drop-shadow(0 0 6px rgba(0, 230, 0, 0.7));
  }
  100% {
    filter: drop-shadow(0 0 2px rgba(0, 230, 0, 0.3));
  }
}

/* ==========================================================================
   SISTEMA DE TOASTS & MODAIS CUSTOMIZADOS DE UX (PTR)
   ========================================================================== */

/* Toast Container */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 9999;
  pointer-events: none;
}

/* Toast Card Base */
.premium-toast {
  pointer-events: auto;
  background: rgba(15, 22, 38, 0.95);
  border: 1px solid rgba(0, 230, 0, 0.25);
  border-radius: 14px;
  padding: 0.9rem 1.25rem;
  color: var(--text-primary);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 230, 0, 0.05);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 320px;
  max-width: 420px;
  transform: translateX(120%);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}

.premium-toast.active {
  transform: translateX(0);
  opacity: 1;
}

/* Toast Success Variant */
.premium-toast.toast-success {
  border-color: rgba(0, 230, 0, 0.3);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 230, 0, 0.05);
}

/* Toast Danger Variant */
.premium-toast.toast-danger {
  border-color: rgba(239, 68, 68, 0.35);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(239, 68, 68, 0.06);
}

/* Toast Warning Variant */
.premium-toast.toast-warning {
  border-color: rgba(245, 158, 11, 0.35);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(245, 158, 11, 0.06);
}

/* Toast Icon */
.premium-toast-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-weight: bold;
}

.premium-toast.toast-success .premium-toast-icon {
  background: rgba(0, 230, 0, 0.1);
  color: var(--color-accent-blue); /* Neon Green in this theme */
}

.premium-toast.toast-danger .premium-toast-icon {
  background: rgba(239, 68, 68, 0.15);
  color: var(--color-danger);
}

.premium-toast.toast-warning .premium-toast-icon {
  background: rgba(245, 158, 11, 0.15);
  color: var(--color-warning);
}

/* Toast Content */
.premium-toast-body {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.premium-toast-title {
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.premium-toast.toast-success .premium-toast-title {
  color: var(--color-accent-blue);
}

.premium-toast.toast-danger .premium-toast-title {
  color: var(--color-danger);
}

.premium-toast.toast-warning .premium-toast-title {
  color: var(--color-warning);
}

.premium-toast-message {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
  font-weight: 500;
}

/* Close Button */
.premium-toast-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.6;
  transition: all 0.2s ease;
  border-radius: 50%;
}

.premium-toast-close:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

/* Custom Delete Modal styling specifically */
.modal-delete-card {
  border-color: rgba(239, 68, 68, 0.25) !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 25px rgba(239, 68, 68, 0.04) !important;
}

/* Responsive adjustment for Mobile screens */
@media (max-width: 480px) {
  .toast-container {
    top: 16px;
    right: 16px;
    left: 16px;
    width: auto;
  }
  
  .premium-toast {
    min-width: 0;
    width: 100%;
    transform: translateY(-50px) scale(0.9);
  }
  
  .premium-toast.active {
    transform: translateY(0) scale(1);
  }
}

/* Hover states for PTR Workout action buttons */
#btnAddWorkout:hover {
  background: linear-gradient(135deg, rgba(0, 230, 0, 0.22), rgba(0, 230, 0, 0.08)) !important;
  border-color: rgba(0, 230, 0, 0.45) !important;
  box-shadow: 0 4px 15px rgba(0, 230, 0, 0.15);
}

#btnEditWorkout:hover,
#btnRemoveWorkout:hover {
  opacity: 1;
}

/* Custom styles for actions inside workout tab cards */
.workout-tab-btn {
  position: relative !important;
  padding-top: 1.15rem !important;
  padding-bottom: 0.65rem !important;
}

.workout-tab-actions {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  gap: 4px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.workout-tab-btn:hover .workout-tab-actions,
.workout-tab-btn.active .workout-tab-actions {
  opacity: 1;
  pointer-events: auto;
}

.btn-tab-action {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: 6px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.2s ease;
  padding: 0;
}

.btn-tab-action svg {
  display: block;
  stroke-width: 2.5;
}

.btn-tab-action:hover {
  color: var(--text-primary);
  transform: scale(1.15);
}

.btn-edit-tab:hover {
  background: rgba(0, 191, 255, 0.15) !important;
  border-color: rgba(0, 191, 255, 0.3) !important;
  color: var(--color-accent-blue) !important;
  box-shadow: 0 0 8px rgba(0, 191, 255, 0.2);
}

.btn-remove-tab:hover {
  background: rgba(239, 68, 68, 0.15) !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
  color: var(--color-danger) !important;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.2);
}

/* ==========================================================================
   ELEMENTOS DE SELEÇÃO GLASSMORPHIC CUSTOMIZADOS (CUSTOM SELECTS)
   ========================================================================== */
.custom-select-wrapper {
  position: relative;
  width: 100%;
}

.custom-select-trigger {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  box-sizing: border-box;
  background-image: none !important; /* Garante remoção de setas nativas duplicadas em background */
  padding-right: 1.25rem !important; /* Corrige a margem excessiva da seta à direita, posicionando-a no fim */
}

.custom-select-arrow {
  width: 1.2rem;
  height: 1.2rem;
  stroke: var(--text-muted);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), stroke 0.2s ease;
}

.custom-select-trigger:hover .custom-select-arrow {
  stroke: var(--text-primary);
}

/* Rotaciona a seta quando o menu está aberto */
.custom-select-dropdown.active ~ .custom-select-trigger .custom-select-arrow,
.custom-select-wrapper:focus-within .custom-select-arrow {
  transform: rotate(180deg);
  stroke: var(--color-accent-blue);
}

.custom-select-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  margin-top: 6px;
  background-color: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: 12px; /* Bordas arredondadas e não-quadradas altamente profissionais */
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.65), 0 0 15px rgba(0, 230, 0, 0.05);
  z-index: 1010;
  display: none;
  flex-direction: column;
  padding: 0.5rem;
  max-height: 250px;
  overflow-y: auto;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 191, 255, 0.6) rgba(255, 255, 255, 0.05);
}

/* Barra de rolagem customizada para os dropdowns de custom-select */
.custom-select-dropdown::-webkit-scrollbar {
  width: 6px;
  display: block;
}
.custom-select-dropdown::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
}
.custom-select-dropdown::-webkit-scrollbar-thumb {
  background: rgba(0, 191, 255, 0.6);
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.custom-select-dropdown::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 191, 255, 0.9);
}

.custom-select-dropdown.active {
  display: flex;
  opacity: 1;
  transform: translateY(0);
}

.custom-select-item {
  padding: 0.65rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: 8px; /* Cantos curvos nos itens individuais */
  cursor: pointer;
  transition: all 0.15s ease;
}

.custom-select-item:hover {
  background-color: rgba(0, 230, 0, 0.1);
  color: var(--text-primary);
  padding-left: 1.25rem; /* Delicado microdeslizamento lateral ao passar o mouse */
}

.custom-select-item.selected {
  background: linear-gradient(135deg, var(--color-accent-blue), var(--color-accent-green));
  color: #000 !important;
  font-weight: 600;
}

/* Customizações específicas para seletores no cabeçalho */
.custom-select-wrapper.dropdown-type {
  width: auto;
  min-width: 250px;
}

.custom-select-trigger.select-dropdown {
  padding: 0.6rem 1.2rem;
  border-radius: 10px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 600;
  min-height: 40px;
}

.custom-select-trigger.select-dropdown .custom-select-arrow {
  margin-left: 1.5rem;
  width: 1rem;
  height: 1rem;
}

/* ==========================================================================
   ESTILIZAÇÃO DE CAMPOS NUMÉRICOS (INPUT TYPE NUMBER)
   ========================================================================== */
/* Oculta as setas de spinner nativas do navegador para todos os campos number,
   garantindo que sigam exatamente o mesmo estilo limpo dos campos de texto padrão. */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
}

/* ==========================================================================
   TELA DE LOGIN PREMIUM (GLASSMORPHIC)
   ========================================================================== */
.login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(10, 15, 26, 0.85);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.login-card {
  width: 100%;
  max-width: 400px;
  padding: 2.5rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4), 0 0 30px rgba(0, 191, 255, 0.05);
  animation: loginFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.login-logo {
  text-align: center;
  margin-bottom: 2rem;
}

/* ==========================================================================
   MODO APENAS LEITURA (PERMISSÃO DE ALUNO)
   Bloqueia TODOS os campos de TODOS os menus via CSS + JS (applyPermissions)
   ========================================================================== */
.readonly-mode input,
.readonly-mode select,
.readonly-mode textarea {
  pointer-events: none !important;
  opacity: 0.6 !important;
  background-color: rgba(255, 255, 255, 0.01) !important;
  border-color: rgba(255, 255, 255, 0.06) !important;
  user-select: none !important;
  cursor: default !important;
}

/* Wrapper do CustomSelect desabilitado (perfil Aluno):
   bloqueia visualmente o dropdown customizado */
.custom-select-disabled,
.custom-select-disabled .custom-select-trigger,
.custom-select-disabled .custom-select-dropdown {
  pointer-events: none !important;
  cursor: not-allowed !important;
}
.custom-select-disabled .custom-select-trigger {
  opacity: 0.6 !important;
  background-color: rgba(255, 255, 255, 0.01) !important;
  border-color: rgba(255, 255, 255, 0.06) !important;
  user-select: none !important;
}
/* Garante que o dropdown nunca abra */
.custom-select-disabled .custom-select-dropdown.active {
  display: none !important;
}

/* Exceção: apenas os <input> da aba VO2 Máx. permanecem interativos para o Aluno
   (campos de FC e PSE dos estágios + variáveis máximas).
   SELECT e TEXTAREA do VO2 continuam bloqueados pela regra acima. */
.readonly-mode #tab-vo2 input {
  pointer-events: auto !important;
  opacity: 1 !important;
  background-color: rgba(255, 255, 255, 0.04) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: var(--text-primary) !important;
  user-select: auto !important;
  cursor: text !important;
}

.readonly-mode #tab-vo2 input:focus {
  outline: none !important;
  border-color: var(--color-accent-blue) !important;
  background: rgba(255, 255, 255, 0.06) !important;
  box-shadow: 0 0 10px rgba(0, 230, 0, 0.2) !important;
}

/* Exceção: os inputs de carga e repetições do Teste de 1 RM permanecem interativos para o Aluno */
.readonly-mode #tab-rm1 input[data-1rm-input="carga"],
.readonly-mode #tab-rm1 input[data-1rm-input="repeticoes"] {
  pointer-events: auto !important;
  opacity: 1 !important;
  background-color: rgba(255, 255, 255, 0.04) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: var(--text-primary) !important;
  user-select: auto !important;
  cursor: text !important;
}

.readonly-mode #tab-rm1 input[data-1rm-input="carga"]:focus,
.readonly-mode #tab-rm1 input[data-1rm-input="repeticoes"]:focus {
  outline: none !important;
  border-color: var(--color-accent-blue) !important;
  background: rgba(255, 255, 255, 0.06) !important;
  box-shadow: 0 0 10px rgba(0, 191, 255, 0.2) !important;
}

/* Mantém o botão de salvar do 1RM na direita */
.readonly-mode .rm1-actions-container {
  justify-content: flex-end !important;
}

/* Custom CSS rule to hide editing structures gracefully */
.readonly-hidden {
  display: none !important;
}

/* Classes dinâmicas para Inputs de VO2 e Botões de Deleção */
.vo2-input-dynamic {
  width: 100px;
  text-align: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border-radius: 8px;
  padding: 0.4rem 0.5rem;
  font-family: var(--font-main);
  font-size: 0.9rem;
  transition: border-color 0.2s, background 0.2s;
}

.vo2-input-dynamic:focus {
  outline: none;
  border-color: var(--color-accent-blue);
  background: rgba(255, 255, 255, 0.08);
}

.btn-delete-vo2-estagio {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--color-danger);
  padding: 4px;
  border-radius: 4px;
  transition: transform 0.2s, background 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-delete-vo2-estagio:hover {
  transform: scale(1.15);
}

/* Premium Glassmorphic Tooltip System */
[data-tooltip] {
  position: relative;
}

@keyframes tooltip-fade-in {
  from {
    opacity: 0;
    transform: translateX(-50%) scale(0.85);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) scale(1);
  }
}

@keyframes tooltip-arrow-fade-in {
  from {
    opacity: 0;
    transform: translateX(-50%) scale(0.85);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) scale(1);
  }
}

@keyframes tooltip-left-fade-in {
  from {
    opacity: 0;
    transform: translateY(50%) scale(0.85);
  }
  to {
    opacity: 1;
    transform: translateY(50%) scale(1);
  }
}

@keyframes tooltip-left-arrow-fade-in {
  from {
    opacity: 0;
    transform: translateY(50%) scale(0.85);
  }
  to {
    opacity: 1;
    transform: translateY(50%) scale(1);
  }
}

@keyframes tooltip-right-fade-in {
  from {
    opacity: 0;
    transform: scale(0.85);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Estilos de tooltips glassmorphic base */
[data-tooltip]::after,
[data-tooltip-right-aligned]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 135%;
  background: rgba(10, 15, 26, 0.96);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  display: none;
  z-index: 9999;
  font-family: var(--font-main);
  backdrop-filter: blur(8px);
  letter-spacing: 0.3px;
}

[data-tooltip]::after {
  left: 50%;
  transform: translateX(-50%) scale(0.85);
}

[data-tooltip]::before {
  content: '';
  position: absolute;
  bottom: 115%;
  left: 50%;
  transform: translateX(-50%) scale(0.85);
  border-width: 5px 5px 0;
  border-style: solid;
  border-color: rgba(10, 15, 26, 0.96) transparent transparent;
  pointer-events: none;
  display: none;
  z-index: 9999;
}

[data-tooltip]:hover::after {
  display: block;
  animation: tooltip-fade-in 0.18s cubic-bezier(0.175, 0.885, 0.32, 1.2) forwards;
}

[data-tooltip]:hover::before {
  display: block;
  animation: tooltip-arrow-fade-in 0.18s cubic-bezier(0.175, 0.885, 0.32, 1.2) forwards;
}

/* Posicionamento à esquerda para botões no canto direito da tela */
[data-tooltip-left]::after {
  bottom: 50%;
  right: 125%;
  left: auto;
  transform: translateY(50%) scale(0.85);
  display: none;
}

[data-tooltip-left]::before {
  bottom: 50%;
  right: 110%;
  left: auto;
  transform: translateY(50%) scale(0.85);
  border-width: 5px 0 5px 5px;
  border-color: transparent transparent transparent rgba(10, 15, 26, 0.96);
  display: none;
}

[data-tooltip-left]:hover::after {
  display: block;
  animation: tooltip-left-fade-in 0.18s cubic-bezier(0.175, 0.885, 0.32, 1.2) forwards;
}

[data-tooltip-left]:hover::before {
  display: block;
  animation: tooltip-left-arrow-fade-in 0.18s cubic-bezier(0.175, 0.885, 0.32, 1.2) forwards;
}

/* Tooltip alinhada acima mas encostada na DIREITA (expande para a esquerda) */
[data-tooltip-right-aligned] {
  position: relative;
}

[data-tooltip-right-aligned]::after {
  right: 0;
  left: auto;
  transform: scale(0.85);
}

[data-tooltip-right-aligned]::before {
  content: '';
  position: absolute;
  bottom: 115%;
  right: 8px; /* Arrow centered with the button on the right */
  left: auto;
  border-width: 5px 5px 0;
  border-style: solid;
  border-color: rgba(10, 15, 26, 0.96) transparent transparent;
  pointer-events: none;
  display: none;
  z-index: 9999;
}

[data-tooltip-right-aligned]:hover::after {
  display: block;
  animation: tooltip-right-fade-in 0.18s cubic-bezier(0.175, 0.885, 0.32, 1.2) forwards;
}

[data-tooltip-right-aligned]:hover::before {
  display: block;
  animation: tooltip-right-fade-in 0.18s cubic-bezier(0.175, 0.885, 0.32, 1.2) forwards;
}

/* Seletores automáticos para o último elemento / última coluna de tabelas dentro de contêineres roláveis */
.table-container td:last-child [data-tooltip]::after,
.table-container th:last-child [data-tooltip]::after {
  left: auto;
  right: 0;
  transform: scale(0.85);
}

.table-container td:last-child [data-tooltip]::before,
.table-container th:last-child [data-tooltip]::before {
  left: auto;
  right: 8px; /* Arrow centered with the button on the right */
  transform: scale(0.85);
}

.table-container td:last-child [data-tooltip]:hover::after,
.table-container th:last-child [data-tooltip]:hover::after {
  display: block;
  animation: tooltip-right-fade-in 0.18s cubic-bezier(0.175, 0.885, 0.32, 1.2) forwards;
}

.table-container td:last-child [data-tooltip]:hover::before,
.table-container th:last-child [data-tooltip]:hover::before {
  display: block;
  animation: tooltip-right-fade-in 0.18s cubic-bezier(0.175, 0.885, 0.32, 1.2) forwards;
}

/* Responsividade Avançada para o Módulo de Treinamento Periodizado (PTR) */
.grid-4-train-meta {
  margin-top: 1.25rem;
  border-top: 1px solid var(--border-glass);
  padding-top: 1rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

@media (max-width: 960px) {
  .grid-4-train-meta {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
}

@media (max-width: 800px) {
  .workout-tab-focus {
    display: none !important;
  }
}

@media (max-width: 600px) {
  /* Abas de Divisão do Treino (Treinos A, B, C, D) em grade 2x2 no mobile */
  .workout-tabs {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.5rem !important;
    padding: 0.4rem !important;
  }
  
  .workout-tab-btn {
    padding: 0.5rem 0.75rem !important;
    border-radius: 10px !important;
  }
  
  .workout-tab-letter {
    font-size: 0.95rem !important;
  }
  
  .workout-tab-focus {
    font-size: 0.65rem !important;
  }

  /* Grid de metadados do treino empilhado no mobile */
  .grid-4-train-meta {
    grid-template-columns: 1fr !important;
    gap: 0.5rem !important;
    font-size: 0.8rem !important;
  }
  
  /* Ajuste no cabeçalho e botões de ação para clique confortável no mobile */
  #workoutHeaderContainer {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.5rem !important;
  }
  
  #workoutHeaderContainer h4 {
    text-align: center;
    margin-bottom: 0.25rem !important;
  }
  
  #btnAddWorkout {
    width: 100% !important;
    justify-content: center !important;
    height: 38px !important;
  }
  
  #trainActionBar {
    width: 100% !important;
  }
  
  #btnAddTrainExercise {
    width: 100% !important;
    justify-content: center !important;
    height: 44px !important; /* Tamanho confortável para clique */
  }

  /* Grid de cards de exercícios em largura total fluida */
  .exercise-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }
}

/* Tooltip especial com quebra de linha automática para o Foco do Treino para evitar estouro horizontal */
.workout-tab-focus-wrapper[data-tooltip]::after {
  white-space: normal !important;
  width: 200px !important;
  line-height: 1.4 !important;
  text-align: center !important;
}

/* Custom Select Wrapper for weekTeorRep to prevent it from stretching to 100% width */
#weekTeorRep-wrapper {
  width: auto !important;
  min-width: 185px !important;
  max-width: 210px !important;
  display: inline-block !important;
}

/* Custom Select Trigger for weekTeorRep to make it compact in height and padding */
#weekTeorRep-wrapper .custom-select-trigger {
  height: 32px !important;
  min-height: 32px !important;
  padding: 0.25rem 1rem 0.25rem 0.75rem !important;
  font-size: 0.85rem !important;
  border-radius: 8px !important;
}

/* Custom Select Text handling inside the trigger to avoid vertical wrapping/clipping */
#weekTeorRep-wrapper .custom-select-text {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  display: block !important;
  flex: 1 !important;
  text-align: left !important;
  margin-right: 0.5rem !important;
}

/* Custom Select Arrow adjustment for weekTeorRep */
#weekTeorRep-wrapper .custom-select-arrow {
  width: 0.9rem !important;
  height: 0.9rem !important;
  flex-shrink: 0 !important;
}

/* Custom Select Dropdown menu for weekTeorRep to prevent clipping of option texts and show all options without scrollbar */
#weekTeorRep-wrapper .custom-select-dropdown {
  width: max-content !important;
  min-width: 100% !important;
  max-height: none !important;
  overflow-y: visible !important;
  white-space: nowrap !important;
}

/* Custom scrollbar styles for modalExSeries-wrapper and modalExPct-wrapper dropdown lists (Firefox & Webkit) */
#modalExSeries-wrapper .custom-select-dropdown,
#modalExPct-wrapper .custom-select-dropdown {
  scrollbar-width: thin !important;
  scrollbar-color: hsl(220, 15%, 15%) rgba(15, 22, 38, 0.5) !important;
}
#modalExSeries-wrapper .custom-select-dropdown::-webkit-scrollbar,
#modalExPct-wrapper .custom-select-dropdown::-webkit-scrollbar {
  width: 6px !important;
  display: block !important;
}
#modalExSeries-wrapper .custom-select-dropdown::-webkit-scrollbar-track,
#modalExPct-wrapper .custom-select-dropdown::-webkit-scrollbar-track {
  background: rgba(15, 22, 38, 0.5) !important;
}
#modalExSeries-wrapper .custom-select-dropdown::-webkit-scrollbar-thumb,
#modalExPct-wrapper .custom-select-dropdown::-webkit-scrollbar-thumb {
  background: hsl(220, 15%, 15%) !important;
  border-radius: 3px !important;
}
#modalExSeries-wrapper .custom-select-dropdown::-webkit-scrollbar-thumb:hover,
#modalExPct-wrapper .custom-select-dropdown::-webkit-scrollbar-thumb:hover {
  background: var(--color-accent-green) !important;
}

/* ==========================================================================
   ESTILOS ADICIONAIS PARA MÓDULO DE MODELOS DE TREINOS
   ========================================================================== */

#templateListGrid {
  margin-top: 1rem;
}

.template-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 220px;
  position: relative;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s ease, box-shadow 0.3s ease;
  box-shadow: var(--card-shadow);
  backdrop-filter: blur(16px);
}

.template-card:hover {
  border-color: rgba(0, 191, 255, 0.35);
  box-shadow: 0 12px 40px rgba(0, 191, 255, 0.06), var(--card-shadow);
  transform: translateY(-4px);
}

.template-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(to right, transparent, rgba(0, 191, 255, 0.35), transparent);
}

.template-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
}

.template-card-meta {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.75rem;
}

.template-card-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-bottom: 1.25rem;
  flex-grow: 1;
}

.template-card-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 0.85rem;
}

.template-card-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.template-card-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.template-card-btn.btn-edit {
  color: var(--color-accent-blue);
  border-color: rgba(0, 191, 255, 0.15);
}

.template-card-btn.btn-edit:hover {
  background: rgba(0, 191, 255, 0.08);
  border-color: rgba(0, 191, 255, 0.4);
}

.template-card-btn.btn-duplicate {
  color: var(--color-accent-purple);
  border-color: rgba(139, 92, 246, 0.15);
}

.template-card-btn.btn-duplicate:hover {
  background: rgba(139, 92, 246, 0.08);
  border-color: rgba(139, 92, 246, 0.4);
}

.template-card-btn.btn-delete {
  color: var(--color-danger);
  border-color: rgba(239, 68, 68, 0.15);
}

.template-card-btn.btn-delete:hover {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.4);
}

/* Import Template Items */
.import-template-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: 10px;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.import-template-item:hover {
  border-color: rgba(0, 191, 255, 0.35);
  background: rgba(0, 191, 255, 0.05);
  transform: translateX(2px);
}

.import-template-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  text-align: left;
}

.import-template-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
}

.import-template-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Coluna da Avaliação Física Ativa Selecionada */
.active-column {
  background: rgba(0, 230, 0, 0.05) !important;
  border-left: 1px solid rgba(0, 230, 0, 0.15) !important;
  border-right: 1px solid rgba(0, 230, 0, 0.15) !important;
  position: relative;
}

th.active-column {
  background: linear-gradient(180deg, rgba(0, 230, 0, 0.12), rgba(0, 230, 0, 0.05)) !important;
  border-top: 2px solid var(--color-brand-green) !important;
  color: #fff !important;
}

tr:hover td.active-column {
  background: rgba(0, 230, 0, 0.08) !important;
}

/* Tamanho compacto do select de avaliações no desktop */
@media (min-width: 768px) {
  #assessmentDateSelect,
  #assessmentDateSelect + .custom-select-wrapper {
    max-width: 130px;
  }
}

/* Cronômetro e Sessão de Treino PTR */
@keyframes pulseGlow {
  0% { transform: scale(1); opacity: 0.6; box-shadow: 0 0 4px #00e600; }
  50% { transform: scale(1.25); opacity: 1; box-shadow: 0 0 14px #00e600; }
  100% { transform: scale(1); opacity: 0.6; box-shadow: 0 0 4px #00e600; }
}

.timer-dot-pulsing {
  width: 10px;
  height: 10px;
  background-color: #00e600;
  border-radius: 50%;
  animation: pulseGlow 1.8s infinite ease-in-out;
  display: inline-block;
}

#trainingTimerVal {
  font-family: 'Courier New', Courier, monospace;
  font-size: 2.2rem;
  font-weight: 800;
  color: #00e600;
  text-shadow: 0 0 10px rgba(0, 230, 0, 0.4);
  letter-spacing: 1px;
}

/* Botão de Excluir Sessão do Histórico com Efeito Hover Premium */
.btn-remove-session {
  background: transparent !important;
  border: none !important;
  padding: 0.2rem !important;
  color: var(--color-danger) !important;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease-in-out !important;
  border-radius: 4px;
}

.btn-remove-session:hover {
  color: #ff3333 !important;
  transform: scale(1.2);
  filter: drop-shadow(0 0 4px rgba(255, 51, 81, 0.6));
}

/* Linha ativa no teste cardiorrespiratório (VO2 Máx) */
.active-vo2-stage-row {
  background: rgba(0, 230, 0, 0.05) !important;
  border-left: 3px solid var(--color-brand-green) !important;
  box-shadow: inset 0 0 8px rgba(0, 230, 0, 0.15);
}
.active-vo2-stage-row td {
  color: #fff !important;
  font-weight: bold;
}
.active-vo2-stage-row input {
  border-color: var(--color-brand-green) !important;
  box-shadow: 0 0 8px rgba(0, 230, 0, 0.3) !important;
  background: rgba(0, 230, 0, 0.03) !important;
}

/* Correção de z-index para evitar que dropdowns customizados sejam cortados por cards abaixo */
.card:has(.custom-select-wrapper.active),
.card:has(.custom-select-dropdown.active) {
  z-index: 15 !important;
}
.custom-select-wrapper.active,
.custom-select-wrapper:has(.custom-select-dropdown.active) {
  z-index: 20 !important;
}

