/* ==========================================================================
   Cleiton Fit — Design System
   Preto · Dourado · Azul · Branco
   Base escura = app do aluno | Base branca = painel do professor
   ========================================================================== */

/* ---------------------------------------------------------------- Tokens */
:root {
  /* Escuro (app do aluno) */
  --black: #0B0B0F;
  --surface: #14141A;
  --elevated: #1E1E28;
  --raised: #22222C;
  --border: #2A2A36;
  --border-soft: #22222C;
  --border-strong: #3A3A48;

  /* Dourado — conquista e premium */
  --gold: #D4AF37;
  --gold-light: #F0D68A;
  --gold-hover: #E5C258;
  --gold-dim: rgba(212, 175, 55, .14);
  --gold-line: rgba(212, 175, 55, .35);

  /* Azul — sempre ação */
  --blue: #2E6BFF;
  --blue-hover: #1B4DE0;
  --blue-deep: #0A2A6B;
  --blue-light: #7EA5FF;
  --blue-dim: rgba(46, 107, 255, .12);
  --blue-line: rgba(46, 107, 255, .30);

  /* Texto no escuro */
  --text: #FFFFFF;
  --text-muted: #9A9AA8;
  --text-dim: #71717F;
  --text-faint: #55555F;

  /* Claro (painel do professor) */
  --l-bg: #F6F5F2;
  --l-card: #FFFFFF;
  --l-border: #E6E3DC;
  --l-border-input: #DDD9D0;
  --l-text: #0B0B0F;
  --l-muted: #6B6B78;
  --l-dim: #8A8A99;

  /* Status */
  --success: #2ED17C;
  --success-soft: #5FE0A0;
  --warning: #FFB020;
  --warning-soft: #FFC65C;
  --danger: #FF4D4F;
  --danger-soft: #FF8A8B;
  --danger-strong: #D63A3C;

  /* Formas */
  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 12px;
  --r-xl: 14px;
  --r-2xl: 16px;
  --r-3xl: 20px;
  --pill: 9999px;

  --shadow-blue: 0 6px 18px rgba(46, 107, 255, .35);
  --shadow-card: 0 24px 60px rgba(0, 0, 0, .28);

  --font-display: Sora, system-ui, sans-serif;
  --font-body: Manrope, system-ui, -apple-system, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

html,
body,
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(212, 175, 55, .55) rgba(26, 26, 34, .9);
}
*::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
*::-webkit-scrollbar-track {
  margin: 6px 0;
  background: rgba(26, 26, 34, .9);
  border-radius: var(--pill);
}
*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--gold-light), var(--gold));
  border-radius: var(--pill);
  border: 1px solid rgba(11, 11, 15, .35);
}
*::-webkit-scrollbar-thumb:hover {
  background: var(--gold-hover);
}

body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-hover); }

img { max-width: 100%; display: block; }

::selection { background: var(--gold); color: var(--black); }

/* O atributo hidden precisa vencer qualquer display definido depois
   (.modal-backdrop e o cronometro de descanso usam display:flex). */
[hidden] { display: none !important; }

/* --------------------------------------------------------------- Tipografia */
.display    { font: 800 40px/1.05 var(--font-display); letter-spacing: -.02em; }
.title      { font: 800 26px/1.1 var(--font-display); letter-spacing: -.02em; }
.title-sm   { font: 700 20px/1.2 var(--font-display); }
.heading    { font: 700 16px var(--font-body); }
.body       { font: 500 14px/1.5 var(--font-body); }
.label {
  font: 700 11px var(--font-body);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold);
}
.num { font-family: var(--font-display); font-weight: 700; font-variant-numeric: tabular-nums; }

.muted  { color: var(--text-muted); }
.dim    { color: var(--text-dim); }
.faint  { color: var(--text-faint); }
.gold   { color: var(--gold); }
.t-blue { color: var(--blue); }

/* =========================================================================
   APP DO ALUNO — base escura
   ========================================================================= */
.app-dark {
  background: var(--black);
  color: var(--text);
  min-height: 100vh;
}

.app-shell {
  max-width: 480px;
  margin: 0 auto;
  padding: 22px 20px 108px;
  min-height: 100vh;
}

.app-glow { background: radial-gradient(120% 60% at 50% 0%, #1A1608 0%, #0B0B0F 60%); }

/* Cabeçalho do app */
.app-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.note-back {
  display: inline-block;
  font: 700 13px var(--font-body);
  color: var(--gold);
  text-decoration: none;
}
.note-clear-all {
  background: none; border: 0; cursor: pointer;
  font: 700 13px var(--font-body); color: var(--text-muted);
  min-height: 40px; padding: 0 4px;
}
.note-clear-all:active { color: var(--danger-soft); }
.note-card {
  display: flex; align-items: stretch;
  padding: 0; overflow: hidden;
}
.note-card__go {
  flex: 1; min-width: 0; padding: 14px;
  text-decoration: none; color: inherit;
}
.note-card__go:active { background: rgba(255, 255, 255, .04); }
.note-card__clear {
  flex: none; width: 48px; min-height: 48px;
  border: 0; background: transparent;
  color: var(--text-dim); cursor: pointer;
  font: 700 22px var(--font-body); line-height: 1;
}
.note-card__clear:active { color: var(--danger-soft); }

/* Barra inferior */
.tabbar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 14px;
  width: min(452px, calc(100% - 28px));
  display: flex;
  justify-content: space-between;
  padding: 10px 8px;
  border-radius: var(--r-xl);
  background: rgba(11, 11, 15, .94);
  backdrop-filter: blur(12px);
  border: 1px solid var(--raised);
  z-index: 50;
}
.tabbar a {
  flex: 1;
  text-align: center;
  color: var(--text-dim);
  padding: 6px 4px;
  border-radius: var(--r-lg);
  transition: background .15s, color .15s;
}
.tabbar .ico {
  color: var(--text-faint);
  line-height: 0;
  display: flex;
  justify-content: center;
  margin-bottom: 3px;
}
.tabbar .ico svg { width: 22px; height: 22px; }
.tabbar .lbl { font: 700 10px var(--font-body); }
.tabbar a.active {
  background: var(--gold-dim);
}
.tabbar a.active .ico,
.tabbar a.active .lbl { color: var(--gold); }

/* Chat */
.chat-thread { display: flex; flex-direction: column; gap: 10px; padding-bottom: 86px; }
.chat-row { display: flex; }
.chat-row.is-mine { justify-content: flex-end; }
.chat-row.is-theirs { justify-content: flex-start; }
.chat-bubble {
  max-width: 80%;
  padding: 12px 14px;
  border-radius: 16px;
  font: 500 14px/1.55 var(--font-body);
}
.chat-bubble p { white-space: pre-line; }
.chat-bubble time {
  display: block;
  margin-top: 5px;
  font: 600 10.5px var(--font-body);
  opacity: .65;
}
.chat-bubble.is-mine {
  background: var(--gold);
  border: 1px solid var(--gold);
  color: var(--black);
  border-bottom-right-radius: 6px;
}
.chat-bubble.is-theirs {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-bottom-left-radius: 6px;
}
.chat-bubble.is-mine a { color: var(--black); font-weight: 700; }
.chat-bubble.is-theirs a { color: var(--gold); font-weight: 700; }

.chat-composer {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(14px + 72px + 10px);
  width: min(452px, calc(100% - 28px));
  z-index: 51;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border-radius: var(--r-xl);
  background: rgba(20, 20, 26, .96);
  backdrop-filter: blur(12px);
  border: 1px solid var(--gold-line);
}
.chat-composer__field {
  flex: 1 1 auto;
  width: 0;
  min-width: 120px;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: var(--r-lg);
  background: var(--elevated);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font: 500 15px var(--font-body);
  outline: none;
}
.chat-composer__field::placeholder { color: var(--text-dim); }
.chat-composer__field:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, .18);
}
.chat-composer .btn-icon,
.chat-composer .btn { flex: none; }
.chat-composer .btn-icon { flex: 0 0 48px; }

/* ---- Anexos dentro da bolha ---- */
.chat-image { display: block; margin-top: 6px; border-radius: var(--r-md); overflow: hidden; max-width: 260px; }
.chat-image img { width: 100%; height: auto; display: block; }

.chat-video { margin-top: 6px; border-radius: var(--r-md); max-width: 260px; width: 100%; }

.chat-audio { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.chat-audio audio { height: 40px; max-width: 220px; }
.chat-audio__time { font: 700 12px var(--font-body); opacity: .75; font-variant-numeric: tabular-nums; }

.chat-file {
  display: flex; align-items: center; gap: 10px;
  margin-top: 6px; padding: 10px 12px;
  border-radius: var(--r-md);
  background: rgba(0, 0, 0, .18);
  text-decoration: none; color: inherit;
  max-width: 260px;
}
.chat-file:hover { background: rgba(0, 0, 0, .3); color: inherit; }
.chat-file__icon { flex: none; width: 24px; height: 24px; }
.chat-file__icon svg { width: 100%; height: 100%; }
.chat-file__info { min-width: 0; display: flex; flex-direction: column; }
.chat-file__name {
  font: 700 13px var(--font-body);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chat-file__size { font: 600 11.5px var(--font-body); opacity: .7; }

/* ---- Barra de gravação de voz ---- */
.chat-composer__audio.is-rec { background: var(--danger); color: #FFF; border-color: var(--danger); }

.chat-recorder {
  position: fixed;
  left: 50%; transform: translateX(-50%);
  bottom: calc(14px + 72px + 10px);
  width: min(452px, calc(100% - 28px));
  z-index: 52;
  display: flex; align-items: center; gap: 10px;
  min-height: 68px; padding: 10px 14px;
  border-radius: var(--r-xl);
  background: rgba(20, 20, 26, .98);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 77, 79, .5);
}
.chat-recorder__cancel {
  flex: none; width: 44px; height: 44px;
  border: 0; border-radius: var(--r-md);
  background: transparent; color: var(--text-muted);
  font: 700 18px var(--font-body); cursor: pointer;
}
.chat-recorder__cancel:hover { background: rgba(255, 77, 79, .16); color: var(--danger-soft); }
.chat-recorder__dot {
  flex: none; width: 10px; height: 10px; border-radius: var(--pill);
  background: var(--danger);
  animation: chat-rec-pulse 1s ease-in-out infinite;
}
@keyframes chat-rec-pulse { 50% { opacity: .25; } }
.chat-recorder__time { flex: none; font-size: 16px; color: var(--text); }
.chat-recorder__hint {
  flex: 1; min-width: 0;
  font: 600 12px var(--font-body); color: var(--text-dim);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  .chat-recorder__dot { animation: none; }
}
.chat-composer__audio.is-rec {
  background: var(--danger);
  color: #fff;
  animation: chat-rec .9s ease-in-out infinite alternate;
}
@keyframes chat-rec { to { opacity: .65; } }
.chat-bubble audio { width: 220px; max-width: 100%; margin-top: 6px; height: 36px; }

/* Barra fina do topo do app: marca + sino de notificações */
.app-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.app-topbar__brand {
  font: 700 11px var(--font-body);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* Sino com contador (app escuro e painel claro) */
.bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--r-md);
  color: var(--text-muted);
  flex: none;
}
.bell:hover { color: var(--gold); }
.bell.has-news { color: var(--gold); }
.bell.is-open { color: var(--gold); background: var(--gold-dim); }
.bell-light { color: var(--l-muted); border: 1px solid var(--l-border); background: var(--l-card); }
.bell-light:hover { color: var(--blue); border-color: var(--blue); }
.bell-light.has-news { color: var(--blue); border-color: var(--blue-line); }
.bell-light.is-open { color: var(--blue); border-color: var(--blue); background: var(--blue-dim); }
.bell-light .bell__count { background: var(--blue); color: #FFF; }
.bell__count {
  position: absolute;
  top: 3px;
  right: 2px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: var(--pill);
  background: var(--gold);
  color: var(--black);
  font: 800 10px/17px var(--font-body);
  text-align: center;
}

/* Registros de água do dia (com desfazer) */
.water-log {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  border-radius: var(--r-md);
  background: var(--elevated);
  border: 1px solid var(--border-soft);
}
.water-log-x {
  flex: none; width: 34px; height: 34px;
  border: 0; border-radius: var(--r-sm);
  background: transparent; color: var(--text-dim);
  font: 700 20px/1 var(--font-body); cursor: pointer;
}
.water-log-x:hover { background: rgba(255, 77, 79, .14); color: var(--danger-soft); }

/* Cartões escuros */
.card {
  padding: 18px;
  border-radius: var(--r-2xl);
  background: var(--surface);
  border: 1px solid var(--border);
}
.card-flat { border-color: var(--border-soft); }
.card-lg { padding: 22px; border-radius: var(--r-3xl); }

.card-hero {
  padding: 22px;
  border-radius: var(--r-3xl);
  background: linear-gradient(150deg, var(--blue-deep), var(--blue));
  position: relative;
  overflow: hidden;
}
.card-gold {
  background: linear-gradient(160deg, #241E0C, var(--surface));
  border: 1px solid rgba(212, 175, 55, .4);
}
.card-danger {
  background: rgba(255, 77, 79, .08);
  border: 1px solid rgba(255, 77, 79, .3);
}

.forgot {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 16px;
  border-radius: var(--r-3xl);
  background: linear-gradient(180deg, rgba(255, 176, 32, .14), rgba(11, 11, 15, .2));
  border: 1px solid rgba(255, 176, 32, .34);
  box-shadow: inset 3px 0 0 var(--warning);
}
.forgot__icon {
  width: 44px; height: 44px; flex: none;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-md);
  background: rgba(255, 176, 32, .16);
  color: var(--warning-soft);
}
.forgot__body { flex: 1; min-width: 0; }
.forgot__kicker {
  font: 700 11px var(--font-body);
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--warning-soft);
}
.forgot__name {
  margin-top: 6px;
  font: 700 18px/1.25 var(--font-display);
  color: var(--text);
}
.forgot__meta {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 10px;
}
.forgot__meta span {
  padding: 4px 8px;
  border-radius: var(--pill);
  background: rgba(0, 0, 0, .28);
  font: 700 12px var(--font-body);
  color: var(--text-muted);
}
.forgot__note {
  margin-top: 10px;
  font: 500 13.5px/1.45 var(--font-body);
  color: var(--text-muted);
}
.forgot__actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}
.forgot__actions .btn {
  min-height: 48px;
  width: 100%;
}

/* Estatística */
.stat { padding: 16px; border-radius: var(--r-2xl); background: var(--surface); border: 1px solid var(--border-soft); }
.stat .k {
  font: 700 11px var(--font-body);
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .1em;
}
.stat .v { margin-top: 6px; font: 700 24px var(--font-display); color: var(--text); font-variant-numeric: tabular-nums; }
.stat .v.gold { color: var(--gold); }
.stat .s { font: 600 12px var(--font-body); color: var(--text-muted); }

/* Linha com mídia (exercício, aluno) */
.media-row {
  padding: 14px 16px;
  border-radius: var(--r-2xl);
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  gap: 14px;
  align-items: center;
}
.media-row .thumb {
  width: 52px; height: 52px;
  border-radius: var(--r-lg);
  background: var(--raised);
  flex: none;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  font: 600 9px var(--font-body);
  color: var(--text-faint);
}
.media-row .thumb img { width: 100%; height: 100%; object-fit: cover; }
.media-row .t { font: 700 15px var(--font-body); color: var(--text); }
.media-row .st { font: 600 12px var(--font-body); color: var(--text-muted); }

.avatar {
  width: 52px; height: 52px;
  border-radius: var(--pill);
  background: var(--border);
  color: var(--gold);
  font: 700 17px var(--font-display);
  display: flex; align-items: center; justify-content: center;
  flex: none;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 36px; height: 36px; font-size: 12px; }
.avatar-lg { width: 72px; height: 72px; font-size: 24px; }

/* Marca */
.brand { display: flex; align-items: center; gap: 12px; }
.brand .mark {
  width: 34px; height: 34px;
  border-radius: var(--r-md);
  background: var(--gold);
  display: flex; align-items: center; justify-content: center;
  font: 800 17px var(--font-display);
  color: var(--black);
  flex: none;
}
.brand .word {
  font: 700 12px var(--font-body);
  color: var(--text);
  letter-spacing: .22em;
  text-transform: uppercase;
}

/* ------------------------------------------------------------- Botões */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  cursor: pointer;
  padding: 15px 26px;
  border-radius: var(--r-lg);
  font: 700 15px var(--font-body);
  transition: background .15s, border-color .15s, color .15s;
  text-decoration: none;
}
.btn-primary { background: var(--blue); color: #FFF; box-shadow: var(--shadow-blue); }
.btn-primary:hover { background: var(--blue-hover); color: #FFF; }

.btn-gold { background: var(--gold); color: var(--black); }
.btn-gold:hover { background: var(--gold-hover); color: var(--black); }

.btn-secondary {
  padding: 14px 25px;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-strong);
}
.btn-secondary:hover { border-color: var(--gold); color: var(--gold); }

.btn-ghost { background: transparent; color: var(--text-muted); padding: 15px 20px; }
.btn-ghost:hover { color: var(--text); }

.btn-dark { background: var(--black); color: #FFF; }
.btn-dark:hover { background: #1a1a22; color: #FFF; }

.btn:disabled, .btn.is-disabled {
  background: var(--raised);
  color: var(--text-faint);
  cursor: not-allowed;
  box-shadow: none;
}
.btn-sm { padding: 11px 18px; border-radius: var(--r-md); font-size: 13px; }
.btn-block { width: 100%; }
.btn-lg { padding: 18px; border-radius: var(--r-xl); font-size: 16px; width: 100%; }

.file-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 6px 10px 6px 6px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px dashed var(--gold-line);
  cursor: pointer;
}
.file-btn input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}
.file-btn__action {
  flex: none;
  min-height: 40px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  border-radius: var(--r-md);
  background: var(--gold);
  color: var(--black);
  font: 700 13px var(--font-body);
}
.file-btn:hover { border-color: var(--gold); }
.file-btn:hover .file-btn__action { background: var(--gold-hover); }
.file-btn__name {
  min-width: 0;
  font: 600 13px var(--font-body);
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-btn.is-filled .file-btn__name { color: var(--text); }

.btn-icon {
  width: 48px; height: 48px;
  padding: 0;
  border: 0;
  border-radius: var(--r-xl);
  background: var(--elevated);
  color: var(--gold);
  font: 700 20px/1 var(--font-body);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.btn-icon:hover { background: var(--border); }
.btn-icon svg { width: 22px; height: 22px; display: block; }

/* ------------------------------------------------------------- Campos */
.field { display: block; margin-bottom: 14px; }
.field > .lab {
  display: block;
  font: 700 12px var(--font-body);
  color: var(--text-muted);
  margin-bottom: 7px;
}
.input, .select, .textarea {
  width: 100%;
  padding: 15px 16px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font: 500 15px var(--font-body);
  outline: none;
  transition: border-color .15s, background .15s;
}
.textarea { resize: vertical; min-height: 84px; font-size: 14px; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--blue); background: #171720; }
.input::placeholder, .textarea::placeholder { color: var(--text-faint); }
.input.filled { border-color: var(--gold); font-weight: 700; }
.input.error { border-color: var(--danger); }
.field .err { margin-top: 6px; font: 600 12px var(--font-body); color: var(--danger-soft); }
.field .hint { margin-top: 6px; font: 500 12px var(--font-body); color: var(--text-dim); }

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%239A9AA8' d='M6 8 0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

/* -------------------------------------------------- Chips, tabs, badges */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 8px 15px;
  border-radius: var(--pill);
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font: 700 13px var(--font-body);
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.chip:hover { border-color: var(--gold); color: var(--gold-light); }
.chip.active { background: var(--gold); border-color: var(--gold); color: var(--black); padding: 9px 16px; }

.segment {
  display: flex;
  gap: 6px;
  padding: 5px;
  border-radius: var(--r-lg);
  background: var(--surface);
}
.segment a, .segment button {
  flex: 1;
  text-align: center;
  padding: 10px;
  border-radius: 9px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font: 700 13px var(--font-body);
  cursor: pointer;
  text-decoration: none;
}
.segment .active { background: var(--blue); color: #FFF; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: var(--r-sm);
  font: 700 12px var(--font-body);
}
.badge .dot { width: 7px; height: 7px; border-radius: var(--pill); }
.badge-success { background: rgba(46, 209, 124, .14); color: var(--success-soft); }
.badge-success .dot { background: var(--success); }
.badge-warning { background: rgba(255, 176, 32, .14); color: var(--warning-soft); }
.badge-warning .dot { background: var(--warning); }
.badge-danger  { background: rgba(255, 77, 79, .14); color: var(--danger-soft); }
.badge-danger .dot { background: var(--danger); }
.badge-info    { background: var(--blue-dim); color: var(--blue-light); }
.badge-info .dot { background: var(--blue); }
.badge-gold    { background: rgba(212, 175, 55, .16); color: var(--gold-light); }
.badge-gold .dot { background: var(--gold); }
.badge-neutral { background: var(--raised); color: var(--text-muted); }

.pill-gold {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 8px 9px;
  border-radius: var(--pill);
  background: var(--gold-dim);
  border: 1px solid var(--gold-line);
  font: 700 13px var(--font-body);
  color: var(--gold-light);
}
.pill-gold .n {
  width: 22px; height: 22px;
  border-radius: var(--pill);
  background: var(--gold);
  color: var(--black);
  font: 800 12px var(--font-body);
  display: flex; align-items: center; justify-content: center;
}

.tag {
  padding: 7px 13px;
  border-radius: 9px;
  background: var(--elevated);
  font: 700 12px var(--font-body);
  color: var(--text);
}
.tag-gold { background: rgba(212, 175, 55, .16); color: var(--gold-light); }

/* ------------------------------------------------------------ Progresso */
.bar { height: 10px; border-radius: var(--pill); background: var(--raised); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: var(--pill); }
.bar-blue > i { background: linear-gradient(90deg, var(--blue), var(--blue-light)); }
.bar-gold > i { background: linear-gradient(90deg, var(--gold), var(--gold-light)); }
.bar-thin { height: 6px; }
.bar-thin > i { background: var(--gold); transition: width .3s; }

.bar-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}
.bar-head .t { font: 700 13px var(--font-body); color: var(--text); }
.bar-head .v { font: 700 13px var(--font-display); color: var(--gold); font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------- Utilidades */
.row { display: flex; gap: 12px; }
.row-tight { display: flex; gap: 8px; }
.col { display: flex; flex-direction: column; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.center { display: flex; align-items: center; gap: 10px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.none { flex: none; }
.stack > * + * { margin-top: 12px; }
.stack-sm > * + * { margin-top: 8px; }
.records-scroll {
  max-height: 360px;
  overflow-y: auto;
  padding-right: 8px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.stack-lg > * + * { margin-top: 16px; }
.grid { display: grid; gap: 12px; }
.g2 { grid-template-columns: 1fr 1fr; }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
.mt-0 { margin-top: 0 } .mt-1 { margin-top: 8px } .mt-2 { margin-top: 16px } .mt-3 { margin-top: 24px } .mt-4 { margin-top: 32px }
.mb-1 { margin-bottom: 8px } .mb-2 { margin-bottom: 16px } .mb-3 { margin-bottom: 24px }
.tc { text-align: center } .tr { text-align: right }
.hide { display: none !important; }
.divider { height: 1px; background: var(--border-soft); margin: 16px 0; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.section-title h2 { font: 700 16px var(--font-body); color: var(--text); }
.link-more { font: 700 13px var(--font-body); color: var(--gold); cursor: pointer; }

.empty {
  padding: 34px 20px;
  text-align: center;
  border-radius: var(--r-2xl);
  border: 1px dashed var(--border);
  color: var(--text-dim);
  font: 500 14px var(--font-body);
}

.flash {
  padding: 13px 16px;
  border-radius: var(--r-lg);
  font: 600 13.5px var(--font-body);
  margin-bottom: 16px;
}
.flash-success { background: rgba(46, 209, 124, .12); border: 1px solid rgba(46, 209, 124, .3); color: var(--success-soft); }
.flash-error   { background: rgba(255, 77, 79, .1); border: 1px solid rgba(255, 77, 79, .3); color: var(--danger-soft); }

/* =========================================================================
   PAINEL DO PROFESSOR — base branca com barra lateral preta
   ========================================================================= */
.panel {
  display: flex;
  min-height: 100vh;
  background: var(--l-bg);
  color: var(--l-text);
}

/* --------------------------------------------------------- Barra lateral */
.sidebar-toggle { position: absolute; opacity: 0; pointer-events: none; }

.sidebar {
  width: 244px;
  flex: none;
  background: var(--black);
  border-right: 1px solid #1A1A22;
  padding: 20px 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.sidebar__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 6px; }
.sidebar__close { display: none; }

/* Grupos com rotulo discreto, para a lista nao virar uma pilha unica */
.sidebar__nav { display: flex; flex-direction: column; gap: 20px; }
.sidebar__group { display: flex; flex-direction: column; gap: 2px; }
.sidebar__group-title {
  padding: 0 12px 6px;
  font: 700 10px var(--font-body);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #4A4A57;
}

.sidebar__link {
  position: relative;
  display: flex; align-items: center; gap: 11px;
  width: 100%;
  padding: 10px 12px;
  border: 0; border-radius: var(--r-md);
  background: transparent;
  color: var(--text-muted);
  font: 600 13.5px var(--font-body);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.sidebar__link:hover { background: #16161D; color: var(--text); }
.sidebar__link:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }

.sidebar__icon { flex: none; width: 20px; height: 20px; display: flex; }
.sidebar__icon svg { width: 100%; height: 100%; }
.sidebar__label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Ativo: fundo suave + marca dourada na borda, em vez do azul chapado */
.sidebar__link.is-active {
  background: #16161D;
  color: #FFF;
  font-weight: 700;
}
.sidebar__link.is-active::before {
  content: '';
  position: absolute; left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 20px;
  border-radius: 0 3px 3px 0;
  background: var(--gold);
}
.sidebar__link.is-active .sidebar__icon { color: var(--gold); }

.sidebar__foot { margin-top: auto; display: flex; flex-direction: column; gap: 4px; padding-top: 14px; border-top: 1px solid #1A1A22; }
.sidebar__user { display: flex; align-items: center; gap: 10px; padding: 8px 12px 12px; }
.sidebar__user .avatar { background: #1E1E28; color: var(--gold); }
.sidebar__user-info { min-width: 0; display: flex; flex-direction: column; }
.sidebar__user-name {
  font: 700 13px var(--font-body); color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sidebar__user-role { font: 600 11.5px var(--font-body); color: var(--text-dim); }
.sidebar__link--exit { color: var(--text-dim); }
.sidebar__link--exit:hover { background: rgba(255, 77, 79, .1); color: var(--danger-soft); }

.sidebar__scrim { display: none; }

.panel-main { flex: 1; min-width: 0; }

/* ------------------------------------------------------------ Barra de topo */
.topbar {
  position: sticky; top: 0; z-index: 30;
  padding: 18px 32px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--l-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.topbar__title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar__menu { display: none; }
.topbar__actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.topbar h1 {
  font: 800 24px var(--font-display); color: var(--l-text); letter-spacing: -.02em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.topbar .sub { margin-top: 2px; font: 500 13px var(--font-body); color: var(--l-muted); }

/* Conteudo com largura maxima: em tela larga o texto nao fica atravessando
   o monitor inteiro, que e o que faz um painel parecer amador. */
.panel-body {
  padding: 24px 32px 56px;
  display: flex; flex-direction: column; gap: 20px;
  width: 100%;
  max-width: 1520px;
  margin: 0 auto;
}

/* Cartões claros */
.lcard {
  padding: 20px;
  border-radius: var(--r-2xl);
  background: var(--l-card);
  border: 1px solid var(--l-border);
}
.lcard-dark { background: var(--black); border-color: var(--black); color: #FFF; }
.lcard h2 { font: 700 16px var(--font-body); color: var(--l-text); }
.lcard-dark h2 { color: #FFF; }

.lstat { padding: 18px; border-radius: var(--r-xl); background: var(--l-card); border: 1px solid var(--l-border); }
.lstat .k { font: 700 11px var(--font-body); color: var(--l-dim); text-transform: uppercase; letter-spacing: .12em; }
.lstat .v { margin-top: 8px; font: 700 30px var(--font-display); color: var(--l-text); font-variant-numeric: tabular-nums; }
.lstat .s { margin-top: 3px; font: 600 12.5px var(--font-body); color: var(--l-muted); }
.lstat.is-dark { background: var(--black); border-color: var(--black); }
.lstat.is-dark .k { color: var(--gold); }
.lstat.is-dark .v { color: #FFF; }
.lstat.is-dark .s { color: var(--text-muted); }
.lstat .v.blue { color: var(--blue); }

/* Campos claros */
.linput, .lselect, .ltextarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--l-border-input);
  background: var(--l-bg);
  font: 500 13.5px var(--font-body);
  color: var(--l-text);
  outline: none;
  transition: border-color .15s, background .15s;
}
.ltextarea { resize: vertical; min-height: 80px; }
.linput:focus, .lselect:focus, .ltextarea:focus { border-color: var(--blue); background: var(--l-card); }
.linput::placeholder { color: var(--l-dim); }
.lfield { display: block; margin-bottom: 14px; }
.lfield > .lab { display: block; font: 700 12px var(--font-body); color: var(--l-muted); margin-bottom: 6px; }
.lfield .err { margin-top: 5px; font: 600 12px var(--font-body); color: var(--danger-strong); }
.lselect {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%238A8A99' d='M6 8 0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

/* Linha de alerta / lista clara */
.lrow {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--r-lg);
  background: var(--l-bg);
  text-decoration: none;
  color: inherit;
  transition: background .15s;
}
.lrow:hover { background: #EFEDE7; color: inherit; }
.lrow .n { font: 700 14px var(--font-body); color: var(--l-text); }
.lrow .m { font: 600 12.5px var(--font-body); color: var(--l-muted); }
.lrow .avatar { background: var(--black); color: var(--gold); }

.ltag { padding: 5px 11px; border-radius: var(--r-sm); font: 700 11.5px var(--font-body); display: inline-block; }
.ltag-danger  { background: rgba(255, 77, 79, .12); color: var(--danger-strong); }
.ltag-warning { background: rgba(255, 176, 32, .16); color: #9A6A00; }
.ltag-success { background: rgba(46, 209, 124, .14); color: #0E8449; }
.ltag-info    { background: var(--blue-dim); color: var(--blue-hover); }
.ltag-gold    { background: rgba(212, 175, 55, .18); color: #8A6D12; }
.ltag-neutral { background: #EDEAE3; color: var(--l-muted); }

/* Aviso do autosave (montador de treino) */
.autosave-status {
  font: 700 12px var(--font-body);
  color: var(--l-muted);
  min-height: 16px;
}
.autosave-status.is-dirty  { color: #9A6A00; }
.autosave-status.is-saving { color: var(--l-muted); }
.autosave-status.is-saved  { color: #0E8449; }
.autosave-status.is-error  { color: var(--danger-strong); }

/* Tabela clara */
.ltable { width: 100%; border-collapse: collapse; }
.ltable th {
  text-align: left;
  padding: 10px 12px;
  font: 700 11px var(--font-body);
  color: var(--l-dim);
  text-transform: uppercase;
  letter-spacing: .1em;
  border-bottom: 1px solid var(--l-border);
  white-space: nowrap;
}
.ltable td { padding: 13px 12px; border-bottom: 1px solid var(--l-border); font: 500 13.5px var(--font-body); color: var(--l-text); }
.ltable tr:last-child td { border-bottom: 0; }
.ltable tbody tr:hover { background: var(--l-bg); }
.ltable .strong { font-weight: 700; }
.table-wrap { overflow-x: auto; }

/* Abas do painel */
.wtabs {
  display: flex; flex-wrap: wrap; gap: 8px;
  flex: 1; min-width: 0;
}
.wtab {
  display: flex; align-items: stretch;
  background: var(--l-card);
  border: 1px solid var(--l-border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.wtab.is-on { border-color: var(--blue); background: var(--blue-dim); }
.wtab.is-dragging { opacity: .45; }
.wtab__grip {
  display: flex; align-items: center; justify-content: center;
  width: 28px; cursor: grab; color: var(--l-dim);
  background: rgba(11, 11, 15, .04);
}
.wtab__grip:active { cursor: grabbing; }
.wtab__grip svg { fill: currentColor; }
.wtab a {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px 8px 8px;
  text-decoration: none; color: inherit;
  min-height: 44px;
}
.wtab__letter {
  width: 24px; height: 24px; flex: none;
  display: flex; align-items: center; justify-content: center;
  border-radius: 7px;
  background: var(--l-bg);
  font: 800 12px var(--font-display); color: var(--l-muted);
}
.wtab.is-on .wtab__letter { background: var(--blue); color: #FFF; }
.wtab__name { font: 700 13.5px var(--font-body); color: var(--l-text); }
.wtab__n {
  font: 700 11px var(--font-body); color: var(--l-dim);
  background: var(--l-bg); border-radius: var(--pill);
  padding: 2px 7px;
}

.we-card {
  display: grid;
  grid-template-columns: 28px 56px 1fr;
  gap: 12px;
  padding: 12px;
  border-radius: var(--r-xl);
  background: var(--l-card);
  border: 1px solid var(--l-border);
  box-shadow: 0 1px 0 rgba(11, 11, 15, .03);
}
.we-card.is-dragging { opacity: .4; }
.we-card__grip {
  display: flex; align-items: center; justify-content: center;
  align-self: stretch; cursor: grab; color: var(--l-dim);
  border-radius: var(--r-sm);
}
.we-card__grip:hover { background: var(--l-bg); color: var(--l-text); }
.we-card__grip:active { cursor: grabbing; }
.we-card__grip svg { fill: currentColor; }
.we-card__media {
  width: 56px; height: 56px; border-radius: var(--r-md);
  overflow: hidden; background: var(--l-bg);
  border: 1px solid var(--l-border); flex: none;
}
.we-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.we-card__body { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.we-card__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.we-card__title { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.we-card__n { font: 800 11px var(--font-display); color: var(--blue); letter-spacing: .06em; }
.we-card__title strong { font: 700 15px var(--font-body); color: var(--l-text); }
.we-card__remove {
  font: 700 12px var(--font-body); color: var(--danger-strong);
  text-decoration: none; padding: 6px 8px;
}
.we-card .lfield { margin: 0; }
.we-card .linput, .we-card .lselect { padding: 8px 10px; }
.we-card .lselect { padding-right: 26px; }
.we-card__row {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
}
.we-card__row--wide { grid-template-columns: 1.2fr 1.2fr .7fr 1.4fr; }
.we-card__prog-inputs { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
@media (max-width: 900px) {
  .we-card { grid-template-columns: 24px 48px 1fr; }
  .we-card__row, .we-card__row--wide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.ltabs { display: flex; gap: 4px; border-bottom: 1px solid var(--l-border); overflow-x: auto; }
.ltabs a {
  padding: 12px 16px;
  font: 700 13.5px var(--font-body);
  color: var(--l-muted);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  text-decoration: none;
}
.ltabs a:hover { color: var(--l-text); }
.ltabs a.active { color: var(--blue); border-bottom-color: var(--blue); }

/* Seletor de dias da semana — o estado vem do :checked, sem JavaScript */
.weekday { cursor: pointer; user-select: none; }
.weekday input { position: absolute; opacity: 0; width: 0; height: 0; }
.weekday span {
  display: inline-flex;
  width: 32px; height: 38px;
  align-items: center; justify-content: center;
  border-radius: var(--r-sm);
  font: 700 12px var(--font-body);
  background: var(--l-bg);
  color: var(--l-muted);
  transition: background .15s, color .15s;
}
.weekday:hover span { background: #E9E6DF; }
.weekday input:checked + span { background: var(--blue); color: #FFF; }
.weekday input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }

/* Agenda */
.agenda-item { display: flex; gap: 14px; align-items: center; }
.agenda-item .h { font: 700 13px var(--font-display); color: var(--l-dim); width: 44px; flex: none; font-variant-numeric: tabular-nums; }
.agenda-item .b { flex: 1; padding: 11px 14px; border-radius: var(--r-md); background: var(--l-bg); border-left: 3px solid var(--l-border-input); }
.agenda-item .b.blue { background: var(--blue-dim); border-left-color: var(--blue); }
.agenda-item .b.gold { background: rgba(212, 175, 55, .14); border-left-color: var(--gold); }
.agenda-item .b .t { font: 700 13.5px var(--font-body); color: var(--l-text); }
.agenda-item .b .s { font: 600 12px var(--font-body); color: var(--l-muted); }

/* Gráfico de barras simples */
.chart { display: flex; align-items: flex-end; gap: 8px; height: 110px; }
.chart .col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; height: 100%; }
.chart .bar-v { width: 100%; border-radius: 6px 6px 0 0; background: var(--blue); min-height: 4px; }
.chart .bar-v.gold { background: var(--gold); }
.chart .cap { font: 600 10.5px var(--font-body); color: var(--l-dim); }

.lempty {
  padding: 30px 18px;
  text-align: center;
  border-radius: var(--r-lg);
  border: 1px dashed var(--l-border-input);
  color: var(--l-muted);
  font: 500 13.5px var(--font-body);
}

.lflash { padding: 13px 16px; border-radius: var(--r-md); font: 600 13.5px var(--font-body); }
.lflash-success { background: rgba(46, 209, 124, .12); border: 1px solid rgba(46, 209, 124, .35); color: #0E8449; }
.lflash-error   { background: rgba(255, 77, 79, .1); border: 1px solid rgba(255, 77, 79, .35); color: var(--danger-strong); }

.pagination { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.pagination a, .pagination span {
  padding: 8px 12px;
  border-radius: var(--r-sm);
  font: 700 13px var(--font-body);
  background: var(--l-card);
  border: 1px solid var(--l-border);
  color: var(--l-text);
  text-decoration: none;
}
.pagination .active span, .pagination a.active { background: var(--blue); border-color: var(--blue); color: #FFF; }
.pagination .disabled span { opacity: .45; }
.pagination svg { width: 14px; height: 14px; }

/* Modal simples */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(11, 11, 15, .6);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  z-index: 100;
}
.modal {
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  overflow-y: auto;
  border-radius: var(--r-3xl);
  background: var(--l-card);
  padding: 24px;
}
.modal h2 { font: 700 20px var(--font-display); margin-bottom: 4px; }
.modal .sub { font: 500 13.5px var(--font-body); color: var(--l-muted); margin-bottom: 18px; }
.modal-dark { background: var(--surface); border: 1px solid var(--border); color: var(--text); }

/* =========================================================================
   MODO ACADEMIA — execucao do treino
   Um exercicio por vez, alvos de toque grandes, descanso em tela cheia.
   ========================================================================= */
body.gym .app-shell { padding: 0 0 148px; max-width: 520px; }

.gym-head {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  background: rgba(11, 11, 15, .96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-soft);
}
.gym-head-mid { flex: 1; min-width: 0; text-align: center; }
.gym-head-title {
  font: 700 15px var(--font-body); color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gym-head-sub { font: 600 12px var(--font-body); color: var(--text-dim); }

.gym-icon {
  width: 48px; height: 48px; flex: none;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); font: 700 15px var(--font-body);
  cursor: pointer; text-decoration: none;
}
.gym-icon:active { background: var(--elevated); }

.gym-clock {
  flex: none; padding: 0 12px; height: 48px;
  display: flex; align-items: center;
  border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--border);
  font-size: 15px; color: var(--text);
}
.gym-clock.is-paused { color: var(--warning-soft); border-color: rgba(255, 176, 32, .4); }

.gym-progress { height: 4px; background: var(--elevated); }
.gym-progress > i { display: block; height: 100%; background: var(--gold); transition: width .3s; }

.gym-stage { padding: 18px 16px 0; }

.gym-media {
  height: 260px;
  border-radius: var(--r-3xl);
  background: var(--elevated);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.gym-media img { height: 100%; width: auto; object-fit: contain; }

.gym-name {
  margin-top: 18px;
  font: 800 27px/1.15 var(--font-display);
  color: var(--text); letter-spacing: -.02em;
}
.gym-prescription {
  margin-top: 8px;
  font: 700 17px var(--font-body);
  color: var(--gold);
}

.gym-load-hint {
  margin-top: 14px; padding: 14px 16px;
  border-radius: var(--r-2xl);
  background: rgba(46, 107, 255, .12);
  border: 1px solid var(--blue-line);
}
.gym-load-main { display: block; font: 700 17px var(--font-body); color: #FFF; }
.gym-load-last { display: block; margin-top: 3px; font: 600 13px var(--font-body); color: var(--blue-light); }

/* Explicacoes em linguagem clara (RIR, cadencia, tecnica) */
/* Agora sao selos curtos, entao ficam em linha e quebram sozinhos. */
.gym-cues {
  margin-top: 14px;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
}
.gym-cues > .gym-badge,
.gym-cues > .gym-cue {
  flex: 0 0 auto;
  width: auto;
}
.gym-cue {
  padding: 14px 16px;
  border-radius: var(--r-2xl);
  background: var(--surface);
  border: 1px solid var(--border);
}
.gym-cue-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.gym-cue-title {
  font: 700 11px var(--font-body); color: var(--text-dim);
  letter-spacing: .14em; text-transform: uppercase;
}
.gym-cue-tag {
  flex: none; padding: 4px 10px; border-radius: var(--pill);
  background: var(--elevated); color: var(--text-muted);
  font: 700 11.5px var(--font-body);
}
.gym-cue-text { font: 600 15px/1.45 var(--font-body); color: var(--text); }
.gym-cue-help { margin-top: 6px; font: 500 12.5px/1.5 var(--font-body); color: var(--text-dim); }
.gym-cue-note { background: rgba(212, 175, 55, .1); border-color: var(--gold-line); }
.gym-cue-note .gym-cue-title { color: var(--gold); }

.gym-section {
  margin: 24px 0 10px;
  font: 700 11px var(--font-body); color: var(--gold);
  letter-spacing: .18em; text-transform: uppercase;
}

/* Bi-set / tri-set: os exercícios do grupo ficam na mesma etapa */
.gym-group-banner {
  display: flex; align-items: flex-start; gap: 10px;
  margin-bottom: 16px; padding: 12px 14px;
  border-radius: var(--r-lg);
  background: var(--gold-dim);
  border: 1px solid var(--gold-line);
}
.gym-group-tag {
  flex: none; padding: 4px 10px; border-radius: var(--pill);
  background: var(--gold); color: var(--black);
  font: 800 11px var(--font-body); letter-spacing: .04em;
}
.gym-group-text { font: 600 13px/1.45 var(--font-body); color: var(--gold-light); }

.gym-part + .gym-part { margin-top: 18px; }
.gym-part.is-grouped {
  position: relative;
  padding: 14px 14px 4px;
  border-radius: var(--r-2xl);
  background: var(--surface);
  border: 1px solid var(--border-soft);
}
.gym-part.is-grouped .gym-media { height: 150px; }
.gym-part.is-grouped .gym-name { font-size: 19px; }
.gym-part-letter {
  position: absolute; top: 10px; left: 10px; z-index: 1;
  width: 26px; height: 26px; border-radius: var(--pill);
  display: flex; align-items: center; justify-content: center;
  background: var(--gold); color: var(--black);
  font: 800 13px var(--font-display);
}

/* Rodada de um grupo: as séries dos exercícios ficam juntas */
.gym-round { display: flex; flex-direction: column; gap: 10px; }
.gym-round.is-grouped {
  padding: 10px;
  border-radius: var(--r-2xl);
  border: 1px dashed var(--gold-line);
}
.gym-round-head {
  font: 800 11px var(--font-body); color: var(--gold);
  letter-spacing: .16em; text-transform: uppercase;
  margin-bottom: 2px;
}

/* Séries — uma linha grande por série */
.gym-sets { display: flex; flex-direction: column; gap: 10px; }
.gym-set {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 12px;
  border-radius: var(--r-2xl);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: background .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.gym-set-name {
  flex-basis: 100%;
  font: 700 12.5px var(--font-body); color: var(--text-muted);
  order: -1; padding-left: 2px;
}

/* Feedback rápido por série: "foi fácil / no ponto / peguei pesado" */
.gym-feedback {
  flex-basis: 100%;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding-top: 4px;
}
.gym-feedback-q {
  font: 700 11px var(--font-body); color: var(--text-dim);
  letter-spacing: .1em; text-transform: uppercase;
}
.gym-feedback-btn {
  flex: 1; min-width: 88px; min-height: 40px;
  padding: 8px 10px;
  border-radius: var(--r-md);
  background: var(--elevated);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font: 700 12.5px var(--font-body);
  cursor: pointer;
}
.gym-feedback-btn:active { background: var(--raised); }
.gym-feedback-btn.is-on {
  background: var(--gold-dim); border-color: var(--gold); color: var(--gold-light);
}

.gym-list-tag {
  display: inline-block; margin-left: 6px; padding: 2px 7px;
  border-radius: var(--pill);
  background: var(--gold-dim); color: var(--gold-light);
  font: 800 10px var(--font-body);
}

/* Texto só para leitor de tela (acessibilidade das escalas de carinha) */
.so-leitor {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}
.gym-set.is-done {
  background: linear-gradient(180deg, rgba(46, 209, 124, .16), rgba(46, 209, 124, .06));
  border-color: rgba(46, 209, 124, .42);
  box-shadow: inset 3px 0 0 var(--success);
  padding-left: 14px;
}

.gym-set-n {
  width: 40px; height: 48px; flex: none;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-md);
  background: var(--elevated);
  font: 800 16px var(--font-display); color: var(--text-dim);
}
.gym-set.is-done .gym-set-n {
  background: var(--success);
  color: var(--black);
  box-shadow: 0 0 0 3px rgba(46, 209, 124, .22);
}

.gym-input { flex: 1; min-width: 0; position: relative; }
.gym-input > span {
  position: absolute; top: 5px; left: 12px;
  font: 700 9.5px var(--font-body); color: var(--text-dim);
  letter-spacing: .1em; text-transform: uppercase;
  pointer-events: none;
}
.gym-input > input {
  width: 100%; height: 48px;
  padding: 16px 10px 4px;
  border-radius: var(--r-md);
  background: rgba(0, 0, 0, .38);
  border: 1px solid transparent;
  color: #FFF; outline: none;
  font: 700 17px var(--font-display); font-variant-numeric: tabular-nums;
  text-align: center;
  appearance: textfield;
  -moz-appearance: textfield;
}
.gym-input > input::-webkit-outer-spin-button,
.gym-input > input::-webkit-inner-spin-button {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
}
.gym-input > input:focus {
  border-color: var(--gold);
  background: rgba(0, 0, 0, .55);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, .16);
}

.gym-done {
  flex: none; height: 48px; min-width: 84px; padding: 0 16px;
  border: 0; border-radius: var(--r-md);
  background: var(--blue); color: #FFF;
  font: 700 14px var(--font-body); cursor: pointer;
}
.gym-done:active { background: var(--blue-hover); }
.gym-set.is-done .gym-input > span { color: var(--success-soft); }
.gym-set.is-done .gym-input > input {
  background: rgba(46, 209, 124, .10);
  border-color: rgba(46, 209, 124, .28);
  color: #E8FFF2;
}
.gym-set.is-done .gym-input > input:focus {
  border-color: var(--success);
  box-shadow: 0 0 0 3px rgba(46, 209, 124, .18);
}

.gym-set.is-done .gym-done {
  background: transparent;
  border: 1px solid rgba(46, 209, 124, .45);
  color: var(--success-soft);
}
.gym-set.is-done .gym-done:active {
  background: rgba(46, 209, 124, .16);
}

.gym-set.is-done .gym-feedback {
  padding-top: 2px;
  gap: 6px;
}
.gym-set.is-done .gym-feedback-q { display: none; }
.gym-set.is-done .gym-feedback-btn {
  min-height: 40px;
  min-width: 0;
  padding: 6px 8px;
  font-size: 12px;
  background: rgba(0, 0, 0, .22);
}
.gym-set.is-done .gym-feedback-btn:not(.is-on) { color: var(--text-dim); }
.gym-set.is-done .gym-feedback-btn.is-on {
  background: rgba(46, 209, 124, .18);
  border-color: var(--success);
  color: var(--success-soft);
}

/* Rodapé fixo */
.gym-foot {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 0;
  width: min(520px, 100%);
  padding: 10px 16px calc(14px + env(safe-area-inset-bottom));
  background: rgba(11, 11, 15, .97);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-soft);
  z-index: 45;
}
.gym-foot-info {
  display: flex; align-items: center; justify-content: space-between;
  font: 700 13px var(--font-body); color: var(--text-muted);
  margin-bottom: 8px;
}
.gym-link { background: none; border: 0; cursor: pointer; font: 700 13px var(--font-body); color: var(--gold); }
.gym-foot-btns { display: flex; gap: 10px; }
.gym-nav {
  flex: 1; height: 54px;
  border-radius: var(--r-xl);
  background: var(--surface); border: 1px solid var(--border-strong);
  color: var(--text); font: 700 15px var(--font-body); cursor: pointer;
}
.gym-nav:disabled { opacity: .4; cursor: not-allowed; }
.gym-nav-main { flex: 1.6; background: var(--gold); border-color: var(--gold); color: var(--black); }
.gym-nav-main.is-finish { background: var(--success); border-color: var(--success); }

/* Descanso em tela cheia */
.gym-rest {
  position: fixed; inset: 0; z-index: 90;
  background: linear-gradient(160deg, var(--blue-deep), #060610 70%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px;
}
.gym-rest-label {
  font: 700 13px var(--font-body); color: var(--gold);
  letter-spacing: .28em; text-transform: uppercase;
}
.gym-rest-time {
  margin-top: 10px;
  font-size: clamp(84px, 30vw, 132px);
  line-height: 1; color: #FFF;
}
.gym-rest.is-ending .gym-rest-time { color: var(--gold); animation: gym-pulse .5s ease-in-out infinite alternate; }
@keyframes gym-pulse { to { transform: scale(1.06); } }

.gym-rest-next {
  margin-top: 14px; text-align: center;
  font: 600 16px/1.5 var(--font-body); color: rgba(255, 255, 255, .8);
  max-width: 320px;
}
.gym-rest-btns { margin-top: 40px; display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.gym-rest-btn {
  min-width: 104px; height: 56px; padding: 0 20px;
  border-radius: var(--r-xl);
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .34);
  color: #FFF; font: 700 15px var(--font-body); cursor: pointer;
}
.gym-rest-btn:active { background: rgba(255, 255, 255, .24); }
.gym-rest-skip { background: var(--gold); border-color: var(--gold); color: var(--black); }

/* Pausado */
.gym-paused {
  position: fixed; inset: 0; z-index: 95;
  background: rgba(11, 11, 15, .97);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 24px;
}
.gym-paused-msg {
  margin-bottom: 10px; text-align: center;
  font: 500 15px/1.5 var(--font-body); color: var(--text-muted);
  max-width: 300px;
}

/* Lista do treino */
.gym-list-row {
  width: 100%; display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: var(--r-lg);
  background: var(--elevated); border: 1px solid var(--border);
  color: var(--text); cursor: pointer; text-align: left;
}
.gym-list-n { font: 700 12px var(--font-display); color: var(--text-dim); flex: none; }
.gym-list-name { display: block; font: 700 14px var(--font-body); color: var(--text); }
.gym-list-sub { display: block; font: 600 12px var(--font-body); color: var(--text-muted); }
.gym-list-badge {
  flex: none; padding: 5px 10px; border-radius: var(--pill);
  background: var(--raised); color: var(--text-muted);
  font: 700 12px var(--font-body);
}
.gym-list-badge.is-done { background: rgba(46, 209, 124, .18); color: var(--success-soft); }

/* Concluir */
/* =========================================================================
   GLOSSARIO DOS SELOS — badge curto, explicacao sob demanda
   Desktop: hover / foco no teclado. Celular: toque no "?".
   O balao NAO usa o atributo hidden: a regra global [hidden]{display:none!important}
   venceria o :hover. Aqui o estado e visibility + opacity.
   ========================================================================= */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.gym-badge { position: relative; display: inline-flex; }

/* O selo vira botao, mas mantem a aparencia de etiqueta */
.gym-badge .gym-cue-tag {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 6px 10px 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--pill);
  background: var(--elevated);
  color: var(--text-muted);
  font: 700 12.5px var(--font-body);
  cursor: help;
}
.gym-badge .gym-cue-tag:hover { border-color: var(--gold-line); color: var(--gold-light); }
.gym-badge .gym-cue-tag:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.gym-badge .gym-cue-tag[aria-expanded="true"] { border-color: var(--gold); color: var(--gold-light); }

/* O "?" so existe no celular; no desktop o hover basta */
.gym-tip-q {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; flex: none;
  border-radius: var(--pill);
  background: var(--gold-dim);
  color: var(--gold-light);
  font: 800 11px var(--font-body);
}

.gym-tip {
  display: none;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  padding: 20px 20px 16px;
  border-radius: var(--r-3xl);
  background: #171720;
  border: 1px solid var(--gold-line);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .55);
}

/* Clique abre modal no centro — nao empurra a pagina pra baixo */
.gym-tip.is-open {
  display: flex;
  position: fixed;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%);
  z-index: 140;
  width: min(360px, calc(100vw - 32px));
  max-width: min(360px, calc(100vw - 32px));
  animation: gym-tip-in .18s ease both;
}

body.gym-tip-on::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 135;
  background: rgba(11, 11, 15, .72);
  backdrop-filter: blur(5px);
}
.gym-tip__title {
  font: 700 11px var(--font-body); color: var(--gold);
  letter-spacing: .14em; text-transform: uppercase;
}
.gym-tip__text { font: 600 14px/1.45 var(--font-body); color: var(--text); }
.gym-tip-help { font: 500 12.5px/1.5 var(--font-body); color: var(--text-dim); }
.gym-tip-detail {
  margin-top: 2px; padding-top: 8px;
  border-top: 1px solid var(--border-soft);
  font: 600 13px/1.45 var(--font-body); color: var(--gold-light);
}
.gym-tip-ok {
  display: block;
  width: 100%;
  margin-top: 8px;
  min-height: 48px;
  border: 0;
  border-radius: var(--r-lg);
  background: var(--gold);
  color: var(--black);
  font: 700 15px var(--font-body);
  cursor: pointer;
}

@keyframes gym-tip-in {
  from { opacity: 0; transform: translate(-50%, -46%); }
  to { opacity: 1; transform: translate(-50%, -50%); }
}

@media (prefers-reduced-motion: reduce) {
  .gym-tip.is-open { animation: none; }
}

/* Camada mais alta do modo academia: precisa cobrir descanso (90),
   pausa (95) e a lista do treino, que e um .modal-backdrop (100). */
.gym-finish {
  position: fixed; inset: 0; z-index: 120;
  background: var(--black); overflow-y: auto;
}
.gym-finish-inner { max-width: 480px; margin: 0 auto; padding: 40px 20px calc(40px + env(safe-area-inset-bottom)); }

.gym-mood { display: flex; gap: 8px; }
.gym-mood label { flex: 1; cursor: pointer; }
.gym-mood input { position: absolute; opacity: 0; width: 0; height: 0; }
.gym-mood span {
  display: flex; align-items: center; justify-content: center;
  height: 60px; border-radius: var(--r-lg);
  background: var(--elevated); border: 1px solid var(--border);
  font-size: 24px;
}
.gym-mood input:checked + span { background: rgba(212, 175, 55, .18); border-color: var(--gold); }

/* Selo de recorde e aviso de fila offline (criados pelo JS) */
.gym-pr {
  width: 100%; margin-top: 8px;
  padding: 8px 12px; border-radius: var(--r-md);
  background: rgba(212, 175, 55, .18);
  color: var(--gold-light);
  font: 700 13px var(--font-body); text-align: center;
}
.gym-offline {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 132px;
  z-index: 46; padding: 9px 16px; border-radius: var(--pill);
  background: rgba(255, 176, 32, .16);
  border: 1px solid rgba(255, 176, 32, .4);
  color: var(--warning-soft);
  font: 700 12.5px var(--font-body);
}
.gym-nav-main.is-ready { animation: gym-ready .6s ease-in-out 3; }
@keyframes gym-ready { 50% { transform: scale(1.04); box-shadow: 0 0 0 6px rgba(212, 175, 55, .25); } }

@media (max-width: 380px) {
  .gym-media { height: 210px; }
  .gym-name { font-size: 23px; }
  .gym-done { min-width: 70px; padding: 0 10px; font-size: 13px; }
}

/* ------------------------------------------------- Responsivo do painel */

/* Notebook: barra lateral so com icones, para sobrar largura ao conteudo.
   O rotulo volta quando o professor abre o menu. */
@media (min-width: 901px) and (max-width: 1240px) {
  .sidebar { width: 72px; padding: 20px 10px 18px; }
  .sidebar .brand .word,
  .sidebar__group-title,
  .sidebar__label,
  .sidebar__user-info { display: none; }
  .sidebar__link { justify-content: center; padding: 12px 0; }
  .sidebar__user { justify-content: center; padding: 8px 0 12px; }
  .sidebar__group { gap: 4px; }
  .sidebar__top { justify-content: center; }

  .sidebar-toggle:checked ~ .panel .sidebar { width: 244px; padding: 20px 14px 18px; }
  .sidebar-toggle:checked ~ .panel .sidebar .brand .word,
  .sidebar-toggle:checked ~ .panel .sidebar .sidebar__group-title,
  .sidebar-toggle:checked ~ .panel .sidebar .sidebar__label,
  .sidebar-toggle:checked ~ .panel .sidebar .sidebar__user-info { display: block; }
  .sidebar-toggle:checked ~ .panel .sidebar__link { justify-content: flex-start; padding: 10px 12px; }
  .sidebar-toggle:checked ~ .panel .sidebar__user { justify-content: flex-start; padding: 8px 12px 12px; }
  .sidebar-toggle:checked ~ .panel .sidebar__top { justify-content: space-between; }

  .topbar__menu {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; flex: none;
    border-radius: var(--r-md);
    border: 1px solid var(--l-border);
    background: var(--l-card);
    color: var(--l-muted);
    cursor: pointer;
  }
  .topbar__menu:hover { color: var(--blue); border-color: var(--blue); }
  .topbar__menu svg { width: 20px; height: 20px; }
}

@media (max-width: 1080px) {
  .g4 { grid-template-columns: 1fr 1fr; }
}

/* Tablet e celular: a barra lateral vira gaveta por cima do conteudo. */
@media (max-width: 900px) {
  .sidebar {
    position: fixed; top: 0; left: 0; z-index: 80;
    height: 100dvh; width: 268px;
    transform: translateX(-100%);
    transition: transform .22s ease;
  }
  .sidebar-toggle:checked ~ .panel .sidebar { transform: translateX(0); }

  .sidebar__scrim {
    display: block;
    position: fixed; inset: 0; z-index: 70;
    background: rgba(11, 11, 15, .55);
    opacity: 0; pointer-events: none;
    transition: opacity .22s ease;
  }
  .sidebar-toggle:checked ~ .panel .sidebar__scrim { opacity: 1; pointer-events: auto; }

  .sidebar__close {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px;
    border-radius: var(--r-md);
    color: var(--text-muted); cursor: pointer;
  }
  .sidebar__close:hover { background: var(--surface); color: var(--text); }
  .sidebar__close svg { width: 20px; height: 20px; }

  .topbar__menu {
    display: inline-flex; align-items: center; justify-content: center;
    width: 42px; height: 42px; flex: none;
    border-radius: var(--r-md);
    border: 1px solid var(--l-border);
    background: var(--l-card);
    color: var(--l-text);
    cursor: pointer;
  }
  .topbar__menu svg { width: 20px; height: 20px; }

  .topbar { padding: 14px 18px; }
  .topbar h1 { font-size: 20px; }
  .panel-body { padding: 18px 18px 48px; }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar, .sidebar__scrim { transition: none; }
}
/* Bloco antigo transformava a lateral numa linha rolavel; agora ela e uma
   gaveta, entao aqui ficam so os ajustes de grade. */
@media (max-width: 900px) {
  .g3, .g2 { grid-template-columns: 1fr; }
  .grid-2col { grid-template-columns: 1fr !important; }
}
@media (max-width: 560px) {
  .g4 { grid-template-columns: 1fr; }
  .display { font-size: 32px; }
  .topbar h1 { font-size: 22px; }
}

/* =========================================================================
   LOGIN — fundo cinematográfico + motion sutil
   ========================================================================= */
.login-scene {
  --login-ease: cubic-bezier(.2, .8, .2, 1);
  --login-fast: .15s;
  --login-normal: .4s;
  --login-slow: .7s;
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 20px 36px;
}

.login-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.login-bg picture,
.login-bg img {
  width: 100%;
  height: 100%;
  display: block;
}

.login-bg__img {
  object-fit: cover;
  object-position: center;
  transform: scale(1.06);
  animation: loginKenBurns 22s var(--login-ease) both;
}

.login-bg__overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 55% at 50% 48%, rgba(11, 11, 15, .28) 0%, rgba(11, 11, 15, .62) 58%, rgba(11, 11, 15, .82) 100%),
    linear-gradient(180deg, rgba(11, 11, 15, .35) 0%, rgba(11, 11, 15, .15) 40%, rgba(11, 11, 15, .72) 100%);
}

.login-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
}

.login-logo {
  display: block;
  width: min(240px, 62vw);
  height: auto;
  margin: 0 auto 18px;
  filter: drop-shadow(0 18px 40px rgba(0, 0, 0, .55));
  animation: loginFadeUp var(--login-slow) var(--login-ease) both;
}

.login-card {
  background: rgba(20, 20, 26, .62);
  border: 1px solid rgba(212, 175, 55, .22);
  border-radius: 22px;
  padding: 28px 24px 22px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .42), inset 0 1px 0 rgba(255, 255, 255, .06);
  animation: loginFadeUp var(--login-slow) var(--login-ease) .08s both;
}

.login-card h1 {
  font: 800 28px/1.1 var(--font-display);
  letter-spacing: -.02em;
}

.login-card .lead {
  margin-top: 8px;
  font: 500 14px/1.5 var(--font-body);
  color: var(--text-muted);
}

.login-card .field { animation: loginFadeUp var(--login-normal) var(--login-ease) both; }
.login-card .field:nth-of-type(1) { animation-delay: .16s; }
.login-card .field:nth-of-type(2) { animation-delay: .24s; }
.login-actions { animation: loginFadeUp var(--login-normal) var(--login-ease) .32s both; }
.login-demos { animation: loginFadeUp var(--login-normal) var(--login-ease) .4s both; }

.login-card .input {
  background: rgba(11, 11, 15, .55);
  min-height: 48px;
}

.login-card .input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, .18);
}

.login-card .btn-primary:hover,
.login-card .btn-secondary:hover {
  transform: scale(1.02);
  transition: transform var(--login-fast) var(--login-ease), background var(--login-fast), border-color var(--login-fast), color var(--login-fast);
}

.login-card .btn:focus-visible,
.login-card .input:focus-visible {
  outline: 2px solid var(--gold-light);
  outline-offset: 2px;
}

.login-foot {
  margin-top: 18px;
  text-align: center;
  font: 500 13px var(--font-body);
  color: var(--text-dim);
  animation: loginFadeUp var(--login-normal) var(--login-ease) .48s both;
}

@keyframes loginKenBurns {
  from { transform: scale(1.06) translate3d(0, 0, 0); }
  to { transform: scale(1.14) translate3d(0, -1.4%, 0); }
}

@keyframes loginFadeUp {
  from { opacity: 0; transform: translate3d(0, 16px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@media (min-width: 768px) {
  .login-scene { padding: 40px 32px; }
  .login-logo { width: 280px; margin-bottom: 22px; }
  .login-card { padding: 32px 30px 24px; }
  .login-card h1 { font-size: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  .login-bg__img,
  .login-logo,
  .login-card,
  .login-card .field,
  .login-actions,
  .login-demos,
  .login-foot {
    animation: none !important;
  }
  .login-bg__img { transform: none; }
  .login-card .btn-primary:hover,
  .login-card .btn-secondary:hover { transform: none; }
}

/* =========================================================================
   DIALOGO — alerta, confirmacao e aviso curto (substitui alert/confirm)
   Marcacao criada por public/assets/js/dialogo.js.

   ATENCAO: o estado aberto/fechado usa DISPLAY, nunca o atributo hidden.
   A regra global [hidden]{display:none!important} venceria qualquer
   display definido aqui e o dialogo nunca apareceria. Pelo mesmo motivo
   a animacao usa @keyframes (animation) e nao transition de visibility,
   que o Chrome congela sob prefers-reduced-motion.
   ========================================================================= */

.cfd {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 20px;
  padding-bottom: calc(20px + env(safe-area-inset-bottom));
}
.cfd.is-aberto { display: flex; }

.cfd__fundo {
  position: absolute;
  inset: 0;
  background: rgba(11, 11, 15, .62);
  backdrop-filter: blur(3px);
  animation: cfd-fundo-in .16s ease both;
}

.cfd__caixa {
  position: relative;
  width: 100%;
  max-width: 400px;
  max-height: 88vh;
  overflow-y: auto;
  border-radius: var(--r-3xl);
  padding: 28px 24px 22px;
  text-align: center;
  box-shadow: var(--shadow-card);
  animation: cfd-caixa-in .18s cubic-bezier(.2, .9, .3, 1.2) both;
}

/* Base clara — painel do professor */
.cfd--claro .cfd__caixa {
  background: var(--l-card);
  color: var(--l-text);
  border: 1px solid var(--l-border);
}
.cfd--claro .cfd__texto { color: var(--l-muted); }

/* Base escura — app do aluno */
.cfd--escuro .cfd__caixa {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}
.cfd--escuro .cfd__texto { color: var(--text-muted); }

.cfd__icone {
  width: 68px;
  height: 68px;
  margin: 0 auto 16px;
  border-radius: var(--pill);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: cfd-icone-in .28s .04s ease both;
}
.cfd__icone svg { width: 34px; height: 34px; display: block; }

.cfd__icone--sucesso  { color: var(--success); background: rgba(46, 209, 124, .14); }
.cfd__icone--erro     { color: var(--danger);  background: rgba(255, 77, 79, .14); }
.cfd__icone--aviso    { color: var(--warning); background: rgba(255, 176, 32, .14); }
.cfd__icone--pergunta { color: var(--blue);    background: var(--blue-dim); }

.cfd__titulo {
  font: 700 20px/1.25 var(--font-display);
  letter-spacing: -.01em;
  margin: 0 0 6px;
}

.cfd__texto {
  font: 500 14.5px/1.55 var(--font-body);
  margin: 0 0 22px;
  overflow-wrap: anywhere;
}
.cfd__texto:empty { display: none; }

.cfd__acoes {
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
}

.cfd__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  padding: 13px 22px;
  border: 1px solid transparent;
  border-radius: var(--r-lg);
  cursor: pointer;
  font: 700 15px var(--font-body);
  transition: background .15s, border-color .15s, color .15s;
}
.cfd__btn:focus-visible { outline: 2px solid var(--blue-light); outline-offset: 3px; }
.cfd__btn--perigo:focus-visible { outline-color: var(--danger-soft); }
.cfd--claro .cfd__btn--cancelar:focus-visible { outline-color: var(--l-dim); }

.cfd__btn--confirmar { background: var(--blue); color: #FFF; box-shadow: var(--shadow-blue); }
.cfd__btn--confirmar:hover { background: var(--blue-hover); }

.cfd__btn--perigo { background: var(--danger); color: #FFF; box-shadow: 0 6px 18px rgba(255, 77, 79, .32); }
.cfd__btn--perigo:hover { background: var(--danger-strong); }

.cfd--claro .cfd__btn--cancelar {
  background: var(--l-card);
  border-color: var(--l-border-input);
  color: var(--l-muted);
}
.cfd--claro .cfd__btn--cancelar:hover { border-color: var(--l-text); color: var(--l-text); }

.cfd--escuro .cfd__btn--cancelar {
  background: var(--elevated);
  border-color: var(--border);
  color: var(--text-muted);
}
.cfd--escuro .cfd__btn--cancelar:hover { border-color: var(--border-strong); color: var(--text); }

/* Saida */
.cfd.is-fechando .cfd__fundo { animation: cfd-fundo-out .15s ease both; }
.cfd.is-fechando .cfd__caixa { animation: cfd-caixa-out .15s ease both; }

@keyframes cfd-fundo-in  { from { opacity: 0 } to { opacity: 1 } }
@keyframes cfd-fundo-out { from { opacity: 1 } to { opacity: 0 } }
@keyframes cfd-caixa-in  {
  from { opacity: 0; transform: translateY(14px) scale(.94); }
  to   { opacity: 1; transform: none; }
}
@keyframes cfd-caixa-out {
  from { opacity: 1; transform: none; }
  to   { opacity: 0; transform: translateY(8px) scale(.97); }
}
@keyframes cfd-icone-in {
  from { opacity: 0; transform: scale(.5); }
  to   { opacity: 1; transform: scale(1); }
}

/* A partir do tablet os botoes voltam a ficar lado a lado */
@media (min-width: 540px) {
  .cfd__acoes { flex-direction: row; justify-content: center; }
  .cfd__btn { width: auto; min-width: 132px; }
}

/* --------------------------------------------------- Aviso curto (toast) */
.cfd-toasts {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  top: calc(12px + env(safe-area-inset-top));
  z-index: 2100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(420px, calc(100vw - 24px));
  pointer-events: none;
}

.cfd-toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--elevated);
  color: var(--text);
  font: 600 14px/1.4 var(--font-body);
  box-shadow: 0 12px 34px rgba(0, 0, 0, .32);
  pointer-events: auto;
  animation: cfd-toast-in .18s ease both;
}
.cfd-toast.is-fechando { animation: cfd-toast-out .15s ease both; }
.cfd-toast svg { width: 20px; height: 20px; flex: none; }

.cfd-toast--sucesso svg  { color: var(--success); }
.cfd-toast--erro svg     { color: var(--danger); }
.cfd-toast--aviso svg    { color: var(--warning); }
.cfd-toast--pergunta svg { color: var(--blue); }

@keyframes cfd-toast-in  { from { opacity: 0; transform: translateY(-14px) } to { opacity: 1; transform: none } }
@keyframes cfd-toast-out { from { opacity: 1; transform: none } to { opacity: 0; transform: translateY(-10px) } }

@media (prefers-reduced-motion: reduce) {
  .cfd__fundo,
  .cfd__caixa,
  .cfd__icone,
  .cfd-toast,
  .cfd.is-fechando .cfd__fundo,
  .cfd.is-fechando .cfd__caixa,
  .cfd-toast.is-fechando { animation: none; }
}

/* ==========================================================================
   Ícones próprios (resources/views/icones/*.blade.php)
   Todos são SVG de traço que herdam a cor do texto — basta mudar o
   "color" do elemento pai para recolorir o ícone.
   ========================================================================== */
.icone {
  width: 18px;
  height: 18px;
  flex: none;
  display: inline-block;
  vertical-align: -.2em;
}

.icone-sm { width: 14px; height: 14px; }
.icone-md { width: 20px; height: 20px; }
.icone-lg { width: 24px; height: 24px; }
.icone-xl { width: 28px; height: 28px; }

/* Carinha das escalas de 1 a 5 (energia, humor, sono, treino, check-in) */
.icone-carinha { width: 24px; height: 24px; vertical-align: middle; }

/* Nota em estrelas */
.nota {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  line-height: 0;
}
.icone-nota { width: 14px; height: 14px; vertical-align: middle; }

/* Marca de série feita, desenhada pelo JS dentro de .gym-set-n */
.gym-set-n .icone { width: 22px; height: 22px; vertical-align: middle; }


/* Grafico de linha do painel (peso medio e afins) */
.lchart { position: relative; margin-top: 14px; padding-bottom: 4px; }
.lchart__svg { width: 100%; height: 110px; display: block; overflow: visible; }
.lchart__points { position: absolute; inset: 0 0 auto 0; height: 110px; pointer-events: none; }
.lchart__point {
  position: absolute;
  width: 8px; height: 8px; margin: -4px 0 0 -4px;
  border-radius: var(--pill);
  border: 2px solid var(--l-card);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .06);
}
.lchart__labels { display: flex; justify-content: space-between; margin-top: 10px; gap: 6px; }
.lchart__label { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; min-width: 0; }
.lchart__label b {
  font: 700 12.5px var(--font-display); color: var(--l-text);
  font-variant-numeric: tabular-nums;
}
.lchart__label span { font: 600 10.5px var(--font-body); color: var(--l-dim); }


/* ==========================================================================
   Notificações e app instalável
   ========================================================================== */

/* -------------------------------------------------- Interruptor (on/off) */
.switch {
  position: relative;
  flex: none;
  width: 46px;
  height: 27px;
  display: inline-block;
}
.switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}
.switch__trilho {
  position: absolute;
  inset: 0;
  border-radius: var(--pill);
  background: var(--raised);
  border: 1px solid var(--border-strong);
  transition: background .16s, border-color .16s;
}
.switch__trilho::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 19px;
  height: 19px;
  border-radius: var(--pill);
  background: var(--text-dim);
  transition: transform .16s, background .16s;
}
.switch input:checked + .switch__trilho {
  background: var(--gold-dim);
  border-color: var(--gold);
}
.switch input:checked + .switch__trilho::after {
  background: var(--gold);
  transform: translateX(19px);
}
.switch input:focus-visible + .switch__trilho { outline: 2px solid var(--blue); outline-offset: 2px; }
.switch input:disabled { cursor: not-allowed; }
.switch input:disabled + .switch__trilho { opacity: .45; }

/* No painel claro o interruptor ligado é azul (ação), não dourado. */
.switch-light .switch__trilho { background: #ECEAE4; border-color: var(--l-border-input); }
.switch-light .switch__trilho::after { background: #FFF; box-shadow: 0 1px 2px rgba(0, 0, 0, .22); }
.switch-light input:checked + .switch__trilho { background: var(--blue); border-color: var(--blue); }
.switch-light input:checked + .switch__trilho::after { background: #FFF; }

/* ------------------------------------------------ Linha de preferência */
.pref {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid var(--border-soft);
}
.pref:last-of-type { border-bottom: 0; }
.pref__texto { flex: 1; min-width: 0; }
.pref__nome { font: 700 14px var(--font-body); color: var(--text); }
.pref__ajuda { font: 500 12.5px var(--font-body); color: var(--text-dim); margin-top: 2px; }

.pref-light { border-bottom-color: var(--l-border); }
.pref-light .pref__nome { color: var(--l-text); }
.pref-light .pref__ajuda { color: var(--l-muted); }

/* --------------------------------------------------- Estado do push */
.push-estado {
  font: 600 12.5px var(--font-body);
  color: var(--text-dim);
  margin-top: 10px;
  line-height: 1.45;
}
.push-estado[data-tom="ok"] { color: var(--success); }
.push-estado[data-tom="erro"] { color: var(--danger-soft); }

.push-estado-light { color: var(--l-muted); }
.push-estado-light[data-tom="ok"] { color: #1B8E58; }
.push-estado-light[data-tom="erro"] { color: var(--danger-strong); }

/* --------------------------------------------- Convite para instalar */
.instalar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: var(--r-2xl);
  background: var(--gold-dim);
  border: 1px solid var(--gold-line);
}
.instalar__marca {
  width: 40px; height: 40px;
  flex: none;
  border-radius: var(--r-md);
  background: var(--gold);
  color: var(--black);
  display: flex; align-items: center; justify-content: center;
  font: 800 19px var(--font-display);
}
.instalar__texto { flex: 1; min-width: 0; }
.instalar__titulo { font: 700 14px var(--font-body); color: var(--gold-light); }
.instalar__ajuda { font: 500 12.5px var(--font-body); color: var(--text-muted); margin-top: 2px; line-height: 1.4; }


/* =========================================================================
   CHAT DO PAINEL (base clara) — mesma estrutura do chat do aluno,
   com anexo, áudio e gravação de voz.
   ========================================================================= */
.pchat-thread {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column; gap: 10px;
  padding: 16px 0;
  overflow-y: auto;
  max-height: 460px;
}
.pchat-row { display: flex; }
.pchat-row.is-mine { justify-content: flex-end; }
.pchat-row.is-theirs { justify-content: flex-start; }

.pchat-bubble {
  max-width: 72%;
  padding: 12px 14px;
  border-radius: 16px;
  font: 500 13.5px/1.55 var(--font-body);
}
.pchat-bubble p { white-space: pre-line; }
.pchat-bubble time { display: block; margin-top: 5px; font: 600 10.5px var(--font-body); opacity: .7; }
.pchat-bubble.is-mine {
  background: var(--blue); color: #FFF;
  border-bottom-right-radius: 6px;
}
.pchat-bubble.is-theirs {
  background: var(--l-bg); color: var(--l-text);
  border: 1px solid var(--l-border);
  border-bottom-left-radius: 6px;
}

/* O partial de anexo é compartilhado com o app; aqui só ajustamos as cores. */
.pchat-bubble .chat-file { background: rgba(0, 0, 0, .06); }
.pchat-bubble.is-mine .chat-file { background: rgba(255, 255, 255, .16); }
.pchat-bubble.is-mine .chat-file:hover { background: rgba(255, 255, 255, .26); }
.pchat-bubble.is-theirs .chat-file:hover { background: rgba(0, 0, 0, .1); }
.pchat-bubble .chat-image,
.pchat-bubble .chat-video { max-width: 240px; }
.pchat-bubble .chat-audio audio { max-width: 210px; }

/* Compositor */
.pchat-composer {
  display: flex; align-items: center; gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--l-border);
}
.pchat-composer__field { flex: 1 1 auto; width: 0; min-width: 120px; }

.pchat-btn {
  flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px;
  border-radius: var(--r-md);
  border: 1px solid var(--l-border-input);
  background: var(--l-card);
  color: var(--l-muted);
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.pchat-btn:hover { color: var(--blue); border-color: var(--blue); }
.pchat-btn svg { width: 20px; height: 20px; }
.pchat-btn[aria-pressed="true"] {
  background: var(--danger); border-color: var(--danger); color: #FFF;
}

/* Barra de gravação (inline, ao contrário da do app que é fixa) */
.pchat-recorder {
  display: flex; align-items: center; gap: 10px;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  background: rgba(255, 77, 79, .07);
  border: 1px solid rgba(255, 77, 79, .35);
}
.pchat-recorder__cancel {
  flex: none; width: 36px; height: 36px;
  border: 0; border-radius: var(--r-sm);
  background: transparent; color: var(--l-muted);
  font: 700 18px var(--font-body); cursor: pointer;
}
.pchat-recorder__cancel:hover { background: rgba(255, 77, 79, .14); color: var(--danger-strong); }
.pchat-recorder__dot {
  flex: none; width: 9px; height: 9px; border-radius: var(--pill);
  background: var(--danger);
  animation: chat-rec-pulse 1s ease-in-out infinite;
}
.pchat-recorder__time { flex: none; font-size: 15px; color: var(--l-text); }
.pchat-recorder__hint {
  flex: 1; min-width: 0;
  font: 600 12px var(--font-body); color: var(--l-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  .pchat-recorder__dot { animation: none; }
}

@media (max-width: 900px) {
  .pchat-bubble { max-width: 86%; }
}

/* Selo de recorde do modo academia: troféu + texto, criados pelo JS */
.gym-pr { display: flex; align-items: center; justify-content: center; gap: 7px; }
.gym-pr .icone { width: 17px; height: 17px; }

/* Chama dentro do selo dourado da sequência de dias */
.pill-gold .n .icone { width: 16px; height: 16px; }
