/* =====================================================================
 * Trainly - Design System
 * Inspirado em Notion, Stripe Dashboard e Linear
 * ===================================================================== */

:root {
  --primary: #6366F1;
  --primary-dark: #4F46E5;
  --primary-50: #EEF2FF;
  --primary-100: #E0E7FF;
  --secondary: #8B5CF6;
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
  --info: #3B82F6;

  --bg: #FAFAFB;
  --bg-card: #FFFFFF;
  --bg-elevated: #FFFFFF;
  --bg-hover: #F3F4F6;
  --bg-input: #FFFFFF;
  --bg-sidebar: #FFFFFF;

  --text: #111827;
  --text-muted: #6B7280;
  --text-faint: #9CA3AF;
  --border: #E5E7EB;
  --border-light: #F3F4F6;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.04);
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-lg: 0 10px 30px rgba(0,0,0,.06), 0 4px 12px rgba(0,0,0,.04);

  --sidebar-w: 260px;
  --topbar-h: 64px;
  --transition: all .18s ease;
}

[data-theme="dark"] {
  --bg: #0B0D11;
  --bg-card: #15181E;
  --bg-elevated: #1B1F26;
  --bg-hover: #1F242C;
  --bg-input: #1B1F26;
  --bg-sidebar: #11141A;

  --text: #E5E7EB;
  --text-muted: #9CA3AF;
  --text-faint: #6B7280;
  --border: #232830;
  --border-light: #1B1F26;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow: 0 1px 3px rgba(0,0,0,.45), 0 1px 2px rgba(0,0,0,.3);
  --shadow-lg: 0 10px 30px rgba(0,0,0,.5), 0 4px 12px rgba(0,0,0,.35);
}

* { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  font-size: 14.5px;
  min-height: 100vh;
  transition: background-color .2s, color .2s;
}

/* Tipografia */
h1, h2, h3, h4, h5, h6 { color: var(--text); font-weight: 600; letter-spacing: -.02em; }
.text-muted { color: var(--text-muted) !important; }
a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-dark); }

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.card-hover:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.card-body { color: var(--text); }
.card-header { background: transparent; border-bottom: 1px solid var(--border); padding: 1rem 1.25rem; }
.card-title { color: var(--text); font-weight: 600; margin: 0; }

/* Sidebar */
.tl-layout { display: flex; min-height: 100vh; }
.tl-sidebar {
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  padding: 1.25rem 0;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transition: transform .25s ease;
}
.tl-sidebar .brand {
  font-weight: 800; font-size: 1.4rem; padding: 0 1.25rem 1rem;
  display: flex; align-items: center; gap: .5rem;
}
.tl-sidebar .brand .logo {
  width: 32px; height: 32px; border-radius: 8px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  display: inline-flex; align-items: center; justify-content: center;
  color: white; font-weight: 800;
}
.tl-sidebar .brand-name {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.tl-nav { flex: 1; padding: 0 .75rem; overflow-y: auto; }
.tl-nav .nav-section { color: var(--text-faint); font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; padding: 1rem .5rem .35rem; }
.tl-nav a {
  display: flex; align-items: center; gap: .75rem;
  padding: .5rem .75rem; border-radius: var(--radius-sm);
  color: var(--text-muted); font-weight: 500; font-size: .92rem;
  transition: var(--transition);
}
.tl-nav a:hover { background: var(--bg-hover); color: var(--text); }
.tl-nav a.active { background: var(--primary-50); color: var(--primary); font-weight: 600; }
[data-theme="dark"] .tl-nav a.active { background: rgba(99,102,241,.15); color: #A5B4FC; }
.tl-nav a i, .tl-nav a .icon { width: 18px; text-align: center; opacity: .9; }
.tl-nav .badge-count { margin-left: auto; background: var(--danger); color: white; font-size: .7rem; padding: .15rem .4rem; border-radius: 20px; }
.tl-sidebar-footer { padding: .75rem; border-top: 1px solid var(--border-light); }

/* Topbar */
.tl-main { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-width: 0; }
.tl-topbar {
  height: var(--topbar-h);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  display: flex; align-items: center; gap: 1rem;
  position: sticky; top: 0; z-index: 50;
}
.tl-topbar .search {
  flex: 1; max-width: 420px;
  position: relative;
}
.tl-topbar .search input {
  width: 100%; padding: .55rem 1rem .55rem 2.25rem;
  background: var(--bg-hover); border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--text); font-size: .9rem;
}
.tl-topbar .search input:focus { border-color: var(--primary); background: var(--bg-input); outline: none; }
.tl-topbar .search .icon { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); color: var(--text-faint); }
.tl-topbar .actions { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
.tl-icon-btn {
  width: 38px; height: 38px; border-radius: var(--radius-sm);
  background: transparent; border: 1px solid transparent; color: var(--text-muted);
  display: inline-flex; align-items: center; justify-content: center;
  transition: var(--transition); cursor: pointer; position: relative;
}
.tl-icon-btn:hover { background: var(--bg-hover); color: var(--text); }
.tl-icon-btn .dot { position: absolute; top: 7px; right: 9px; width: 8px; height: 8px; background: var(--danger); border-radius: 50%; border: 2px solid var(--bg-card); }

/* Sino de notificações */
.tl-notif-badge {
  position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px;
  background: var(--danger); color: #fff; font-size: .65rem; font-weight: 700; line-height: 16px;
  text-align: center; border-radius: 999px; border: 2px solid var(--bg-card);
}
.tl-notif-menu {
  width: 340px; max-width: calc(100vw - 24px); padding: 0; overflow: hidden;
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.tl-notif-head { display: flex; align-items: center; justify-content: space-between; padding: .75rem 1rem; border-bottom: 1px solid var(--border); }
.tl-notif-list { max-height: 380px; overflow-y: auto; }
.tl-notif-item {
  display: flex; gap: .65rem; align-items: flex-start; padding: .7rem 1rem;
  border-bottom: 1px solid var(--border); cursor: pointer; transition: var(--transition); text-decoration: none; color: inherit;
}
.tl-notif-item:last-child { border-bottom: none; }
.tl-notif-item:hover { background: var(--bg-hover); }
.tl-notif-item.unread { background: var(--primary-50); }
[data-theme="dark"] .tl-notif-item.unread { background: rgba(99,102,241,.12); }
.tl-notif-item .ic { font-size: 1.25rem; line-height: 1.2; flex-shrink: 0; }
.tl-notif-item .bd { flex-grow: 1; min-width: 0; }
.tl-notif-item .bd .ti { font-weight: 600; font-size: .85rem; color: var(--text); }
.tl-notif-item .bd .ms { font-size: .8rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-notif-item .bd .tm { font-size: .7rem; color: var(--text-faint); margin-top: .15rem; }
.tl-notif-item .undot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); flex-shrink: 0; margin-top: .35rem; }
.tl-notif-empty, .tl-notif-loading { padding: 2rem 1rem; text-align: center; color: var(--text-muted); font-size: .85rem; }
.tl-notif-foot { display: block; text-align: center; padding: .7rem; font-size: .85rem; font-weight: 600; color: var(--primary); border-top: 1px solid var(--border); text-decoration: none; }
.tl-notif-foot:hover { background: var(--bg-hover); }

.tl-content { flex: 1; padding: 1.5rem; max-width: 100%; }

/* User dropdown */
.tl-user { display: flex; align-items: center; gap: .6rem; padding: .25rem .5rem; border-radius: var(--radius-sm); cursor: pointer; transition: var(--transition); }
.tl-user:hover { background: var(--bg-hover); }
.tl-user .avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--secondary)); color: white; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: .85rem; overflow: hidden; }
.tl-user .avatar img { width: 100%; height: 100%; object-fit: cover; }
.tl-user .info { line-height: 1.1; }
.tl-user .info .name { font-size: .85rem; font-weight: 600; color: var(--text); }
.tl-user .info .role { font-size: .72rem; color: var(--text-faint); text-transform: capitalize; }

.dropdown-menu {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: .35rem;
}
.dropdown-item { color: var(--text); border-radius: var(--radius-sm); padding: .5rem .75rem; font-size: .88rem; }
.dropdown-item:hover { background: var(--bg-hover); color: var(--text); }
.dropdown-divider { border-color: var(--border); margin: .35rem 0; }

/* Stat cards */
.stat-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.25rem;
  display: flex; flex-direction: column; gap: .25rem;
  transition: var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.stat-card .label { color: var(--text-muted); font-size: .82rem; font-weight: 500; }
.stat-card .value { color: var(--text); font-size: 1.8rem; font-weight: 700; letter-spacing: -.02em; }
.stat-card .trend { font-size: .8rem; font-weight: 600; }
.stat-card .trend.up { color: var(--success); }
.stat-card .trend.down { color: var(--danger); }
.stat-card .icon-wrap { width: 42px; height: 42px; border-radius: var(--radius); display: inline-flex; align-items: center; justify-content: center; font-size: 1.2rem; }
.bg-soft-primary { background: var(--primary-50); color: var(--primary); }
[data-theme="dark"] .bg-soft-primary { background: rgba(99,102,241,.15); color: #A5B4FC; }
.bg-soft-success { background: #D1FAE5; color: var(--success); }
[data-theme="dark"] .bg-soft-success { background: rgba(16,185,129,.15); color: #6EE7B7; }
.bg-soft-warning { background: #FEF3C7; color: var(--warning); }
[data-theme="dark"] .bg-soft-warning { background: rgba(245,158,11,.15); color: #FCD34D; }
.bg-soft-danger { background: #FEE2E2; color: var(--danger); }
[data-theme="dark"] .bg-soft-danger { background: rgba(239,68,68,.15); color: #FCA5A5; }
.bg-soft-info { background: #DBEAFE; color: var(--info); }
[data-theme="dark"] .bg-soft-info { background: rgba(59,130,246,.15); color: #93C5FD; }

/* Botões */
.btn {
  border-radius: var(--radius-sm); font-weight: 600; font-size: .9rem;
  padding: .55rem 1rem; transition: var(--transition); border: 1px solid transparent;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); color: white; transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-outline-primary { color: var(--primary); border-color: var(--border); background: var(--bg-card); }
.btn-outline-primary:hover { background: var(--primary); color: white; border-color: var(--primary); }
.btn-success { background: var(--success); border-color: var(--success); color: white; }
.btn-success:hover { background: #059669; border-color: #059669; color: white; }
.btn-danger { background: var(--danger); border-color: var(--danger); }
.btn-warning { background: var(--warning); border-color: var(--warning); color: white; }
.btn-warning:hover { color: white; }
.btn-secondary, .btn-light { background: var(--bg-card); border-color: var(--border); color: var(--text); }
.btn-secondary:hover, .btn-light:hover { background: var(--bg-hover); color: var(--text); }
.btn-link { color: var(--primary); }
.btn-icon { width: 36px; height: 36px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.btn-gradient {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border: none; color: white;
}
.btn-gradient:hover { color: white; box-shadow: 0 8px 20px rgba(99,102,241,.35); transform: translateY(-1px); }

/* Forms */
.form-control, .form-select {
  background: var(--bg-input); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: .55rem .85rem; font-size: .9rem;
  transition: var(--transition);
}
.form-control:focus, .form-select:focus {
  background: var(--bg-input); color: var(--text);
  border-color: var(--primary); box-shadow: 0 0 0 4px rgba(99,102,241,.1);
}
.form-label { color: var(--text); font-weight: 500; font-size: .85rem; margin-bottom: .35rem; }
.form-text { color: var(--text-muted); font-size: .8rem; }
textarea.form-control { min-height: 90px; }
.form-control::placeholder { color: var(--text-faint); }
.input-group-text { background: var(--bg-hover); border-color: var(--border); color: var(--text-muted); }

/* Tabelas */
.table { color: var(--text); margin: 0; }
.table > :not(caption) > * > * { background: transparent; border-color: var(--border-light); color: var(--text); padding: .75rem 1rem; }
.table thead th { color: var(--text-muted); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--border); }
.table-hover tbody tr:hover > * { background: var(--bg-hover); }

/* Badges */
.badge { font-weight: 600; padding: .35em .65em; border-radius: 999px; font-size: .72rem; }
.badge.bg-primary { background: var(--primary-50) !important; color: var(--primary); }
[data-theme="dark"] .badge.bg-primary { background: rgba(99,102,241,.18) !important; color: #A5B4FC; }
.badge.bg-success { background: #D1FAE5 !important; color: var(--success); }
[data-theme="dark"] .badge.bg-success { background: rgba(16,185,129,.18) !important; color: #6EE7B7; }
.badge.bg-warning { background: #FEF3C7 !important; color: #92400E; }
[data-theme="dark"] .badge.bg-warning { background: rgba(245,158,11,.18) !important; color: #FCD34D; }
.badge.bg-danger { background: #FEE2E2 !important; color: var(--danger); }
[data-theme="dark"] .badge.bg-danger { background: rgba(239,68,68,.18) !important; color: #FCA5A5; }
.badge.bg-secondary { background: var(--bg-hover) !important; color: var(--text-muted); }

/* Alerts */
.alert { border: 1px solid; border-radius: var(--radius); padding: .85rem 1rem; }
.alert-success { background: #D1FAE5; border-color: #A7F3D0; color: #065F46; }
[data-theme="dark"] .alert-success { background: rgba(16,185,129,.1); border-color: rgba(16,185,129,.3); color: #6EE7B7; }
.alert-danger { background: #FEE2E2; border-color: #FECACA; color: #991B1B; }
[data-theme="dark"] .alert-danger { background: rgba(239,68,68,.1); border-color: rgba(239,68,68,.3); color: #FCA5A5; }
.alert-warning { background: #FEF3C7; border-color: #FDE68A; color: #92400E; }
[data-theme="dark"] .alert-warning { background: rgba(245,158,11,.1); border-color: rgba(245,158,11,.3); color: #FCD34D; }
.alert-info { background: #DBEAFE; border-color: #BFDBFE; color: #1E40AF; }
[data-theme="dark"] .alert-info { background: rgba(59,130,246,.1); border-color: rgba(59,130,246,.3); color: #93C5FD; }

/* Page header */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; gap: 1rem; flex-wrap: wrap; }
.page-header h1, .page-header h2 { margin: 0; font-size: 1.6rem; font-weight: 700; }
.page-header .subtitle { color: var(--text-muted); font-size: .9rem; margin-top: .15rem; }

/* Auth pages */
.auth-wrapper {
  min-height: 100vh;
  display: grid; grid-template-columns: 1fr 1fr;
  background: var(--bg);
}
.auth-side {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  padding: 3rem; color: white;
  display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
}
.auth-side::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 80% 20%, rgba(255,255,255,.15), transparent 50%);
}
.auth-side .content { position: relative; z-index: 1; max-width: 480px; margin: auto; }
.auth-side h1 { color: white; font-size: 2.5rem; font-weight: 700; line-height: 1.15; }
.auth-side p { color: rgba(255,255,255,.85); font-size: 1.05rem; }
.auth-side ul { list-style: none; padding: 0; margin-top: 2rem; }
.auth-side ul li { padding: .5rem 0; display: flex; align-items: center; gap: .75rem; color: rgba(255,255,255,.9); }
.auth-side ul li::before { content: '✓'; width: 22px; height: 22px; background: rgba(255,255,255,.2); border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: .85rem; }

.auth-form { display: flex; align-items: center; justify-content: center; padding: 2rem; }
.auth-form .form-box { width: 100%; max-width: 420px; }
.auth-form h2 { font-size: 1.75rem; font-weight: 700; margin-bottom: .35rem; }
.auth-form .lead { color: var(--text-muted); margin-bottom: 1.5rem; }

@media (max-width: 991px) {
  .auth-wrapper { grid-template-columns: 1fr; }
  .auth-side { display: none; }
}

/* Mobile */
.tl-mobile-toggle { display: none; }
@media (max-width: 991px) {
  .tl-sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .tl-sidebar.open { transform: translateX(0); }
  .tl-main { margin-left: 0; }
  .tl-mobile-toggle { display: inline-flex; }
  .tl-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 999; }
  .tl-backdrop.show { display: block; }
}

/* Exercício card */
.exercise-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem; transition: var(--transition);
  cursor: pointer;
}
.exercise-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--primary); }
.exercise-card .thumb { width: 100%; height: 130px; border-radius: var(--radius-sm); background: var(--bg-hover); overflow: hidden; margin-bottom: .75rem; }
.exercise-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.exercise-card .name { font-weight: 600; color: var(--text); font-size: .95rem; line-height: 1.2; }
.exercise-card .meta { color: var(--text-muted); font-size: .75rem; margin-top: .25rem; }

/* Drag-and-drop */
.sortable-ghost { opacity: .4; background: var(--bg-hover); }
.sortable-chosen { box-shadow: var(--shadow-lg); }
.drag-handle { cursor: grab; color: var(--text-faint); padding: .25rem; }
.drag-handle:hover { color: var(--text); }

/* Conquista/medalha */
.achievement { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.5rem; text-align: center; transition: var(--transition); }
.achievement.locked { opacity: .55; filter: grayscale(.8); }
.achievement:not(.locked):hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.achievement .icon { font-size: 2.5rem; margin-bottom: .5rem; }
.achievement .name { font-weight: 700; color: var(--text); }
.achievement .desc { font-size: .8rem; color: var(--text-muted); }
.achievement .progress { height: 6px; margin-top: .75rem; background: var(--bg-hover); }
.achievement .progress-bar { background: linear-gradient(90deg, var(--primary), var(--secondary)); border-radius: 999px; }

/* Treino em andamento */
.workout-exercise {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 1rem; margin-bottom: .75rem; transition: var(--transition);
}
.workout-exercise.done { border-color: var(--success); background: linear-gradient(0deg, rgba(16,185,129,.05), rgba(16,185,129,.05)), var(--bg-card); }
.workout-exercise .head { display: flex; align-items: center; gap: 1rem; }
.workout-exercise .head .head-actions { display: flex; align-items: center; gap: .5rem; flex-shrink: 0; margin-left: auto; }
.workout-exercise .thumb { width: 64px; height: 64px; border-radius: var(--radius); overflow: hidden; background: var(--bg-hover); flex-shrink: 0; }
.workout-exercise .thumb img { width: 100%; height: 100%; object-fit: cover; }
.workout-exercise h6 { margin: 0; font-weight: 600; }
.workout-exercise .meta { color: var(--text-muted); font-size: .8rem; }
.workout-exercise .sets { margin-top: .85rem; }
.workout-exercise .set-row { display: grid; grid-template-columns: 30px 1fr 1fr 32px; gap: .5rem; align-items: center; margin-bottom: .35rem; }
.workout-exercise .set-row .set-num { font-weight: 600; color: var(--text-muted); text-align: center; }
.workout-exercise .set-row .set-check { justify-self: center; width: 1.2rem; height: 1.2rem; margin: 0; }
.workout-exercise input.set-input { background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .35rem .5rem; font-size: .85rem; min-width: 0; }
.workout-exercise input.set-input.done { background: rgba(16,185,129,.08); border-color: var(--success); }

/* Timer */
.workout-timer {
  position: sticky; top: calc(var(--topbar-h) + 12px); z-index: 30;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 1rem 1.25rem; box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  margin-bottom: 1rem;
}
.workout-timer .time { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.workout-timer .label { color: var(--text-muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; }
.rest-timer { background: linear-gradient(135deg, var(--warning), #FB923C); color: white; padding: .35rem .75rem; border-radius: var(--radius-sm); font-weight: 700; font-variant-numeric: tabular-nums; }

/* Treino — responsivo (mobile) */
@media (max-width: 575.98px) {
  .workout-timer { padding: .85rem 1rem; gap: .65rem .85rem; }
  .workout-timer > div:nth-child(1) { flex: 1 1 auto; }
  .workout-timer > div:nth-child(2) { flex: 0 0 auto; text-align: right; }
  .workout-timer .time { font-size: 1.6rem; }
  .workout-timer #restLabel { display: block; max-width: 11rem; line-height: 1.25; }
  /* grupo de botões ocupa a linha inteira embaixo */
  .workout-timer > .d-flex { flex: 1 0 100%; }
  .workout-timer #btnFinalizar { flex: 1 1 auto; }
  .workout-timer #btnPausar { flex: 0 0 auto; }

  .workout-exercise { padding: .85rem; }
  .workout-exercise .head { gap: .6rem; flex-wrap: wrap; }
  .workout-exercise .thumb { width: 52px; height: 52px; }
  .workout-exercise .head h6 { font-size: .95rem; line-height: 1.2; }
  .workout-exercise .set-row { grid-template-columns: 24px 1fr 1fr 32px; gap: .4rem; margin-bottom: .5rem; }
  .workout-exercise input.set-input { padding: .5rem .55rem; font-size: .95rem; }

  /* Stat cards: evita corte de valores (ex.: datas) em telas estreitas */
  .stat-card { padding: .8rem .6rem; text-align: center; align-items: center; }
  .stat-card .value { font-size: 1.15rem; line-height: 1.15; word-break: break-word; }
  .stat-card .label { font-size: .72rem; line-height: 1.2; }
}

/* Chat */
.tl-chat { display: flex; flex-direction: column; height: calc(100vh - var(--topbar-h) - 180px); min-height: 360px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.tl-chat-body { flex: 1 1 auto; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .5rem; }
.tl-chat-empty { margin: auto; color: var(--text-muted); font-size: .9rem; text-align: center; }
.tl-msg { max-width: 78%; padding: .55rem .8rem; border-radius: 14px; font-size: .9rem; line-height: 1.35; word-wrap: break-word; position: relative; }
.tl-msg .t { display: block; font-size: .68rem; opacity: .7; margin-top: .15rem; text-align: right; }
.tl-msg.them { align-self: flex-start; background: var(--bg-hover); border-bottom-left-radius: 4px; }
.tl-msg.mine { align-self: flex-end; background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.tl-chat-input { display: flex; gap: .5rem; padding: .75rem; border-top: 1px solid var(--border); }
.tl-chat-input input { flex: 1 1 auto; }
.tl-chat-date { align-self: center; font-size: .7rem; color: var(--text-muted); background: var(--bg-hover); padding: .1rem .6rem; border-radius: 10px; margin: .25rem 0; }

/* Lista de conversas */
.tl-conv-item { display: flex; align-items: center; gap: .75rem; padding: .85rem 1rem; border-bottom: 1px solid var(--border); text-decoration: none; color: inherit; transition: var(--transition); }
.tl-conv-item:hover { background: var(--bg-hover); }
.tl-conv-avatar { width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(135deg,#6366F1,#8B5CF6); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.tl-conv-item .preview { color: var(--text-muted); font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* Calendar */
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.calendar-day { aspect-ratio: 1; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .35rem; font-size: .8rem; position: relative; cursor: pointer; transition: var(--transition); }
.calendar-day:hover { background: var(--bg-hover); }
.calendar-day.today { border-color: var(--primary); background: var(--primary-50); color: var(--primary); font-weight: 600; }
[data-theme="dark"] .calendar-day.today { background: rgba(99,102,241,.15); color: #A5B4FC; }
.calendar-day.has-events { font-weight: 600; }
.calendar-day .events-dot { position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%); width: 6px; height: 6px; background: var(--primary); border-radius: 50%; }
.calendar-day.outside { opacity: .35; }

/* Loading */
.skeleton { background: linear-gradient(90deg, var(--bg-hover) 25%, var(--bg-card) 50%, var(--bg-hover) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--radius-sm); }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.spinner { width: 32px; height: 32px; border: 3px solid var(--bg-hover); border-top-color: var(--primary); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Empty state */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-muted); }
.empty-state .icon { font-size: 3rem; opacity: .5; margin-bottom: .5rem; }
.empty-state h5 { color: var(--text); margin-bottom: .35rem; }

/* Modal */
.modal-content { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); color: var(--text); }
.modal-header { border-bottom: 1px solid var(--border); }
.modal-footer { border-top: 1px solid var(--border); }

/* Tabs */
.nav-tabs { border-bottom: 1px solid var(--border); }
.nav-tabs .nav-link { color: var(--text-muted); border: 0; border-bottom: 2px solid transparent; padding: .75rem 1rem; font-weight: 500; }
.nav-tabs .nav-link.active { color: var(--primary); border-bottom-color: var(--primary); background: transparent; }
.nav-tabs .nav-link:hover { color: var(--text); border-color: transparent; }

/* Tooltip + utilitários */
.cursor-pointer { cursor: pointer; }
.rounded-pill { border-radius: 999px !important; }

/* Toast */
.toast-container { position: fixed; top: 80px; right: 20px; z-index: 9999; }
.tl-toast {
  background: var(--bg-card); color: var(--text); border: 1px solid var(--border);
  border-radius: var(--radius); padding: .85rem 1rem; box-shadow: var(--shadow-lg);
  margin-bottom: .5rem; display: flex; align-items: center; gap: .75rem;
  min-width: 280px; animation: slideIn .3s ease;
}
.tl-toast.success { border-left: 4px solid var(--success); }
.tl-toast.error { border-left: 4px solid var(--danger); }
.tl-toast.warning { border-left: 4px solid var(--warning); }
.tl-toast.info { border-left: 4px solid var(--info); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Landing */
.landing-hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white; padding: 5rem 0 6rem; position: relative; overflow: hidden;
}
.landing-hero::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 90% 10%, rgba(255,255,255,.18), transparent 40%), radial-gradient(circle at 10% 90%, rgba(255,255,255,.12), transparent 35%); }
.landing-hero .container { position: relative; z-index: 1; }
.landing-hero h1 { color: white; font-size: 3rem; line-height: 1.1; }
.landing-hero p.lead { color: rgba(255,255,255,.9); font-size: 1.2rem; }

.pricing-card { background: var(--bg-card); border: 2px solid var(--border); border-radius: var(--radius-xl); padding: 2rem; transition: var(--transition); height: 100%; }
.pricing-card.highlight { border-color: var(--primary); transform: scale(1.03); box-shadow: var(--shadow-lg); }
.pricing-card .price { font-size: 2.5rem; font-weight: 800; color: var(--text); letter-spacing: -.02em; }
.pricing-card .price small { font-size: 1rem; color: var(--text-muted); font-weight: 500; }
.pricing-card ul { list-style: none; padding: 0; margin: 1.25rem 0; }
.pricing-card ul li { padding: .4rem 0; color: var(--text); display: flex; gap: .5rem; }
.pricing-card ul li::before { content: '✓'; color: var(--success); font-weight: 700; }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }
