/* ============ COMPONENTS.CSS — Botões, Cards, Modais, Forms, Toasts ============ */

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--r-full);
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast), transform var(--t-fast), opacity var(--t-fast), box-shadow var(--t-fast);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  user-select: none;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background var(--t-fast);
}
.btn:hover::after  { background: rgba(255,255,255,0.06); }
.btn:active::after { background: rgba(255,255,255,0.12); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Button loading spinner */
.btn.btn-loading { pointer-events: none; opacity: 0.8; }
.btn.btn-loading .btn-text { visibility: hidden; }
.btn.btn-loading::before {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: btn-spin 0.6s linear infinite;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }

.btn-primary {
  background: var(--accent);
  color: #000;
  font-weight: 700;
}
.btn-primary:hover { box-shadow: var(--shadow-accent); transform: translateY(-1px); }

.btn-danger {
  background: var(--accent2);
  color: #fff;
}
.btn-danger:hover { box-shadow: var(--shadow-red); transform: translateY(-1px); }

.btn-blue {
  background: var(--accent3);
  color: #000;
  font-weight: 700;
}
.btn-blue:hover { box-shadow: var(--shadow-blue); }

.btn-purple {
  background: var(--accent4);
  color: #fff;
  font-weight: 700;
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border2);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* Google Sign-In button */
.google-signin-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border2);
  color: var(--text);
  font-weight: 500;
}
.google-signin-btn:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.3);
}
.btn-rec-active  { background: var(--accent) !important; color: #000 !important; border-color: var(--accent) !important; }

.btn-outline-accent {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}
.btn-outline-accent:hover { background: rgba(232,255,71,0.08); }

.btn-sm { padding: 6px 14px; font-size: 0.78rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-icon {
  width: 44px; height: 44px; min-width: 44px;
  padding: 0;
  border-radius: var(--r-md);
  background: var(--card2);
  color: var(--text2);
  border: 1px solid var(--border);
}
.btn-icon:hover { color: var(--text); border-color: var(--border2); }
.btn-icon-lg { width: 44px; height: 44px; border-radius: var(--r-lg); }
.btn-full { width: 100%; }

/* FAB */
.fab {
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 52px;
  height: 52px;
  border-radius: var(--r-full);
  background: var(--accent);
  color: #000;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 700;
  box-shadow: 0 4px 24px rgba(232,255,71,0.4);
  transition: background var(--t-base), border-color var(--t-base), color var(--t-base), transform var(--t-base), opacity var(--t-base), box-shadow var(--t-base);
  z-index: var(--z-fab);
}
.fab:hover { transform: scale(1.1); box-shadow: 0 6px 32px rgba(232,255,71,0.5); }
.fab:active { transform: scale(0.95); }

/* ---- CARDS ---- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-lg);
  transition: border-color var(--t-fast);
}
.card:hover { border-color: var(--border2); }
.card-sm { padding: var(--sp-md); border-radius: var(--r-md); }
.card-flush { padding: 0; overflow: hidden; }

.card-accent {
  border-color: rgba(232,255,71,0.3);
  background: linear-gradient(135deg, rgba(232,255,71,0.04) 0%, var(--card) 60%);
}

/* Stat card */
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-lg);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-card .stat-value {
  font-family: var(--font-title);
  font-size: 2rem;
  color: var(--accent);
  line-height: 1;
}
.stat-card .stat-label {
  font-size: 0.75rem;
  color: var(--text2);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ---- FORMS ---- */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 0.78rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text2);
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 11px 14px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  outline: none;
  -webkit-appearance: none;
}
.form-input::placeholder { color: var(--text3); }
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(232,255,71,0.1);
}

.form-select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239090a8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}
.form-select option { background: var(--card); }

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

.form-error {
  font-size: 0.75rem;
  color: var(--accent2);
  display: none;
}
.form-group.has-error .form-input,
.form-group.has-error .form-select {
  border-color: var(--accent2);
}
.form-group.has-error .form-error { display: block; }

.form-hint {
  font-size: 0.75rem;
  color: var(--text3);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-md);
}
@media (max-width: 480px) {
  .form-row { grid-template-columns: 1fr; }
}

/* Password toggle */
.input-wrap {
  position: relative;
}
.input-wrap .form-input { padding-right: 44px; }
.input-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text3);
  padding: 4px;
  transition: color var(--t-fast);
}
.input-toggle:hover { color: var(--text); }

/* ---- RANGE/SLIDER ---- */
.range-wrap { position: relative; }
.range-input {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: var(--r-full);
  background: var(--border2);
  outline: none;
  cursor: pointer;
}
.range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 0 8px rgba(232,255,71,0.5);
  transition: transform var(--t-fast);
}
.range-input::-webkit-slider-thumb:hover { transform: scale(1.2); }

/* ---- TOGGLE / SWITCH ---- */
.toggle {
  position: relative;
  width: 44px;
  height: 24px;
  cursor: pointer;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-track {
  position: absolute;
  inset: 0;
  background: var(--border2);
  border-radius: var(--r-full);
  transition: background var(--t-base);
}
.toggle input:checked ~ .toggle-track { background: var(--accent); }
.toggle-thumb {
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--t-base);
  box-shadow: var(--shadow-sm);
}
.toggle input:checked ~ .toggle-track .toggle-thumb { transform: translateX(20px); }

/* ---- BADGE ---- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--r-full);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  font-family: var(--font-mono);
  text-transform: uppercase;
}
.badge-accent   { background: rgba(232,255,71,0.15);  color: var(--accent); }
.badge-red      { background: rgba(255,82,82,0.15);   color: var(--accent2); }
.badge-blue     { background: rgba(71,200,255,0.15);  color: var(--accent3); }
.badge-purple   { background: rgba(184,71,255,0.15);  color: var(--accent4); }
.badge-green    { background: rgba(71,255,156,0.15);  color: var(--accent5); }
.badge-muted    { background: rgba(144,144,168,0.12); color: var(--text2); }

/* Level badges */
.level-iniciante    { background: rgba(71,255,156,0.15); color: var(--accent5); }
.level-intermediario{ background: rgba(232,255,71,0.15); color: var(--accent);  }
.level-avancado     { background: rgba(255,82,82,0.15);  color: var(--accent2); }

/* Plan badges */
.plan-basic   { background: rgba(144,144,168,0.15); color: var(--text2); }
.plan-premium { background: rgba(232,255,71,0.15);  color: var(--accent); }
.plan-vip     { background: rgba(184,71,255,0.15);  color: var(--accent4); }

/* ---- AVATAR ---- */
.avatar {
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-family: var(--font-title);
  color: #000;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--accent);
  font-size: 0.9rem;
}
.avatar-sm  { width: 28px; height: 28px; font-size: 0.7rem; }
.avatar-md  { width: 36px; height: 36px; font-size: 0.85rem; }
.avatar-lg  { width: 48px; height: 48px; font-size: 1.1rem; }
.avatar-xl  { width: 72px; height: 72px; font-size: 1.5rem; }
.avatar-2xl { width: 96px; height: 96px; font-size: 2rem; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Avatar color variants */
.av-green  { background: var(--accent5); }
.av-yellow { background: var(--accent); }
.av-red    { background: var(--accent2); }
.av-blue   { background: var(--accent3); }
.av-purple { background: var(--accent4); }

/* ---- AUTH UTILITY CLASSES ---- */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--sp-md);
}
.auth-icon-emoji {
  font-size: 3rem;
  margin-bottom: 8px;
}
.auth-step-title {
  font-family: var(--font-title);
  font-size: 1.5rem;
  margin-bottom: var(--sp-md);
}
.auth-description {
  text-align: center;
  color: var(--text2);
  font-size: 0.9rem;
  margin-bottom: var(--sp-lg);
}
.auth-link-row {
  text-align: center;
  margin-top: var(--sp-sm);
}
.auth-link-row-md {
  text-align: center;
  margin-top: var(--sp-md);
}
.auth-link-btn {
  color: var(--text3);
  font-size: 0.82rem;
}
.auth-link-separator {
  color: var(--text3);
  font-size: 0.82rem;
}
.auth-forgot-btn {
  font-size: 0.8rem;
  color: var(--text3);
}
.auth-back-btn {
  margin-top: 8px;
}
.auth-logo-compact {
  padding-top: var(--sp-xl);
  padding-bottom: var(--sp-md);
}
.logo-text-sm {
  font-size: 2rem;
}
.logo-text-md {
  font-size: 2.5rem;
}
.verification-code-input {
  font-size: 1.5rem;
  text-align: center;
  letter-spacing: 8px;
}
.verification-code-sm {
  font-size: 1.4rem;
  text-align: center;
  letter-spacing: 6px;
}
.role-card-desc {
  font-size: 0.6rem;
  color: var(--text3);
  text-align: center;
  margin-top: 2px;
}
.role-selector-2col {
  grid-template-columns: repeat(2, 1fr);
}
.auth-btn-row {
  display: flex;
  gap: 10px;
}
.auth-terms-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--text2);
}
.auth-terms-check {
  margin-top: 3px;
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}
.auth-link-accent {
  color: var(--accent);
  text-decoration: underline;
}
.auth-terms-wrap {
  margin: var(--sp-md) 0;
}
.google-section {
  margin-bottom: var(--sp-md);
  padding: var(--sp-md);
  background: rgba(66,133,244,0.08);
  border-radius: var(--r-md);
  border: 1px solid rgba(66,133,244,0.2);
}
.google-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.82rem;
}
.google-check {
  width: 16px;
  height: 16px;
  accent-color: #4285F4;
}
.google-link-title {
  font-weight: 600;
}
.google-link-hint {
  font-size: 0.72rem;
  color: var(--text3);
  margin-top: 2px;
}
.spacer-bottom {
  height: 40px;
}
.mb-md {
  margin-bottom: var(--sp-md);
}
.mb-sm {
  margin-bottom: var(--sp-sm);
}
.mt-md {
  margin-top: var(--sp-md);
}
.flex-shrink-0 {
  flex-shrink: 0;
}

/* ---- NOTIF BELL & BADGE ---- */
.notif-bell {
  position: relative;
}
.notif-badge {
  display: none;
  position: absolute;
  top: 2px;
  right: 2px;
  background: var(--accent2);
  color: #fff;
  font-size: 0.55rem;
  font-weight: 700;
  min-width: 14px;
  height: 14px;
  border-radius: 999px;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  line-height: 1;
}

/* ---- MODAL VARIANTS ---- */
.modal-tall {
  max-height: 85vh;
}
.modal-flex {
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}
.modal-flex-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-scroll-body {
  flex: 1;
  overflow-y: auto;
}
.modal-tall-flex {
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

/* ---- SETTINGS MODE HINT ---- */
.settings-mode-hint {
  font-size: 0.72rem;
  color: var(--text3);
  padding: 4px 0 0 2px;
}
.settings-mode-toggle {
  font-size: 0.8rem;
  color: var(--accent);
}

/* ---- HEADER ICON SPACING ---- */
.header-icon-gap-sm {
  margin-right: 4px;
}
.header-checkin-btn {
  margin-right: 2px;
  font-size: 1rem;
}

/* ---- DIVIDER ---- */
.divider {
  height: 1px;
  background: var(--border);
  width: 100%;
  margin: var(--sp-md) 0;
}
.divider-label {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
  color: var(--text3);
  font-size: 0.75rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
}
.divider-label::before,
.divider-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ---- PILL SELECTOR ---- */
.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-sm);
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  height: 32px;
  border-radius: var(--r-full);
  border: 1px solid var(--border);
  background: var(--card2);
  color: var(--text2);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast), transform var(--t-fast), opacity var(--t-fast), box-shadow var(--t-fast);
  user-select: none;
  white-space: nowrap;
  box-sizing: border-box;
  flex-shrink: 0;
}
.pill:hover { border-color: var(--border2); color: var(--text); }
.pill.active {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
  font-weight: 700;
}
.pill.active-red    { background: var(--accent2); color: #fff; border-color: var(--accent2); }
.pill.active-blue   { background: var(--accent3); color: #000; border-color: var(--accent3); }
.pill.active-purple { background: var(--accent4); color: #fff; border-color: var(--accent4); }

/* ---- DAY CIRCLES ---- */
.day-circle {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card2);
  color: var(--text2);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  font-weight: 700;
  text-transform: uppercase;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast), transform var(--t-fast), opacity var(--t-fast), box-shadow var(--t-fast);
  user-select: none;
  flex-shrink: 0;
}
.day-circle:hover { border-color: var(--border2); color: var(--text); }
.day-circle.active {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(232,255,71,0.3);
}

/* ---- MOOD SELECTOR ---- */
.mood-btn {
  flex: 1;
  min-width: 44px;
  aspect-ratio: 1;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--card2);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 1.4rem;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast), transform var(--t-fast), opacity var(--t-fast), box-shadow var(--t-fast);
  user-select: none;
}
.mood-btn span.mood-label {
  font-size: 0.6rem;
  font-family: var(--font-mono);
  color: var(--text3);
  text-align: center;
}
.mood-btn:hover { border-color: var(--border2); transform: scale(1.05); }
.mood-btn.active {
  border-color: var(--accent);
  background: rgba(232,255,71,0.08);
  box-shadow: 0 0 12px rgba(232,255,71,0.2);
}
.mood-btn.active span.mood-label { color: var(--accent); }

/* ---- MODALS ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7,7,15,0.85);
  z-index: var(--z-modal);
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: var(--sp-md);
}
.modal-overlay.open {
  display: flex;
  animation: modalFadeIn 0.15s ease;
}

@media (min-width: 600px) {
  .modal-overlay { align-items: center; }
}

.modal {
  background: var(--card);
  border: 1px solid var(--border2);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  width: 100%;
  max-width: 540px;
  max-height: 92vh;
  overflow-y: auto;
  position: relative;
  animation: modalSlideUp 0.2s ease;
}
@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes modalSlideUp {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
@media (min-width: 600px) {
  .modal { border-radius: var(--r-xl); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-lg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--card);
  z-index: 1;
}
.modal-title {
  font-family: var(--font-title);
  font-size: 1.4rem;
  letter-spacing: 0.03em;
}
.modal-close {
  background: var(--card2);
  border: 1px solid var(--border);
  color: var(--text2);
  border-radius: var(--r-md);
  width: 44px; height: 44px; min-width: 44px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast), transform var(--t-fast), opacity var(--t-fast), box-shadow var(--t-fast);
  font-size: 1rem;
}
.modal-close:hover { color: var(--text); border-color: var(--border2); }

.modal-body {
  padding: var(--sp-lg);
  display: flex;
  flex-direction: column;
  gap: var(--sp-md);
}
.modal-footer {
  padding: var(--sp-md) var(--sp-lg) var(--sp-lg);
  display: flex;
  gap: var(--sp-sm);
  justify-content: flex-end;
}

/* Drag handle for bottom sheet */
.modal::before {
  content: '';
  display: block;
  width: 36px; height: 4px;
  background: var(--border2);
  border-radius: var(--r-full);
  margin: 12px auto 0;
}
@media (min-width: 600px) {
  .modal::before { display: none; }
}

/* ---- TOASTS ---- */
#toast-container {
  position: fixed;
  bottom: 84px;
  right: var(--sp-md);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm);
  pointer-events: none;
  max-width: 320px;
  width: calc(100vw - 2 * var(--sp-md));
}
@media (min-width: 860px) {
  #toast-container { bottom: var(--sp-xl); }
}

.toast {
  background: var(--card2);
  border: 1px solid var(--border2);
  border-radius: var(--r-lg);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: all;
  animation: toastIn 0.3s ease both;
  box-shadow: var(--shadow-md);
  font-size: 0.875rem;
}
.toast.out { animation: toastOut 0.3s ease both; }
.toast-icon { font-size: 1.1rem; flex-shrink: 0; }
.toast-success { border-color: rgba(71,255,156,0.3); }
.toast-error   { border-color: rgba(255,82,82,0.3); }
.toast-info    { border-color: rgba(71,200,255,0.3); }
.toast-warning { border-color: rgba(232,255,71,0.3); }

/* ---- LOADING SPINNER ---- */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
.spinner-lg { width: 40px; height: 40px; border-width: 3px; }
.spinner-xl { width: 60px; height: 60px; border-width: 4px; }

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-md);
  padding: var(--sp-2xl);
  color: var(--text2);
  font-size: 0.875rem;
}

/* ---- EMPTY STATE ---- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--sp-2xl) var(--sp-lg);
  gap: var(--sp-md);
}
.empty-state .empty-icon {
  font-size: 3rem;
  opacity: 0.4;
}
.empty-state h3 {
  font-family: var(--font-title);
  font-size: 1.4rem;
  color: var(--text2);
}
.empty-state p {
  font-size: 0.875rem;
  color: var(--text3);
  max-width: 280px;
}

/* ---- ACCORDION ---- */
.accordion-item {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: border-color var(--t-fast);
}
.accordion-item.open { border-color: var(--border2); }

.accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-md) var(--sp-lg);
  cursor: pointer;
  background: var(--card);
  transition: background var(--t-fast);
  user-select: none;
}
.accordion-header:hover { background: var(--card2); }

.accordion-chevron {
  color: var(--text3);
  transition: transform var(--t-base);
  flex-shrink: 0;
}
.accordion-item.open .accordion-chevron { transform: rotate(180deg); }

.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
  background: var(--card2);
}
.accordion-item.open .accordion-body { max-height: 2000px; }
.accordion-content { padding: var(--sp-md) var(--sp-lg) var(--sp-lg); }

/* ---- SEARCH BAR ---- */
.search-bar {
  position: relative;
}
.search-bar .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text3);
  pointer-events: none;
}
.search-bar .form-input {
  padding-left: 40px;
}

/* ---- PROGRESS BAR ---- */
.progress {
  height: 6px;
  background: var(--border2);
  border-radius: var(--r-full);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: var(--r-full);
  background: var(--accent);
  transition: width 0.5s ease;
}
.progress-fill.red    { background: var(--accent2); }
.progress-fill.blue   { background: var(--accent3); }
.progress-fill.purple { background: var(--accent4); }

/* ---- TABS (inner) ---- */
.inner-tabs {
  display: flex;
  gap: 2px;
  background: var(--bg2);
  border-radius: var(--r-lg);
  padding: 3px;
}
.inner-tab {
  flex: 1;
  padding: 8px 12px;
  border-radius: var(--r-md);
  border: none;
  background: transparent;
  color: var(--text2);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast), transform var(--t-fast), opacity var(--t-fast), box-shadow var(--t-fast);
  text-align: center;
  white-space: nowrap;
}
.inner-tab.active {
  background: var(--card);
  color: var(--text);
}

/* ---- ALERT BOX ---- */
.alert {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  font-size: 0.875rem;
}
.alert-warning {
  background: rgba(232,255,71,0.07);
  border: 1px solid rgba(232,255,71,0.2);
  color: var(--accent);
}
.alert-error {
  background: rgba(255,82,82,0.07);
  border: 1px solid rgba(255,82,82,0.2);
  color: var(--accent2);
}
.alert-info {
  background: rgba(71,200,255,0.07);
  border: 1px solid rgba(71,200,255,0.2);
  color: var(--accent3);
}

/* ---- SCORE GAUGE ---- */
.gauge-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.gauge-label {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text2);
}
.gauge-value {
  font-family: var(--font-title);
  font-size: 1.5rem;
  line-height: 1;
}

/* ---- CIRCULAR PROGRESS ---- */
.circle-progress {
  position: relative;
  width: 80px;
  height: 80px;
}
.circle-progress svg {
  transform: rotate(-90deg);
}
.circle-bg { fill: none; stroke: var(--border2); stroke-width: 6; }
.circle-fill { fill: none; stroke-width: 6; stroke-linecap: round; transition: stroke-dashoffset 0.8s ease; }
.circle-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-title);
  font-size: 1.1rem;
}

/* ---- EXERCISE CARD ---- */
.exercise-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: border-color var(--t-fast);
}
.exercise-card:hover { border-color: var(--border2); }
.exercise-num {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: rgba(232,255,71,0.1);
  border: 1px solid rgba(232,255,71,0.2);
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-family: var(--font-mono);
}
.exercise-info { flex: 1; min-width: 0; }
.exercise-name {
  font-weight: 600;
  font-size: 0.875rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.exercise-meta {
  font-size: 0.75rem;
  color: var(--text2);
  font-family: var(--font-mono);
}
.exercise-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

/* ---- USER LIST ITEM ---- */
.user-list-item {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: opacity var(--t-fast);
}
.user-list-item:last-child { border-bottom: none; }
.user-list-item:hover { opacity: 0.8; }

/* ---- COMMENT ---- */
.comment-item {
  display: flex;
  gap: 10px;
  animation: fadeIn 0.2s ease both;
}
.comment-bubble {
  flex: 1;
  background: var(--bg2);
  border-radius: 0 var(--r-lg) var(--r-lg) var(--r-lg);
  padding: 8px 12px;
}
.comment-meta {
  font-size: 0.72rem;
  color: var(--text3);
  margin-top: 4px;
}

/* ---- MESSAGE BUBBLE ---- */
.msg-bubble {
  max-width: 80%;
  padding: 8px 12px;
  border-radius: var(--r-lg);
  font-size: 0.875rem;
  line-height: 1.4;
  animation: fadeIn 0.2s ease both;
}
.msg-mine {
  background: var(--accent);
  color: #000;
  margin-left: auto;
  border-bottom-right-radius: 4px;
}
.msg-other {
  background: var(--card2);
  border: 1px solid var(--border);
  margin-right: auto;
  border-bottom-left-radius: 4px;
}
.msg-time {
  font-size: 0.65rem;
  color: var(--text3);
  margin-top: 2px;
  text-align: right;
}
.msg-other .msg-time { text-align: left; }

.msg-deleted {
  background: var(--card2) !important;
  border: 1px dashed var(--border) !important;
  color: var(--text3) !important;
}

/* Show delete button on message hover */
.msg-bubble:hover + .msg-del-btn,
.msg-del-btn:hover {
  opacity: 1 !important;
}


/* ---- FILTER PILLS (Descobrir) ---- */
.filter-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  height: 32px;
  line-height: 1;
  box-sizing: border-box;
  border-radius: var(--r-full);
  border: 1px solid var(--border);
  background: var(--card2);
  color: var(--text2);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast), transform var(--t-fast), opacity var(--t-fast), box-shadow var(--t-fast);
  font-family: var(--font-body);
}
.filter-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.filter-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
  font-weight: 700;
}
