/* ============================================================
   FITPLAYER - DESIGN DARK FITNESS COM GRÁFICO E MÉTRICAS
============================================================ */

:root {
  --bg-main: #121212;
  --bg-card: #1e1e1e;
  --bg-card-hover: #292929;
  --accent-color: #00e676; /* Verde Neon Fitness */
  --accent-glow: rgba(0, 230, 118, 0.3);
  --text-main: #ffffff;
  --text-secondary: #9e9e9e;
  --danger-color: #ff5252;
  --warning-color: #ffb300;
  --info-color: #29b6f6;
  --nav-height: 65px;
    --bg-box: #141414;
  --bg-box-alt: #1a1a1a;
  --border-subtle: #282828;
}


/* ============================================================
   TEMA CLARO (sobrescreve as variáveis do :root)
============================================================ */
[data-theme="light"] {
  --bg-main: #f4f6f4;
  --bg-card: #ffffff;
  --bg-card-hover: #eef1ee;
  --accent-color: #008f4a;
  --accent-glow: rgba(0, 143, 74, 0.25);
  --text-main: #1a1d1a;
  --text-secondary: #5a615a;
  --danger-color: #d32f2f;
  --warning-color: #b26a00;
  --info-color: #1565c0;
    --bg-box: #f0f2f0;
  --bg-box-alt: #e6e9e6;
  --border-subtle: #d5dad5; 
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

body {
    background-color: var(--bg-main);
  color: var(--text-main);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  overflow: hidden;
}

.app-container {
  width: 100%;
  max-width: 440px;
  height: 100vh;
  background-color: var(--bg-main);
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
}

.app-header {
  padding: 14px 18px;
  background-color: var(--bg-card);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #282828;
}

.admin-pending-banner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 16px 0;
  padding: 10px 12px;
  background: #2d2417;
  border: 1px solid #8d6e15;
  border-radius: 10px;
  color: #ffd54f;
  font-size: 0.82rem;
  line-height: 1.35;
}

.admin-pending-banner-text {
  flex: 1 1 170px;
  min-width: 0;
}

.btn-admin-banner-view {
  background: var(--accent-color);
  border: none;
  border-radius: 8px;
  color: #000;
  font-size: 0.75rem;
  font-weight: bold;
  padding: 6px 10px;
  cursor: pointer;
}

.btn-admin-banner-close {
  background: transparent;
  border: none;
  color: inherit;
  font-size: 1.1rem;
  line-height: 1;
  padding: 2px 6px;
  cursor: pointer;
}

.app-status-banner {
  margin: 10px 16px 0;
}

.sw-update-banner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 16px 0;
  padding: 10px 12px;
  background: #102a3a;
  border: 1px solid #1f6f8b;
  border-radius: 10px;
  color: #9fe3ff;
  font-size: 0.82rem;
  line-height: 1.35;
}

.sw-update-banner-text {
  flex: 1 1 170px;
  min-width: 0;
}

.btn-sw-update-now {
  background: var(--accent-color);
  border: none;
  border-radius: 8px;
  color: #000;
  font-size: 0.75rem;
  font-weight: bold;
  padding: 6px 10px;
  cursor: pointer;
}

.header-main {
  display: flex;
  align-items: center;
  gap: 10px;
}

.app-header h1 {
  font-size: 1.25rem;
  color: var(--accent-color);
  letter-spacing: 0.5px;
}

.status-badge {
  font-size: 0.72rem;
  background: #2a2a2a;
  color: var(--text-secondary);
  padding: 3px 8px;
  border-radius: 12px;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-name-tag {
  font-size: 0.75rem;
  color: var(--text-main);
  background: var(--bg-box);
  padding: 4px 10px;
  border-radius: 12px;
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border: 1px solid #383838;
}

.btn-icon-logout {
  background: #2e1e1e;
  border: 1px solid #4a2828;
  color: #ff8a80;
  border-radius: 8px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-icon-logout:hover {
  background: #4a2525;
}

.tab-content {
  position: relative;
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  padding-bottom: calc(var(--nav-height) + 30px + max(10px, env(safe-area-inset-bottom, 10px)));
}

#pull-refresh-indicator {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translate(-50%, -100%);
  z-index: 1500;
  max-width: calc(100% - 32px);
  padding: 6px 14px;
  background: #1e1e1e;
  border: 1px solid #2e2e2e;
  border-radius: 20px;
  color: #00e676;
  color: var(--accent-color);
  font-size: 0.82rem;
  line-height: 1.3;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

#pull-refresh-indicator.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

.tab-pane {
  display: none;
  animation: fadeIn 0.25s ease;
}

.tab-pane.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Card Player */
.now-playing-card {
  background: linear-gradient(145deg, #1f1f1f, #181818);
  border-radius: 20px;
  padding: 20px;
  text-align: center;
  border: 1px solid #2c2c2c;
  margin-bottom: 16px;
}

.disc-art {
  width: 90px;
  height: 90px;
  background: #2a2a2a;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  margin: 0 auto 15px auto;
  border: 3px solid var(--accent-color);
  box-shadow: 0 0 15px var(--accent-glow);
  transition: transform 0.3s ease;
}

.disc-art.playing {
  animation: rotateDisc 10s linear infinite;
}

@keyframes rotateDisc {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.track-info h3 {
  font-size: 1.1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.track-info p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 15px;
}

.progress-container {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 15px;
}

input[type="range"] {
  flex: 1;
  accent-color: var(--accent-color);
  cursor: pointer;
}

.player-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-bottom: 15px;
  padding-bottom: 16px;
  padding-bottom: max(16px, env(safe-area-inset-bottom, 16px));
}

.ctrl-btn {
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 1.6rem;
  cursor: pointer;
  padding: 8px;
}

.ctrl-btn:active {
  transform: scale(0.9);
}

.main-play {
  width: 55px;
  height: 55px;
  background-color: var(--accent-color);
  color: #000;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 0 15px var(--accent-glow);
}

.volume-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 70%;
  margin: 0 auto;
}

.import-section {
  margin-bottom: 20px;
}

.btn-import {
  display: block;
  background-color: #262626;
  border: 1px dashed var(--accent-color);
  color: var(--accent-color);
  text-align: center;
  padding: 12px;
  border-radius: 12px;
  font-weight: bold;
  cursor: pointer;
}

.playlist-section h4 {
  font-size: 0.95rem;
  margin-bottom: 10px;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.playlist-list {
  list-style: none;
}

.playlist-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--bg-card);
  padding: 12px 14px;
  border-radius: 10px;
  margin-bottom: 8px;
  cursor: pointer;
}

.playlist-item.active {
  border-left: 4px solid var(--accent-color);
  background-color: var(--bg-card-hover);
}

.song-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.song-title {
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 250px;
}

.song-artist {
  font-size: 0.72rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 250px;
}

.album-group {
  list-style: none;
  margin-bottom: 14px;
}

.album-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 4px 6px;
}

.album-title {
  font-size: 0.78rem;
  font-weight: bold;
  color: var(--accent-color);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.album-count {
  font-size: 0.7rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.album-tracks {
  list-style: none;
  margin: 0;
  padding: 0;
}

.legacy-songs-notice {
  background: var(--bg-box);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
}

.legacy-songs-notice p {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.btn-claim-legacy {
  background: var(--bg-card-hover);
  border: 1px solid var(--accent-color);
  color: var(--accent-color);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.78rem;
  font-weight: bold;
  cursor: pointer;
}

.btn-delete {
  background: none;
  border: none;
  color: var(--danger-color);
  font-size: 1rem;
  padding: 4px 8px;
  cursor: pointer;
}

.empty-msg {
  color: var(--text-secondary);
  text-align: center;
  padding: 20px;
  font-size: 0.9rem;
}

/* ============================================================
   DESCOBRIR MÚSICAS
============================================================ */
.discover-entry {
  margin-bottom: 16px;
}

.btn-discover {
  width: 100%;
  background: var(--accent-color);
  border: 1px solid var(--accent-color);
  color: #000;
  border-radius: 12px;
  padding: 11px 14px;
  font-size: 0.9rem;
  font-weight: bold;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-discover:hover {
  opacity: 0.9;
}

.discover-modal {
  position: fixed;
  inset: 0;
  z-index: 2100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.discover-modal[hidden] {
  display: none;
}

.discover-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
}

.discover-sheet {
  position: relative;
  width: 100%;
  max-width: 440px;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 20px 20px 0 0;
  padding: 18px;
  padding-bottom: calc(18px + env(safe-area-inset-bottom));
  animation: discoverSlideUp 0.25s ease;
}

@keyframes discoverSlideUp {
  from { transform: translateY(24px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.discover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.discover-header h3 {
  font-size: 1.05rem;
  color: var(--text-main);
}

.discover-close {
  background: var(--bg-box);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.discover-section {
  margin-bottom: 16px;
}

.discover-section h4 {
  font-size: 0.8rem;
  color: var(--accent-color);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 8px;
}

.discover-step-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.discover-step {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--text-main);
}

.step-number {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-color);
  color: #000;
  font-size: 0.78rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
}

.discover-note {
  margin-top: 8px;
  font-size: 0.74rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

.discover-sources {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.discover-source-card {
  background: var(--bg-box);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 12px;
}

.discover-source-name {
  font-size: 0.92rem;
  color: var(--text-main);
  margin-bottom: 4px;
}

.discover-source-desc {
  font-size: 0.76rem;
  line-height: 1.4;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.discover-source-license {
  font-size: 0.7rem;
  line-height: 1.4;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.discover-source-link {
  display: inline-block;
  background: var(--accent-color);
  color: #000;
  text-decoration: none;
  font-size: 0.76rem;
  font-weight: bold;
  padding: 7px 10px;
  border-radius: 8px;
}

.discover-import-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 16px;
  padding-bottom: max(16px, env(safe-area-inset-bottom, 16px));
}

.discover-import-btn {
  flex: 1;
  min-width: 150px;
  background: var(--bg-box);
  border: 1px dashed var(--accent-color);
  color: var(--accent-color);
  border-radius: 10px;
  padding: 10px;
  font-size: 0.8rem;
  font-weight: bold;
  cursor: pointer;
}

.discover-genres {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.discover-genre-group {
  background: var(--bg-box);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 10px 12px;
}

.discover-genre-name {
  font-size: 0.85rem;
  color: var(--text-main);
  margin-bottom: 8px;
}

.discover-genre-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.discover-genre-link {
  font-size: 0.72rem;
  font-weight: bold;
  color: var(--accent-color);
  border: 1px solid var(--accent-color);
  border-radius: 999px;
  padding: 5px 9px;
  text-decoration: none;
}

.discover-license-note {
  font-size: 0.72rem;
  line-height: 1.45;
  color: var(--text-secondary);
  border-top: 1px solid var(--border-subtle);
  padding-top: 10px;
}

.discover-modal :focus-visible,
.btn-discover:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

body.discover-modal-open .tab-content {
  overflow: hidden;
}

/* Card Base */
.card {
  background-color: var(--bg-card);
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 16px;
  border: 1px solid #2a2a2a;
}

.card-center {
  text-align: center;
}

/* Corrida com Estatísticas Integradas ao Peso */
.timer-display {
  font-size: 2.8rem;
  font-family: monospace;
  font-weight: bold;
  color: var(--accent-color);
  margin: 15px 0 10px 0;
}

.run-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.stat-box {
  background: VAR(--BG-BOX);
  border: 1px solid #2b2b2b;
  border-radius: 12px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-icon {
  font-size: 1.2rem;
  margin-bottom: 2px;
}

.stat-value {
  font-size: 1.3rem;
  font-weight: bold;
  color: var(--accent-color);
}

#run-pace {
  font-size: 1.05rem;
}

.stat-label {
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.run-weight-badge {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 15px;
}

/* Configuração e Mapa do Percurso (GPS) */
.run-gps-config {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-box-alt);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 8px 12px;
  margin-bottom: 12px;
}

.gps-toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-main);
  user-select: none;
}

.gps-status-badge {
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 12px;
  background: #252525;
  color: var(--text-secondary);
  border: 1px solid #333;
}

.gps-status-badge.active {
  background: #172d1f;
  color: var(--accent-color);
  border-color: var(--accent-color);
  font-weight: bold;
}

.gps-status-badge.warning {
  background: #2d2417;
  color: #ffb300;
  border-color: #ffb300;
}

.gps-permission-help {
  background: #2d2417;
  border: 1px solid #ffb300;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
  color: var(--text-secondary);
  font-size: 0.78rem;
  line-height: 1.45;
  text-align: left;
}

.gps-permission-help strong {
  display: block;
  color: #ffb300;
  margin-bottom: 4px;
}

.gps-permission-help p {
  margin: 0 0 6px;
}

.gps-permission-help ul {
  margin: 0 0 8px 16px;
  padding: 0;
}

.gps-permission-help .btn-secondary {
  padding: 8px 12px;
  font-size: 0.78rem;
}

.gps-limit-warning {
  margin: 0;
  font-size: 0.72rem;
  color: #ffb300;
  line-height: 1.4;
}

.run-map-container {
  background: var(--bg-box-alt);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 10px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.run-map-header,
.run-map-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.map-title {
  font-weight: 600;
  color: var(--text-main);
}

.map-pace {
  color: var(--accent-color);
  font-weight: bold;
}

.run-map-canvas-wrapper {
  width: 100%;
  background: var(--bg-box-alt);
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  display: flex;
  justify-content: center;
}

.run-map-canvas-wrapper canvas {
  width: 100%;
  height: auto;
  display: block;
}

.btn-view-route {
  background: #1f2b23;
  color: var(--accent-color);
  border: 1px solid var(--accent-color);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.72rem;
  cursor: pointer;
  margin-left: 6px;
}

.btn-view-route:hover {
  background: var(--accent-color);
  color: #000;
}

.saved-route-stats {
  margin-top: 10px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-align: center;
}

.timer-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  padding-bottom: 16px;
  padding-bottom: max(16px, env(safe-area-inset-bottom, 16px));
}

#btn-run-manual {
  width: 100%;
  margin-top: 10px;
}

.run-extra-fields {
  margin-top: 14px;
  text-align: left;
}

@media (max-width: 380px) {
  .run-stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .run-stats-grid .stat-box:last-child {
    grid-column: 1 / -1;
  }
}

.btn-action {
  background-color: var(--accent-color);
  color: #000;
  border: none;
  padding: 12px 20px;
  border-radius: 10px;
  font-weight: bold;
  cursor: pointer;
}

.btn-secondary {
  background-color: #333;
  color: #fff;
  border: none;
  padding: 12px 18px;
  border-radius: 10px;
  font-weight: bold;
  cursor: pointer;
}

.laps-list {
  margin-top: 15px;
  list-style: none;
  text-align: left;
}

.laps-list li {
  padding: 8px;
  border-bottom: 1px solid #292929;
  font-size: 0.85rem;
}

/* Treino & Descanso */
.card-rest {
  background: linear-gradient(145deg, #18231c, #131d16);
  border: 1px solid #1f3d28;
}

.rest-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.rest-header h4 {
  font-size: 0.95rem;
  color: #c8e6c9;
}

.rest-timer {
  font-size: 1.4rem;
  font-family: monospace;
  font-weight: bold;
  color: var(--accent-color);
  background: #000000;
  padding: 4px 12px;
  border-radius: 8px;
  border: 1px solid var(--accent-color);
}

.rest-timer.running {
  animation: pulseTimer 1s infinite alternate;
}

@keyframes pulseTimer {
  from { box-shadow: 0 0 5px var(--accent-glow); }
  to { box-shadow: 0 0 15px var(--accent-color); }
}

.rest-quick-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-bottom: 16px;
  padding-bottom: max(16px, env(safe-area-inset-bottom, 16px));
}

.btn-rest-preset {
  background: #253329;
  border: 1px solid #36503c;
  color: #fff;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: bold;
  cursor: pointer;
  flex: 1;
}

.btn-rest-cancel {
  background: #3e2723;
  border: 1px solid #5d4037;
  color: #ff8a80;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: bold;
  cursor: pointer;
}

.section-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.btn-text-danger {
  background: none;
  border: none;
  color: var(--danger-color);
  font-size: 0.75rem;
  cursor: pointer;
  text-decoration: underline;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}

.full-width {
  grid-column: 1 / -1;
}

.form-grid input, .form-grid select, .form-medidas-grid input, .form-medidas-grid select {
  background-color: #121212;
  border: 1px solid #333;
  color: #fff;
  padding: 10px;
  border-radius: 8px;
  font-size: 0.85rem;
  width: 100%;
}

.form-grid label, .form-medidas-grid label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 4px;
}

.exercise-card {
  background-color: var(--bg-card);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
  border: 1px solid #2e2e2e;
}

.exercise-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.exercise-title {
  font-size: 1rem;
  font-weight: bold;
}

.exercise-meta {
  font-size: 0.8rem;
  color: var(--accent-color);
  margin-top: 2px;
}

.exercise-sets-container {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #2a2a2a;
}

.set-chip {
  background-color: #262626;
  border: 1px solid #3a3a3a;
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
}

.set-chip.done {
  background-color: #1b5e20;
  border-color: var(--accent-color);
  box-shadow: 0 0 8px var(--accent-glow);
}

/* ============================================================
   ESTILOS DE MEDIDAS, IMC, TMB E GRÁFICO CANVAS
============================================================ */

/* Card Métricas (IMC & TMB) */
.card-metrics {
  display: flex;
  justify-content: space-around;
  align-items: center;
  background: linear-gradient(145deg, #16241b, #121a15);
  border: 1px solid #1e3d26;
  padding: 16px 10px;
}

.metric-item {
  text-align: center;
  flex: 1;
}

.metric-title {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.metric-val {
  font-size: 1.8rem;
  font-weight: bold;
  color: var(--accent-color);
  margin: 4px 0;
}

.metric-badge {
  display: inline-block;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 10px;
  background: #333;
  color: #fff;
  font-weight: bold;
}

.metric-badge.normal { background: #1b5e20; color: #a5d6a7; }
.metric-badge.warning { background: #e65100; color: #ffe0b2; }
.metric-badge.danger { background: #b71c1c; color: #ffcdd2; }

.metric-sub {
  font-size: 0.65rem;
  color: var(--text-secondary);
  display: block;
}

.metric-divider {
  width: 1px;
  height: 50px;
  background: #2a3a2e;
}

/* Gráfico Canvas */
.canvas-container {
  width: 100%;
  display: flex;
  justify-content: center;
  background: #141414;
  border-radius: 12px;
  padding: 10px;
  border: 1px solid #282828;
}

#weight-chart {
  width: 100%;
  height: auto;
  display: block;
}

.chart-subtitle {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Formulário de Medidas */
.form-medidas-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.medidas-history-list {
  list-style: none;
  margin-top: 10px;
}

.medidas-history-item {
  background: #161616;
  border: 1px solid #262626;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.med-header {
  font-size: 0.85rem;
  font-weight: bold;
  color: var(--accent-color);
  margin-bottom: 4px;
}

.med-details {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Barra de Navegação */
.bottom-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--nav-height) + max(10px, env(safe-area-inset-bottom, 10px)));
  padding-bottom: max(10px, env(safe-area-inset-bottom, 10px));
  padding-top: 8px;
  background-color: var(--bg-card);
    border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-around;
  align-items: flex-start;
}

.nav-item {
  position: relative;
  background: none;
  border: none;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  flex: 1;
  min-width: 0;
  padding: 4px 1px;
}

.nav-icon { font-size: 1.25rem; }
.nav-label {
  font-size: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.nav-item.active { color: var(--accent-color); }

.nav-badge {
  position: absolute;
  top: 2px;
  right: calc(50% - 22px);
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 9px;
  background-color: var(--danger-color);
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  pointer-events: none;
  border: 1.5px solid var(--bg-card);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.nav-badge.badge-bump {
  animation: navBadgeBump 0.4s ease-out;
}

@keyframes navBadgeBump {
  0% { transform: scale(1); }
  50% { transform: scale(1.35); }
  100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .nav-badge.badge-bump {
    animation: none;
  }
}

@media (max-width: 380px) {
  .nav-icon { font-size: 1.1rem; }
  .nav-label { font-size: 0.68rem; }
}

/* ============================================================
   PAINEL GERAL (DASHBOARD)
============================================================ */
.panel-period-selector {
  display: flex;
  flex-wrap: wrap;
  background-color: var(--bg-box-alt);
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  padding: 4px;
  gap: 6px;
  margin-bottom: 16px;
}

.btn-period {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-period.active {
  background-color: #253328;
  border: 1px solid var(--accent-color);
  color: var(--accent-color);
  font-weight: bold;
}

.panel-status-banner {
  padding: 16px;
  margin-bottom: 16px;
  border-left: 4px solid var(--accent-color);
}

.panel-status-icon {
  font-size: 2rem;
  margin-bottom: 6px;
}

.panel-status-desc {
  color: var(--accent-color);
  font-weight: 600;
  font-size: 0.95rem;
  margin-top: 4px;
}

.panel-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.panel-charts-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chart-empty-area {
  min-height: 130px;
  background: var(--bg-box);
  border: 1px dashed var(--border-subtle);
  border-radius: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 12px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  text-align: center;
  padding: 16px;
}

.chart-active-area {
  width: 100%;
  background: var(--bg-box);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 12px 10px;
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.chart-active-area canvas {
  width: 100%;
  height: auto;
  display: block;
}

.chart-footer-text {
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-align: center;
  width: 100%;
}

.pie-chart-wrapper {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.pie-chart-wrapper canvas {
  width: 100%;
  max-width: 260px;
  height: auto;
  display: block;
}

.pie-legend-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 4px 6px;
}

.pie-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-main);
}

.legend-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.panel-modality-details {
  margin-top: 18px;
}

.panel-modality-details .section-header-flex {
  margin-bottom: 10px;
}

.panel-detail-card {
  margin-bottom: 0;
}

.panel-detail-card h4 {
  margin-bottom: 2px;
}

.panel-detail-stats {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
}

.panel-detail-stat {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 8px 10px;
}

.panel-detail-stat-value {
  display: block;
  font-size: 1rem;
  font-weight: bold;
  color: var(--text-main);
  line-height: 1.2;
}

.panel-detail-stat-label {
  display: block;
  margin-top: 2px;
  font-size: 0.68rem;
  color: var(--text-secondary);
  line-height: 1.3;
}

/* ============================================================
   AUTENTICAÇÃO & CONTROLE DE ACESSO (SUPABASE AUTH)
============================================================ */
.auth-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-main);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 24px 20px;
}

.auth-content {
  width: 100%;
  max-width: 380px;
  margin: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: fadeIn 0.3s ease;
}

.auth-brand {
  text-align: center;
  margin-bottom: 4px;
}

.auth-logo-badge {
  width: 56px;
  height: 56px;
  margin: 0 auto 10px;
  background: linear-gradient(135deg, #1f3d26, #16241b);
  border: 2px solid var(--accent-color);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  box-shadow: 0 0 20px var(--accent-glow);
}

.auth-brand h2 {
  font-size: 1.6rem;
  color: #fff;
  letter-spacing: 0.5px;
}

.auth-tagline {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Tabs de Login / Cadastro */
.auth-tabs {
  display: flex;
  background: #1e1e1e;
  border-radius: 10px;
  padding: 4px;
  border: 1px solid #2e2e2e;
}

.auth-tab-btn {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: 10px;
  font-size: 0.9rem;
  font-weight: bold;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.auth-tab-btn.active {
  background: var(--bg-main);
  color: var(--accent-color);
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

/* Formulários */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-field label {
  font-size: 0.8rem;
  color: #bbb;
  font-weight: 500;
}

.field-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.auth-field input {
  background-color: #1a1a1a;
  border: 1px solid #333;
  color: #fff;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-field input:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.field-hint {
  font-size: 0.72rem;
  color: #888;
}

/* Campo com botão de alternar visualização de senha */
.password-input-group {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.password-input-group input {
  width: 100%;
  padding-right: 44px;
}

.btn-toggle-password {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  padding: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #888;
  border-radius: 6px;
  transition: color 0.2s, background-color 0.2s;
  user-select: none;
}

.btn-toggle-password:hover {
  color: var(--text-main);
  background-color: rgba(255, 255, 255, 0.08);
}

.btn-toggle-password:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 1px;
}

.btn-toggle-password .eye-icon-show,
.btn-toggle-password .eye-icon-hide {
  display: block;
}

.btn-toggle-password .eye-icon-hide {
  display: none;
}

.btn-toggle-password.is-visible .eye-icon-show {
  display: none;
}

.btn-toggle-password.is-visible .eye-icon-hide {
  display: block;
}

/* Checkbox dos Termos */
.auth-checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 4px 0;
}

.auth-checkbox-group input[type="checkbox"] {
  margin-top: 3px;
  accent-color: var(--accent-color);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.auth-checkbox-group label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.4;
  cursor: pointer;
}

/* Botões */
.btn-auth-submit {
  background-color: var(--accent-color);
  color: #000;
  border: none;
  padding: 14px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: bold;
  cursor: pointer;
  margin-top: 6px;
  transition: transform 0.1s, opacity 0.2s;
}

.btn-auth-submit:hover {
  opacity: 0.92;
}

.btn-auth-submit:active {
  transform: scale(0.98);
}

.btn-secondary-auth {
  background-color: var(--bg-box-alt);
  color: #eee;
  border: 1px solid #3d3d3d;
  padding: 12px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: bold;
  cursor: pointer;
  width: 100%;
  transition: background 0.2s;
}

.btn-secondary-auth:hover {
  background-color: var(--bg-card);
}

.btn-link {
  background: none;
  border: none;
  color: var(--accent-color);
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.btn-link-inline {
  background: none;
  border: none;
  color: var(--accent-color);
  font-size: inherit;
  font-family: inherit;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  display: inline;
}

/* Alertas de Feedback */
.auth-alert {
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 0.82rem;
  line-height: 1.4;
}

.alert-warning {
  background: #332700;
  border: 1px solid #806000;
  color: #ffd54f;
}

.alert-danger {
  background: #381010;
  border: 1px solid #802020;
  color: #ff8a80;
}

.alert-success {
  background: #0f301b;
  border: 1px solid #1f6b3d;
  color: #a5d6a7;
}

/* Tela de Status (Pendente / Bloqueado) */
.auth-status-screen {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 10px 0;
}

.status-icon {
  font-size: 3rem;
  margin-bottom: 4px;
}

.auth-status-screen h3 {
  font-size: 1.3rem;
  color: #fff;
}

.status-msg {
  font-size: 0.85rem;
  color: #ccc;
  line-height: 1.5;
}

.pending-info-box {
  background: #1c2720;
  border: 1px solid #284432;
  border-radius: 12px;
  padding: 14px;
  text-align: left;
  font-size: 0.8rem;
  color: #b0bec5;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pending-user-email {
  font-size: 0.75rem;
  color: #888;
}

/* Modal de Termos */
.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-card {
  background: #1c1c1c;
  border: 1px solid #333;
  border-radius: 16px;
  width: 100%;
  max-width: 400px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 30px rgba(0,0,0,0.9);
  animation: fadeIn 0.2s ease;
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid #2b2b2b;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 1rem;
  color: var(--accent-color);
}

.btn-modal-close {
  background: none;
  border: none;
  color: #888;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 4px;
}

.btn-modal-close:hover {
  color: #fff;
}

.modal-body {
  padding: 18px 20px;
  overflow-y: auto;
  font-size: 0.82rem;
  line-height: 1.5;
  color: #ccc;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-body h4 {
  color: #fff;
  font-size: 0.88rem;
  margin-top: 6px;
}

.terms-footer-note {
  margin-top: 10px;
  font-size: 0.75rem;
  color: #777;
}

.modal-footer {
  padding: 14px 20px;
  padding-bottom: 16px;
  padding-bottom: max(16px, env(safe-area-inset-bottom, 16px));
  border-top: 1px solid #2b2b2b;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.modal-footer > .full-width {
  flex: 1 1 100%;
}

/* Modal de Atualização */
#modal-update-notice {
  z-index: 2300;
  padding-bottom: max(16px, env(safe-area-inset-bottom, 16px));
}

#modal-update-notice .modal-card {
  background: #141414;
  border-color: #282828;
}

#modal-update-notice .modal-header,
#modal-update-notice .modal-footer {
  border-color: #282828;
}

#modal-update-notice .modal-body {
  gap: 14px;
}

.update-notice-platform {
  padding: 12px 14px;
  background: #1b1b1b;
  border: 1px solid #282828;
  border-radius: 12px;
}

.update-notice-platform strong {
  display: block;
  margin-bottom: 4px;
  color: #f5f5f5;
  font-size: 0.84rem;
}

.update-notice-platform p {
  margin: 0;
  color: #bdbdbd;
  font-size: 0.8rem;
  line-height: 1.5;
}

.update-notice-actions {
  padding-bottom: 16px;
  padding-bottom: max(16px, env(safe-area-inset-bottom, 16px));
}

.update-notice-actions .btn-secondary-auth,
.update-notice-actions .btn-action {
  flex: 1 1 140px;
  width: auto;
}

@media (max-width: 420px) {
  .update-notice-actions .btn-secondary-auth,
  .update-notice-actions .btn-action {
    flex-basis: 100%;
  }
}

/* ============================================================
   EXCLUSÃO DE CONTA
============================================================ */
#delete-account-modal {
  z-index: 2200;
}

.account-delete-warning {
  margin: 8px 0 14px;
  color: var(--text-secondary);
  font-size: 0.82rem;
  line-height: 1.5;
}

.account-app-version {
  margin: 6px 0 10px;
  color: var(--text-secondary);
  font-size: 0.75rem;
}

.account-delete-link {
  align-self: center;
  font-size: 0.78rem;
  padding: 2px 0;
}

.btn-delete-account {
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: 10px;
  background: var(--danger-color);
  color: #fff;
  font-weight: bold;
  cursor: pointer;
}

.btn-delete-account:hover {
  opacity: 0.9;
}

.btn-delete-account:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.account-delete-actions {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  gap: 10px;
  padding-bottom: 16px;
  padding-bottom: max(16px, env(safe-area-inset-bottom, 16px));
}

@media (min-width: 420px) {
  .account-delete-actions {
    flex-direction: row;
  }

  .account-delete-actions > button {
    flex: 1;
  }
}

/* ============================================================
   PAINEL DO ADMINISTRADOR (GESTÃO DE USUÁRIOS)
============================================================ */

/* Badge de Admin no cabeçalho */
.admin-badge-tag {
  font-size: 0.7rem;
  background: linear-gradient(135deg, #1b5e20, #00e676);
  color: #000;
  font-weight: bold;
  padding: 3px 8px;
  border-radius: 10px;
  letter-spacing: 0.3px;
}

/* Botão de Ação Pequeno */
.btn-action-sm {
  background-color: #2a2a2a;
  border: 1px solid #3d3d3d;
  color: #fff;
  font-size: 0.75rem;
  font-weight: bold;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-action-sm:hover {
  background-color: #383838;
}

.admin-subtitle {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.admin-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-top: 10px;
}

.btn-filter-status {
  background: #181818;
  border: 1px solid #333;
  color: var(--text-secondary);
  font-size: 0.75rem;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.btn-filter-status.active {
  background: #253328;
  border-color: var(--accent-color);
  color: var(--accent-color);
  font-weight: bold;
}

.admin-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 8px 10px;
  background: #181818;
  border: 1px solid #2e2e2e;
  border-radius: 10px;
}

.admin-search-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: var(--text-secondary);
}

.admin-search-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-size: 0.85rem;
}

.admin-search-input::placeholder {
  color: var(--text-secondary);
}

.btn-admin-search-clear {
  background: transparent;
  border: none;
  color: var(--accent-color);
  font-size: 0.75rem;
  font-weight: bold;
  padding: 2px 4px;
  cursor: pointer;
}

.admin-search-meta {
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Lista de Usuários do Admin */
.admin-users-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-user-card {
  background: #181818;
  border: 1px solid #2e2e2e;
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.2s;
}

.admin-user-card:hover {
  border-color: #3f3f3f;
}

.admin-user-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.admin-user-name {
  font-size: 0.95rem;
  font-weight: bold;
  color: #fff;
}

.admin-user-email {
  font-size: 0.8rem;
  color: var(--text-secondary);
  word-break: break-all;
}

.badge-status {
  font-size: 0.7rem;
  font-weight: bold;
  padding: 3px 8px;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.badge-pendente {
  background: #3e3210;
  border: 1px solid #8d6e15;
  color: #ffd54f;
}

.badge-aprovado {
  background: #12301c;
  border: 1px solid #1f6b3d;
  color: #a5d6a7;
}

.badge-bloqueado, .badge-rejeitado {
  background: #3e1818;
  border: 1px solid #7c2d2d;
  color: #ff8a80;
}

.admin-user-meta {
  font-size: 0.75rem;
  color: #777;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.admin-user-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
  padding-bottom: 16px;
  padding-bottom: max(16px, env(safe-area-inset-bottom, 16px));
}

.btn-admin-action {
  flex: 1;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: bold;
  cursor: pointer;
  border: none;
  transition: opacity 0.2s;
}

.btn-admin-action:hover {
  opacity: 0.88;
}

.btn-approve {
  background-color: var(--accent-color);
  color: #000;
}

.btn-block {
  background-color: #3b1818;
  border: 1px solid #6b2626;
  color: #ff8a80;
}

.btn-reactivate {
  background-color: #1e3a2b;
  border: 1px solid #2e5941;
  color: #a5d6a7;
}

.admin-btn-delete,
.btn-danger {
  background-color: #3b1818;
  border: 1px solid #6b2626;
  color: #ff8a80;
}

.admin-btn-delete:hover,
.btn-danger:hover {
  background-color: #4a1d1d;
  color: #ffb3ad;
}

/* ============================================================
   TEMA CLARO — SOBRESCRITAS (player, descanso, métricas,
   formulários e selos)
============================================================ */
[data-theme="light"] {
  color-scheme: light;
}

/* 1. Player de música (aba Música) */
[data-theme="light"] .now-playing-card {
  background: linear-gradient(145deg, #ffffff, #eef1ee);
  border-color: var(--border-subtle);
}

[data-theme="light"] .disc-art {
  background: var(--bg-box-alt);
}

[data-theme="light"] .btn-import {
  background-color: var(--bg-box);
  color: var(--accent-color);
}

/* 2. Descanso entre séries (aba Treino) */
[data-theme="light"] .card-rest {
  background: linear-gradient(145deg, #eef7f0, #e4f0e7);
  border-color: #c4ddca;
}

[data-theme="light"] .rest-header h4 {
  color: #1f5136;
}

[data-theme="light"] .rest-timer {
  background: #ffffff;
  color: var(--accent-color);
  border-color: var(--accent-color);
}

[data-theme="light"] .btn-rest-preset {
  background: #e6f2e9;
  border-color: #b9d7c1;
  color: var(--text-main);
}

[data-theme="light"] .btn-rest-cancel {
  background: #fdecea;
  border-color: #f5c6c0;
  color: #b3261e;
}

/* 3. IMC/TMB e gráfico de peso (aba Medidas) */
[data-theme="light"] .card-metrics {
  background: linear-gradient(145deg, #eef7f0, #e4f0e7);
  border-color: #c4ddca;
}

[data-theme="light"] .metric-badge {
  background: var(--bg-box-alt);
  color: var(--text-main);
}

[data-theme="light"] .metric-badge.normal {
  background: #d7f0df;
  color: #0b5d32;
}

[data-theme="light"] .metric-badge.warning {
  background: #ffe9c7;
  color: #7a4a00;
}

[data-theme="light"] .metric-badge.danger {
  background: #fde0dc;
  color: #a3231a;
}

[data-theme="light"] .metric-divider {
  background: #c9dccf;
}

[data-theme="light"] .canvas-container {
  background: #ffffff;
  border-color: var(--border-subtle);
}

/* 4. Campos texto/select/date (Treino e Medidas) */
[data-theme="light"] .form-grid input,
[data-theme="light"] .form-grid select,
[data-theme="light"] .form-medidas-grid input,
[data-theme="light"] .form-medidas-grid select {
  background-color: #ffffff;
  border-color: var(--border-subtle);
  color: var(--text-main);
}

[data-theme="light"] .form-grid input::placeholder,
[data-theme="light"] .form-medidas-grid input::placeholder {
  color: var(--text-secondary);
}

/* 5. Selos Online e GPS configurado */
[data-theme="light"] .status-badge {
  background: var(--bg-box-alt);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

[data-theme="light"] .gps-status-badge {
  background: var(--bg-box);
  color: var(--text-secondary);
  border-color: var(--border-subtle);
}

[data-theme="light"] .gps-status-badge.active {
  background: #d7f0df;
  color: #006b37;
  border-color: var(--accent-color);
}

[data-theme="light"] .gps-status-badge.warning {
  background: #ffe9c7;
  color: #7a4a00;
  border-color: #d99a2b;
}

[data-theme="light"] .admin-pending-banner {
  background: #fff4d6;
  border-color: #d99a2b;
  color: #7a4a00;
}

[data-theme="light"] .sw-update-banner {
  background: #e6f4fb;
  border-color: #8cc7df;
  color: #0b4a5e;
}

[data-theme="light"] .admin-search-wrap {
  background: var(--bg-card);
  border-color: var(--border-subtle);
}

[data-theme="light"] .admin-search-input {
  color: var(--text-main);
}

[data-theme="light"] .admin-search-input::placeholder {
  color: var(--text-secondary);
}

[data-theme="light"] .btn-admin-search-clear {
  color: var(--accent-color);
}

[data-theme="light"] .app-status-banner.alert-success {
  background: #d7f0df;
  border-color: #91c9a4;
  color: #0b5d32;
}

[data-theme="light"] .app-status-banner.alert-danger {
  background: #fde0dc;
  border-color: #f0a8a2;
  color: #a3231a;
}

[data-theme="light"] .app-status-banner.alert-warning {
  background: #ffe9c7;
  border-color: #d99a2b;
  color: #7a4a00;
}

/* Ajustes do Bloco GPS e Modais no Tema Claro */
[data-theme="light"] .run-gps-config {
  background: var(--bg-card);
  border-color: var(--border-subtle);
}

[data-theme="light"] .run-map-container {
  background: var(--bg-card);
  border-color: var(--border-subtle);
}

[data-theme="light"] .run-map-canvas-wrapper {
  background: var(--bg-card);
  border-color: var(--border-subtle);
}

[data-theme="light"] .btn-view-route {
  background: #e8f5e9;
  color: var(--accent-color);
  border-color: var(--accent-color);
}

[data-theme="light"] .btn-view-route:hover {
  background: var(--accent-color);
  color: #ffffff;
}

[data-theme="light"] .gps-permission-help {
  background: #fff4d6;
  border-color: #d99a2b;
  color: var(--text-main);
}

[data-theme="light"] .gps-permission-help strong {
  color: #7a4a00;
}

[data-theme="light"] .gps-limit-warning {
  color: #7a4a00;
}

[data-theme="light"] .saved-route-stats {
  color: var(--text-secondary);
}

[data-theme="light"] .modal-card {
  background: var(--bg-card);
  border-color: var(--border-subtle);
  color: var(--text-main);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .modal-header {
  border-color: var(--border-subtle);
}

[data-theme="light"] .account-card {
  background: var(--bg-card);
  border-color: var(--border-subtle);
}

[data-theme="light"] .account-card h3 {
  color: var(--text-main);
}

[data-theme="light"] .account-delete-warning {
  color: var(--text-secondary);
}

[data-theme="light"] #delete-account-modal .modal-card {
  background: var(--bg-card);
  border-color: var(--border-subtle);
  color: var(--text-main);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] #delete-account-modal .modal-header {
  border-bottom-color: var(--border-subtle);
}

[data-theme="light"] #delete-account-modal .modal-body {
  color: var(--text-main);
}

[data-theme="light"] #delete-account-modal .auth-field label {
  color: var(--text-main);
}

[data-theme="light"] #delete-account-modal .auth-field input {
  background-color: var(--bg-card);
  border-color: var(--border-subtle);
  color: var(--text-main);
}

[data-theme="light"] #delete-account-modal .auth-field input::placeholder {
  color: var(--text-secondary);
}

[data-theme="light"] #delete-account-modal .btn-modal-close {
  color: var(--text-secondary);
}

[data-theme="light"] #delete-account-modal .btn-modal-close:hover {
  color: var(--text-main);
}

[data-theme="light"] #delete-account-modal .auth-alert.alert-danger {
  background: #fdecea;
  border-color: #e0a3a3;
  color: #8a1c1c;
}

[data-theme="light"] #delete-account-modal .auth-alert.alert-warning {
  background: #fff4d6;
  border-color: #d99a2b;
  color: #7a4a00;
}

/* ============================================================
   BOTÃO DE TEMA CLARO/ESCURO
============================================================ */
.btn-icon-theme {
  background: #2a2a2a;
  border: 1px solid #3a3a3a;
  color: var(--text-main);
  border-radius: 8px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-icon-theme:hover {
  background: #383838;
}

[data-theme="light"] .btn-icon-theme {
  background: var(--bg-box);
  border-color: var(--border-subtle);
  color: var(--text-main);
}

[data-theme="light"] .btn-icon-theme:hover {
  background: var(--bg-card-hover);
}

/* ============================================================
   ATIVIDADES
============================================================ */
.activity-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.activity-item {
  background: var(--bg-box);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  color: var(--text-main);
  padding: 10px 6px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: background 0.2s, border-color 0.2s;
}

.activity-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-color);
}

.activity-item:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

.activity-icon {
  font-size: 1.45rem;
  line-height: 1;
}

.activity-label {
  font-size: 0.7rem;
  text-align: center;
  line-height: 1.2;
}

.activity-form {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}

.activity-hint {
  grid-column: 1 / -1;
  font-size: 0.72rem;
  line-height: 1.4;
  color: var(--text-secondary);
}

.activity-group-fields {
  gap: 10px;
}

.activity-sets-grid {
  display: grid;
  gap: 6px;
}

.activity-set-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 14px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
}

.activity-set-label,
.activity-set-sep {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.activity-set-sep {
  text-align: center;
}

.activity-set-row input {
  padding: 7px 8px;
  font-size: 0.8rem;
}

.activity-history {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}

.activity-history h4 {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.activity-list {
  list-style: none;
}

.activity-history-item {
  background: var(--bg-box);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.activity-history-title {
  font-size: 0.82rem;
  font-weight: bold;
  color: var(--text-main);
}

.activity-history-details {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.activity-history-note {
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-style: italic;
}

@media (max-width: 360px) {
  .activity-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ============================================================
   ESPORTES - SUBVIEWS
============================================================ */
.esportes-back-bar {
  margin-bottom: 12px;
}

.run-in-progress-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 10px 14px;
  border: 1px solid var(--accent-color);
  border-radius: 12px;
  background: var(--bg-box);
  color: var(--text-main);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

.run-in-progress-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.run-in-progress-text strong {
  font-size: 0.9rem;
  color: var(--accent-color);
}

.run-in-progress-text span {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.run-in-progress-bar .btn-secondary {
  flex-shrink: 0;
  padding: 8px 12px;
  font-size: 0.78rem;
}

@media (max-width: 380px) {
  .run-in-progress-bar {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ============================================================
   TEMA CLARO - AUTENTICAÇÃO
============================================================ */
[data-theme="light"] .auth-content {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .auth-brand h2 {
  color: var(--accent-color);
}

[data-theme="light"] .auth-tabs {
  background: var(--bg-box);
  border-color: var(--border-subtle);
}

[data-theme="light"] .auth-tab-btn.active {
  background: var(--bg-card);
  color: var(--accent-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .auth-field label {
  color: var(--text-main);
}

[data-theme="light"] .auth-field input {
  background-color: var(--bg-card);
  border-color: var(--border-subtle);
  color: var(--text-main);
}

[data-theme="light"] .auth-field input::placeholder {
  color: var(--text-secondary);
}

[data-theme="light"] .field-hint,
[data-theme="light"] .auth-tagline,
[data-theme="light"] .pending-user-email {
  color: var(--text-secondary);
}

[data-theme="light"] .btn-toggle-password {
  color: var(--text-secondary);
}

[data-theme="light"] .btn-toggle-password:hover {
  color: var(--text-main);
  background-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .auth-status-screen h3 {
  color: var(--text-main);
}

[data-theme="light"] .status-msg {
  color: var(--text-secondary);
}

[data-theme="light"] .pending-info-box {
  background: var(--bg-box);
  border-color: var(--border-subtle);
  color: var(--text-secondary);
}

[data-theme="light"] .btn-secondary-auth {
  background-color: var(--bg-box);
  color: var(--text-main);
  border-color: var(--border-subtle);
}

[data-theme="light"] .btn-secondary-auth:hover {
  background-color: var(--bg-card-hover);
}

@media (max-width: 480px) {
  .timer-controls > button,
  .rest-quick-btns > button,
  .discover-import-actions > button,
  .admin-user-actions > button,
  .panel-period-selector > button,
  .account-delete-actions > button,
  .modal-footer > button {
    min-width: min(140px, 100%);
    max-width: 100%;
  }

  .timer-controls > button,
  .rest-quick-btns > button,
  .discover-import-actions > button,
  .admin-user-actions > button,
  .panel-period-selector > button {
    flex: 1 1 140px;
  }

  .modal-footer > button {
    flex: 1 1 100%;
  }

  .app-container,
  .tab-content,
  .modal-card,
  .discover-sheet {
    overflow-x: hidden;
  }
}
