/* =========================================================
   admin.css — Tema unificado do Sistema de Treinos
   Baseado no visual de osni.in (dark + ciano)
   ========================================================= */

/* ===== VARIÁVEIS ===== */
:root {
    --cyan: #65e9d9;
    --cyan-dark: #4dc9b9;
    --cyan-light: #8af0e3;

    --transition: 0.25s ease;
    --radius: 12px;
    --radius-lg: 18px;
    --radius-pill: 999px;

    --font: 'Manrope', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

/* TEMA ESCURO (padrão) */
html[data-tema="dark"] {
    --bg:           #0a0a0a;
    --bg-elev:      #111827;
    --bg-elev-2:    #1a1a2e;
    --bg-input:     #0f172a;
    --border:       rgba(255,255,255,0.08);
    --border-forte: rgba(255,255,255,0.15);
    --texto:        #ffffff;
    --texto-suave:  #9ca3af;
    --texto-fraco:  #6b7280;
    --sombra:       0 15px 35px rgba(0,0,0,0.35);
}

/* TEMA CLARO */
html[data-tema="light"] {
    --bg:           #f5f7fa;
    --bg-elev:      #ffffff;
    --bg-elev-2:    #f9fafb;
    --bg-input:     #ffffff;
    --border:       #e5e7eb;
    --border-forte: #d1d5db;
    --texto:        #1a1a2e;
    --texto-suave:  #4b5563;
    --texto-fraco:  #6b7280;
    --sombra:       0 8px 24px rgba(15,23,42,0.08);
}

/* ===== RESET ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--texto);
    line-height: 1.6;
    transition: background var(--transition), color var(--transition);
    -webkit-tap-highlight-color: transparent;
}

img { max-width: 100%; height: auto; }

a { color: var(--cyan); text-decoration: none; }
a:hover { color: var(--cyan-dark); }

body.sem-scroll { overflow: hidden; }

/* =========================================================
   NAVBAR
   ========================================================= */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-elev);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding-top: env(safe-area-inset-top);
}

.navbar-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0.75rem 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
}

.navbar-brand .logo-titulo {
    display: block;
    font-weight: 800;
    font-size: 1.05rem;
    color: var(--texto);
    letter-spacing: -0.3px;
    line-height: 1.1;
}

.navbar-brand .logo-sub {
    display: block;
    font-size: 0.6rem;
    color: var(--cyan);
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    flex: 1;
    margin-left: 20px;
}

.nav-menu a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 8px;
    color: var(--texto-suave);
    font-weight: 500;
    font-size: 0.9rem;
    transition: all var(--transition);
}

.nav-menu a svg {
    width: 16px;
    height: 16px;
    stroke-width: 2;
}

.nav-menu a:hover {
    background: rgba(101,233,217,0.08);
    color: var(--cyan);
}

.nav-menu a.ativo {
    background: rgba(101,233,217,0.15);
    color: var(--cyan);
    font-weight: 600;
}

.navbar-acoes {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

/* Botão de ícone (tema) */
.btn-icone {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    background: var(--bg-elev-2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--texto-suave);
    transition: all var(--transition);
    position: relative;
    text-decoration: none;
}

.btn-icone:hover {
    color: var(--cyan);
    border-color: var(--cyan);
}

.btn-icone svg { width: 18px; height: 18px; }

html[data-tema="dark"]  .icone-sol { display: block; }
html[data-tema="dark"]  .icone-lua { display: none; }
html[data-tema="light"] .icone-sol { display: none; }
html[data-tema="light"] .icone-lua { display: block; }

/* Usuário */
.usuario-menu { position: relative; }

.btn-usuario {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px 4px 4px;
    background: var(--bg-elev-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    cursor: pointer;
    color: var(--texto);
    transition: all var(--transition);
}

.btn-usuario:hover { border-color: var(--cyan); }

.btn-usuario .avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cyan), var(--cyan-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0a0a0a;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
    overflow: hidden;
}

.btn-usuario .usuario-nome {
    font-size: 0.85rem;
    font-weight: 600;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-usuario svg { width: 14px; height: 14px; color: var(--texto-suave); }

.usuario-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--sombra);
    min-width: 240px;
    padding: 8px;
    display: none;
    z-index: 200;
}

.usuario-dropdown.aberto { display: block; }

.usuario-info {
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.usuario-info strong { font-size: 0.9rem; }
.usuario-info span  { font-size: 0.8rem; color: var(--texto-suave); }

.badge-papel {
    display: inline-block;
    align-self: flex-start;
    margin-top: 6px;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    background: rgba(101,233,217,0.15);
    color: var(--cyan);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.usuario-dropdown hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 6px 0;
}

.usuario-dropdown a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    color: var(--texto-suave);
    font-size: 0.85rem;
}

.usuario-dropdown a:hover {
    background: rgba(101,233,217,0.08);
    color: var(--cyan);
}

.usuario-dropdown a.texto-perigo:hover {
    background: rgba(220,38,38,0.08);
    color: #dc2626;
}

.usuario-dropdown a svg { width: 16px; height: 16px; }

/* Menu mobile */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--texto);
    cursor: pointer;
    padding: 6px;
}

.menu-toggle svg { width: 24px; height: 24px; }

/* =========================================================
   CONTAINER PRINCIPAL
   ========================================================= */
.page-wrap {
    max-width: 1280px;
    margin: 0 auto;
    padding: 32px 20px 64px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.page-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 4px;
}

.page-header .subtitulo {
    color: var(--texto-suave);
    font-size: 0.95rem;
}

.link-voltar {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    color: var(--texto-suave);
    text-decoration: none;
    margin-bottom: 6px;
    transition: color var(--transition);
}
.link-voltar:hover { color: var(--cyan); }

/* =========================================================
   CARDS DE MÉTRICA
   ========================================================= */
.grid-metricas {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.metrica-card {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.metrica-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 4px; height: 100%;
    background: var(--cyan);
    opacity: 0;
    transition: opacity var(--transition);
}

.metrica-card:hover {
    transform: translateY(-3px);
    border-color: rgba(101,233,217,0.3);
    box-shadow: 0 15px 35px rgba(101,233,217,0.1);
}

.metrica-card:hover::before { opacity: 1; }

.metrica-topo {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.metrica-icone {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(101,233,217,0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cyan);
}

.metrica-icone svg { width: 22px; height: 22px; }

.metrica-valor {
    font-size: 1.9rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--texto);
}

.metrica-label {
    color: var(--texto-suave);
    font-size: 0.85rem;
    margin-top: 4px;
}

.metrica-trend {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    background: rgba(101,233,217,0.15);
    color: var(--cyan);
}

/* =========================================================
   GRIDS E BLOCOS
   ========================================================= */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

@media (max-width: 900px) {
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

.bloco {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    transition: border-color var(--transition);
}

.bloco:hover { border-color: var(--border-forte); }

.bloco.sem-padding { padding: 0; overflow: hidden; }

.bloco-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    gap: 12px;
}

.bloco-header h2 {
    font-size: 1.05rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.bloco-header h2 svg { width: 18px; height: 18px; color: var(--cyan); }

/* =========================================================
   LISTAS
   ========================================================= */
.lista-simples { list-style: none; }

.lista-simples li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    gap: 12px;
}

.lista-simples li:last-child { border-bottom: none; }

.lista-simples a { color: var(--texto); font-weight: 500; }
.lista-simples a:hover { color: var(--cyan); }

/* =========================================================
   TABELAS
   ========================================================= */
.tabela {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-elev);
    border-radius: var(--radius);
    overflow: hidden;
}

.tabela th, .tabela td {
    text-align: left;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 0.88rem;
}

.tabela thead th {
    background: var(--bg-elev-2);
    font-weight: 600;
    color: var(--texto-suave);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.tabela tbody tr:hover { background: rgba(101,233,217,0.04); }

.tabela-compacta th,
.tabela-compacta td { padding: 8px 10px; font-size: 0.85rem; }

/* =========================================================
   BOTÕES
   ========================================================= */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border: 1px solid var(--border-forte);
    background: var(--bg-elev-2);
    color: var(--texto);
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

.btn:hover { border-color: var(--cyan); color: var(--cyan); }

.btn svg, .btn i { width: 15px; height: 15px; }

.btn-primary {
    background: var(--cyan);
    border-color: var(--cyan);
    color: #0a0a0a;
}

.btn-primary:hover {
    background: var(--cyan-dark);
    border-color: var(--cyan-dark);
    color: #0a0a0a;
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(101,233,217,0.25);
}

.btn-danger {
    background: #dc2626;
    border-color: #dc2626;
    color: #fff;
}

.btn-danger:hover {
    background: #b91c1c;
    border-color: #b91c1c;
    color: #fff;
}

.btn-sm { padding: 6px 12px; font-size: 0.8rem; }

/* Botões só-ícone em colunas de ação */
.col-acoes .btn-sm {
    padding: 6px 10px;
    min-width: 34px;
    justify-content: center;
}

.col-acoes .btn-sm i,
.col-acoes .btn-sm svg {
    width: 14px;
    height: 14px;
    margin: 0;
}

/* Loader girando */
@keyframes girar {
    to { transform: rotate(360deg); }
}

.btn .lucide-loader-2,
.btn [data-lucide="loader-2"] {
    animation: girar 1s linear infinite;
}

/* =========================================================
   BADGES
   ========================================================= */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-ok        { background: rgba(34,197,94,0.15);  color: #22c55e; }
.badge-off       { background: rgba(220,38,38,0.15);  color: #ef4444; }
.badge-ativa     { background: rgba(34,197,94,0.15);  color: #22c55e; }
.badge-rascunho  { background: rgba(234,179,8,0.15);  color: #eab308; }
.badge-arquivada { background: rgba(107,114,128,0.2); color: #9ca3af; }
.badge-concluido { background: rgba(34,197,94,0.15);  color: #22c55e; }
.badge-parcial   { background: rgba(234,179,8,0.15);  color: #eab308; }
.badge-pulado    { background: rgba(220,38,38,0.15);  color: #ef4444; }
.badge-pendente  { background: rgba(107,114,128,0.2); color: #9ca3af; }
.badge-em_andamento { background: rgba(59,130,246,0.15); color: #3b82f6; }

/* Badges por modalidade (usadas no editor de planilha) */
.badge.modalidade-corrida     { background: rgba(101,233,217,0.15); color: var(--cyan); }
.badge.modalidade-musculacao  { background: rgba(168,85,247,0.15);  color: #a855f7; }
.badge.modalidade-descanso    { background: rgba(107,114,128,0.2);  color: #9ca3af; }
.badge.modalidade-prova       { background: rgba(234,179,8,0.15);   color: #eab308; }
.badge.modalidade-outro       { background: rgba(59,130,246,0.15);  color: #3b82f6; }

/* =========================================================
   UTILITÁRIOS
   ========================================================= */
.vazio {
    text-align: center;
    color: var(--texto-fraco);
    padding: 40px 20px;
    font-size: 0.9rem;
}

.texto-suave { color: var(--texto-suave); font-size: 0.85rem; }
.texto-fraco { color: var(--texto-fraco); }
.texto-perigo { color: #ef4444; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }

/* Avatar inline em listas */
.avatar-lista {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cyan), var(--cyan-dark));
    color: #0a0a0a;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

/* =========================================================
   MODAIS — cabeçalho/rodapé fixos, corpo rolável
   ========================================================= */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 10, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 500;
}

.modal-overlay.aberto { display: flex; }

.modal {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 560px;

    /* Nunca passa da viewport — dvh quando disponível */
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);

    /* Header / body / footer empilhados; só o body rola */
    display: flex;
    flex-direction: column;

    box-shadow: 0 25px 50px rgba(0,0,0,.5);
    animation: aparecer .18s ease-out;
    overflow: hidden;
}

.modal-sm { max-width: 400px; }
.modal-lg { max-width: 720px; }

@keyframes aparecer {
    from { transform: translateY(-8px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.modal-header h2 {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
}

.modal-header h2 svg,
.modal-header h2 i {
    width: 18px;
    height: 18px;
    color: var(--cyan);
    stroke-width: 2.2;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    color: var(--texto-suave);
    transition: color var(--transition);
    padding: 4px 8px;
    border-radius: 6px;
}

.modal-close:hover { color: var(--cyan); }

.modal-body {
    padding: 22px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1 1 auto;
    min-height: 0; /* fundamental para flex + overflow funcionar */
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.modal-body * { max-width: 100%; }

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 22px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
    background: var(--bg-elev);
}

/* =========================================================
   FORMULÁRIOS
   ========================================================= */
.campo {
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.campo label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--texto);
    min-width: 0;
}

.campo label svg,
.campo label i {
    width: 15px;
    height: 15px;
    color: var(--cyan);
    stroke-width: 2.2;
    flex-shrink: 0;
}

.campo input,
.campo textarea,
.campo select {
    padding: 9px 12px;
    border: 1px solid var(--border-forte);
    border-radius: 8px;
    background: var(--bg-input);
    color: var(--texto);
    font-family: inherit;
    font-size: 0.9rem;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.campo input:focus,
.campo textarea:focus,
.campo select:focus {
    outline: none;
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(101,233,217,.15);
}

.campo input.invalido,
.campo textarea.invalido,
.campo select.invalido { border-color: #dc2626; }

.campo textarea {
    resize: vertical;
    min-height: 70px;
}

/* Força inputs de data a respeitarem a largura da coluna */
.campo input[type="date"] {
    min-width: 0;
    width: 100%;
}

.campo.checkbox {
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.campo.checkbox label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    margin: 0;
}

.campo.checkbox input[type="checkbox"] {
    width: auto;
    accent-color: var(--cyan);
}

.campo.checkbox label svg,
.campo.checkbox label i {
    width: 16px;
    height: 16px;
}

.erro {
    color: #ef4444;
    font-size: 0.78rem;
    min-height: 14px;
    margin-top: 3px;
}

.aviso-senha {
    color: var(--texto-fraco);
    font-weight: 400;
    font-size: 0.78rem;
}

/* =========================================================
   LINHAS DE CAMPOS — responsivas, sem overflow
   ========================================================= */
.linha-campos {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.linha-campos.duas {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.linha-campos > .campo { min-width: 0; }

/* Telas médias: 3 → 2 */
@media (max-width: 640px) {
    .linha-campos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Telas pequenas: tudo em 1 coluna */
@media (max-width: 480px) {
    .linha-campos,
    .linha-campos.duas { grid-template-columns: 1fr; }
    .modal { max-height: calc(100dvh - 16px); }
    .modal-body { padding: 16px; }
    .modal-header { padding: 14px 16px; }
    .modal-footer { padding: 12px 16px; }
}

/* Coluna de ações em tabelas */
.col-acoes {
    width: 200px;
    white-space: nowrap;
    text-align: right;
}

.col-acoes .btn { margin-left: 4px; }

/* =========================================================
   FOOTER
   ========================================================= */
.footer-sistema {
    border-top: 1px solid var(--border);
    padding: 20px;
    margin-top: 40px;
}

.footer-inner {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--texto-fraco);
    font-size: 0.85rem;
}

.footer-inner svg { width: 14px; height: 14px; vertical-align: middle; margin-right: 4px; }

.footer-versao { font-size: 0.75rem; }

/* =========================================================
   PÁGINA DE PERFIL
   ========================================================= */
.perfil-topo {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    padding: 22px 26px;
}

.perfil-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cyan), var(--cyan-dark));
    color: #0a0a0a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 800;
    flex-shrink: 0;
    box-shadow: 0 8px 25px rgba(101,233,217,0.25);
}

.perfil-identidade h2 {
    margin: 0 0 4px;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.perfil-badges {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 8px;
    font-size: 0.8rem;
}

.perfil-secao {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 22px 0 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--texto);
}

.perfil-secao svg,
.perfil-secao i {
    width: 16px;
    height: 16px;
    color: var(--cyan);
    stroke-width: 2.2;
}

.perfil-secao:first-child { margin-top: 0; }

@media (max-width: 600px) {
    .perfil-topo { flex-direction: column; text-align: center; }
    .perfil-badges { justify-content: center; }
}

/* =========================================================
   DETALHE DO ALUNO — cards de planilha + progresso + sensação
   ========================================================= */
.cards-planilhas {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.card-planilha {
    background: var(--bg-elev-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: border-color var(--transition), transform var(--transition);
}

.card-planilha:hover {
    border-color: rgba(101,233,217,0.3);
    transform: translateY(-2px);
}

.card-planilha header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.card-planilha h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
}

.info-planilha {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.82rem;
    color: var(--texto-suave);
}

.info-planilha li { padding: 2px 0; }

.progresso {
    height: 6px;
    background: rgba(255,255,255,0.06);
    border-radius: 999px;
    overflow: hidden;
    margin-top: 4px;
}

html[data-tema="light"] .progresso { background: rgba(0,0,0,0.06); }

.progresso-barra {
    height: 100%;
    background: linear-gradient(90deg, var(--cyan), var(--cyan-dark));
    border-radius: 999px;
    transition: width .4s ease;
}

.sensacao { display: inline-flex; gap: 2px; font-size: 0.7rem; }
.sensacao .on  { color: var(--cyan); }
.sensacao .off { color: rgba(255,255,255,0.12); }

html[data-tema="light"] .sensacao .off { color: rgba(0,0,0,0.12); }

/* =========================================================
   EDITOR DE PLANILHA (semanas e dias)
   ========================================================= */
.semana-bloco {
    margin-bottom: 20px;
    padding: 18px 22px;
}

.semana-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.semana-header h2 {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
}

.semana-header h2 svg,
.semana-header h2 i {
    width: 18px;
    height: 18px;
    color: var(--cyan);
}

.semana-acoes {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.semana-acoes .texto-suave {
    margin-right: 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* =========================================================
   TELA DE LOGIN
   ========================================================= */
.tela-login {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--bg);
    position: relative;
    overflow: hidden;
}

.tela-login::before {
    content: '';
    position: absolute;
    top: -20%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(101,233,217,0.18), transparent 60%);
    border-radius: 50%;
    filter: blur(40px);
    pointer-events: none;
}

.tela-login::after {
    content: '';
    position: absolute;
    bottom: -20%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(101,233,217,0.1), transparent 60%);
    border-radius: 50%;
    filter: blur(60px);
    pointer-events: none;
}

.tema-flutuante {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
    background: var(--bg-elev);
    border: 1px solid var(--border);
}

.login-wrap {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    max-width: 1000px;
    width: 100%;
    align-items: center;
    position: relative;
    z-index: 1;
}

.login-marca { padding: 20px; }

.login-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
}

.login-logo .logo-titulo {
    display: block;
    font-weight: 800;
    font-size: 1.3rem;
    color: var(--texto);
    letter-spacing: -0.5px;
    line-height: 1.1;
}

.login-logo .logo-sub {
    display: block;
    font-size: 0.7rem;
    color: var(--cyan);
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-top: 2px;
}

.login-marca h1 {
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.8px;
    margin-bottom: 12px;
    color: var(--texto);
}

.login-tagline {
    color: var(--texto-suave);
    font-size: 1.05rem;
    margin-bottom: 28px;
    max-width: 400px;
}

.login-features {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.login-features li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--texto-suave);
}

.login-features li svg,
.login-features li i {
    width: 18px;
    height: 18px;
    color: var(--cyan);
    flex-shrink: 0;
}

.login-card {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 36px 32px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.35);
    width: 100%;
    max-width: 420px;
    justify-self: center;
}

.login-card h2 {
    margin: 0 0 4px;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: var(--texto);
}

.login-sub {
    margin: 0 0 24px;
    color: var(--texto-suave);
    font-size: 0.9rem;
}

.alerta {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 0.85rem;
    margin-bottom: 18px;
    border: 1px solid transparent;
}

.alerta svg,
.alerta i {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.alerta-erro {
    background: rgba(220,38,38,0.1);
    border-color: rgba(220,38,38,0.3);
    color: #ef4444;
}

.campo-senha {
    position: relative;
    display: flex;
    align-items: center;
}

.campo-senha input {
    padding-right: 44px;
    width: 100%;
}

.btn-olho {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--texto-suave);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition);
}

.btn-olho:hover { color: var(--cyan); }

.btn-olho svg,
.btn-olho i {
    width: 16px;
    height: 16px;
}

.btn-bloco {
    width: 100%;
    justify-content: center;
    margin-top: 8px;
    padding: 12px 20px;
    font-size: 0.95rem;
}

.login-rodape {
    margin: 22px 0 0;
    text-align: center;
    font-size: 0.75rem;
    color: var(--texto-fraco);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

@media (max-width: 860px) {
    .login-wrap {
        grid-template-columns: 1fr;
        gap: 24px;
        max-width: 460px;
    }

    .login-marca { text-align: center; padding: 0; }
    .login-logo { justify-content: center; }
    .login-marca h1 { font-size: 1.6rem; }
    .login-tagline { margin-left: auto; margin-right: auto; font-size: 0.95rem; }
    .login-features { align-items: flex-start; max-width: 280px; margin: 0 auto; }
    .login-card { padding: 28px 24px; }
}

@media (max-width: 480px) {
    .login-marca h1 { font-size: 1.35rem; }
    .login-card { padding: 24px 20px; }
    .tema-flutuante { top: 12px; right: 12px; }
}

/* =========================================================
   RESPONSIVO GERAL
   ========================================================= */
@media (max-width: 900px) {
    .menu-toggle { display: block; order: 3; margin-left: auto; }

    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        background: var(--bg-elev);
        border-bottom: 1px solid var(--border);
        padding: 12px;
        margin: 0;
    }

    .nav-menu.open { display: flex; }

    .nav-menu a { width: 100%; justify-content: flex-start; }

    .navbar-acoes { margin-left: 0; }
    .btn-usuario .usuario-nome { display: none; }

    .page-header h1 { font-size: 1.4rem; }
    .grid-metricas { grid-template-columns: 1fr; }
}

/* =========================================================
   MODAL DE SUCESSO (registrar treino)
   ========================================================= */
.sucesso-modal {
    max-width: 440px;
    padding: 0;
    overflow: hidden;
}

.sucesso-conteudo {
    padding: 32px 28px 24px;
    text-align: center;
}

.sucesso-icone {
    width: 72px;
    height: 72px;
    margin: 0 auto 18px;
    border-radius: 50%;
    background: rgba(101,233,217,0.15);
    border: 2px solid rgba(101,233,217,0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cyan);
    animation: sucessoPop .45s cubic-bezier(.22,1.2,.36,1);
}

.sucesso-icone svg,
.sucesso-icone i {
    width: 38px;
    height: 38px;
    stroke-width: 2.5;
}

@keyframes sucessoPop {
    0%   { transform: scale(0.4); opacity: 0; }
    60%  { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); }
}

.sucesso-conteudo h2 {
    margin: 0 0 6px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--texto);
}

.sucesso-conteudo p {
    margin: 0 0 20px;
    font-size: 0.9rem;
    color: var(--texto-suave);
}

.sucesso-info {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    background: var(--bg-elev-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 8px;
    margin-bottom: 20px;
}

.sucesso-info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
    min-width: 0;
}

.sucesso-info-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--texto-fraco);
    font-weight: 600;
}

.sucesso-info-valor {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--texto);
}

.sucesso-acoes {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.sucesso-acoes .btn {
    flex: 1;
    min-width: 140px;
    justify-content: center;
}

@media (max-width: 480px) {
    .sucesso-conteudo { padding: 24px 20px 20px; }
    .sucesso-icone { width: 64px; height: 64px; margin-bottom: 14px; }
    .sucesso-icone svg,
    .sucesso-icone i { width: 32px; height: 32px; }
    .sucesso-info { grid-template-columns: 1fr; }
    .sucesso-acoes { flex-direction: column; }
    .sucesso-acoes .btn { min-width: 0; }
}

/* =========================================================
   DURAÇÃO EM 3 CAMPOS (H / M / S)
   ========================================================= */
.duracao-campos {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
}

.duracao-item {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    min-width: 0;
}

.duracao-item input {
    width: 100%;
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
    padding: 10px 8px;
    letter-spacing: 1px;
    -moz-appearance: textfield;
}

.duracao-item input::-webkit-outer-spin-button,
.duracao-item input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.duracao-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--texto-fraco);
    text-align: center;
    font-weight: 600;
}

/* =========================================================
   AVISOS (topo do dashboard do aluno)
   ========================================================= */
.aviso {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 18px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    animation: aparecer .25s ease-out;
}

.aviso-icone {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.aviso-icone svg,
.aviso-icone i { width: 22px; height: 22px; }

.aviso-conteudo strong {
    display: block;
    font-size: 0.95rem;
    margin-bottom: 2px;
}

.aviso-conteudo p {
    margin: 0;
    font-size: 0.85rem;
    opacity: 0.85;
}

.aviso-warn {
    background: rgba(234,179,8,0.1);
    border-color: rgba(234,179,8,0.35);
    color: #eab308;
}
.aviso-warn .aviso-icone { background: rgba(234,179,8,0.15); color: #eab308; }

.aviso-danger {
    background: rgba(220,38,38,0.1);
    border-color: rgba(220,38,38,0.35);
    color: #ef4444;
}
.aviso-danger .aviso-icone { background: rgba(220,38,38,0.15); color: #ef4444; }

.aviso-info {
    background: rgba(59,130,246,0.1);
    border-color: rgba(59,130,246,0.35);
    color: #3b82f6;
}
.aviso-info .aviso-icone { background: rgba(59,130,246,0.15); color: #3b82f6; }

@media (max-width: 480px) {
    .aviso { padding: 14px; }
    .aviso-icone { width: 34px; height: 34px; }
    .aviso-icone svg, .aviso-icone i { width: 18px; height: 18px; }
}

/* =========================================================
   FOTO DE PERFIL
   ========================================================= */
.perfil-foto-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.perfil-avatar {
    position: relative;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cyan), var(--cyan-dark));
    color: #0a0a0a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    font-weight: 800;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(101,233,217,0.25);
}

.perfil-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.perfil-avatar .avatar-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.55);
    border: none;
    color: #fff;
    cursor: pointer;
    opacity: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity .2s ease;
}

.perfil-avatar:hover .avatar-overlay { opacity: 1; }

.perfil-avatar .avatar-overlay svg,
.perfil-avatar .avatar-overlay i {
    width: 26px;
    height: 26px;
}

.perfil-foto-acoes {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}

.perfil-foto-acoes .btn {
    justify-content: center;
    width: 100%;
}

.perfil-topo {
    gap: 28px;
}

@media (max-width: 600px) {
    .perfil-avatar { width: 80px; height: 80px; font-size: 1.8rem; }
    .perfil-foto-acoes { flex-direction: row; }
    .perfil-foto-acoes .btn { width: auto; }
}

/* =========================================================
   AVATAR COM FOTO NA NAVBAR
   ========================================================= */
.avatar-foto {
    object-fit: cover;
    display: block;
    background: var(--bg-elev-2);
}

.avatar-md {
    width: 42px;
    height: 42px;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.usuario-info-topo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.usuario-info-texto {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.usuario-info-texto strong {
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.usuario-info-texto span {
    font-size: 0.78rem;
    color: var(--texto-suave);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-usuario .avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
}

.btn-usuario .avatar-foto {
    width: 32px;
    height: 32px;
}

.avatar-lista.avatar-foto,
img.avatar-lista.avatar-foto {
    object-fit: cover;
    display: inline-block;
    background: var(--bg-elev-2);
    vertical-align: middle;
}

/* =========================================================
   BADGE CLICÁVEL "EDITADA POR ADMIN"
   ========================================================= */
.badge-warn-clicavel {
    background: rgba(234,179,8,0.15);
    color: #eab308;
    border: 1px solid rgba(234,179,8,0.4);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: inherit;
    transition: all .2s ease;
}

.badge-warn-clicavel:hover {
    background: rgba(234,179,8,0.28);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(234,179,8,0.25);
}

.badge-warn-clicavel:disabled { cursor: wait; }

/* =========================================================
   PAGINAÇÃO (auditoria)
   ========================================================= */
.paginacao {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.paginacao .btn {
    padding: 6px 12px;
    font-size: 0.82rem;
}

/* =========================================================
   RELATÓRIOS
   ========================================================= */
canvas { max-width: 100%; }

[data-metrica] {
    min-width: 100px;
    justify-content: center;
}

@media (max-width: 600px) {
    [data-metrica] {
        min-width: 0;
        flex: 1;
        font-size: 0.75rem;
        padding: 6px 8px;
    }
}

/* =========================================================
   ABAS
   ========================================================= */
.abas {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.abas::-webkit-scrollbar { display: none; }

.aba {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--texto-suave);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all .2s ease;
}

.aba svg,
.aba i {
    width: 16px;
    height: 16px;
}

.aba:hover { color: var(--texto); }

.aba.ativa {
    color: var(--cyan);
    border-bottom-color: var(--cyan);
}

/* =========================================================
   CARDS DE EXPORTAÇÃO
   ========================================================= */
.card-export {
    background: var(--bg-elev-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: border-color var(--transition);
}

.card-export:hover { border-color: var(--border-forte); }

.card-export-icone {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(101,233,217,0.12);
    color: var(--cyan);
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-export-icone svg,
.card-export-icone i {
    width: 22px;
    height: 22px;
}

.card-export h3 {
    margin: 0 0 4px;
    font-size: 1.05rem;
    font-weight: 700;
}

.card-export p {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.5;
}

.card-export .btn {
    align-self: flex-start;
    margin-top: 4px;
}

@media (max-width: 600px) {
    .aba { padding: 8px 12px; font-size: 0.82rem; }
    .card-export .btn { align-self: stretch; justify-content: center; }
}

/* =========================================================
   ALERTAS DE SUCESSO / INFO (admin_config)
   ========================================================= */
.alerta-sucesso {
    background: rgba(34,197,94,0.1);
    border-color: rgba(34,197,94,0.35);
    color: #22c55e;
}
.alerta-info {
    background: rgba(59,130,246,0.1);
    border-color: rgba(59,130,246,0.35);
    color: #3b82f6;
}

/* Color input */
.campo input[type="color"] {
    height: 42px;
    padding: 4px;
    cursor: pointer;
}

/* =========================================================
   GRID DE TEMPLATES / EXERCÍCIOS / FICHAS
   ========================================================= */
.grid-templates {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}

.card-template {
    display: flex;
    flex-direction: column;
    background: var(--bg-elev-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    text-align: left;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
    color: var(--texto);
    transition: all .2s ease;
    width: 100%;
}

.card-template:hover {
    border-color: var(--cyan);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(101,233,217,.1);
}

.card-template-faixa { height: 6px; }

.card-template-corpo {
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
}

.card-template h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.2px;
}

.card-template-icone {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.card-template-icone svg,
.card-template-icone i {
    width: 24px;
    height: 24px;
    stroke-width: 2;
}

.card-template-img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 12px;
    flex-shrink: 0;
}

.card-template-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.grid-exercicios {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.card-exercicio {
    background: var(--bg-elev-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: border-color .2s ease, transform .2s ease;
}

.card-exercicio:hover {
    border-color: rgba(101,233,217,0.3);
    transform: translateY(-2px);
}

.card-exercicio-topo {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.card-exercicio-icone {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(101,233,217,0.12);
    color: var(--cyan);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.card-exercicio-icone svg,
.card-exercicio-icone i {
    width: 20px;
    height: 20px;
}

.card-exercicio h3 {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-exercicio-acoes {
    display: flex;
    gap: 6px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.grid-fichas {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 14px;
}

.card-ficha {
    background: var(--bg-elev-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: border-color .2s ease, transform .2s ease;
}

.card-ficha:hover {
    border-color: rgba(101,233,217,0.3);
    transform: translateY(-2px);
}

.card-ficha.inativa { opacity: 0.6; }

.card-ficha-topo {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.card-ficha-letra {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--cyan), var(--cyan-dark));
    color: #0a0a0a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.card-ficha h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-ficha-meta,
.card-ficha-acoes {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

@media (max-width: 600px) {
    .grid-templates,
    .grid-exercicios,
    .grid-fichas {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   ITENS DA FICHA (editor)
   ========================================================= */
.item-ficha {
    margin-bottom: 10px;
    padding: 14px 18px;
}

.item-ficha-linha {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.item-ficha-numero {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.item-ficha-ordem {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(101,233,217,0.15);
    color: var(--cyan);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.78rem;
}

.item-ficha-info {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.item-ficha-detalhes {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.tag-detalhe {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    font-size: 0.72rem;
    color: var(--texto-suave);
    font-weight: 600;
}

.item-ficha-acoes {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.item-ficha-acoes .btn {
    padding: 5px 8px;
    min-width: 32px;
    justify-content: center;
}

.item-ficha-acoes .btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

@media (max-width: 640px) {
    .item-ficha-linha {
        flex-direction: column;
        align-items: flex-start;
    }
    .item-ficha-acoes {
        align-self: flex-end;
    }
}

/* =========================================================
   TREINO DE MUSCULAÇÃO (aluno)
   ========================================================= */
.card-exercicio-aluno {
    margin-bottom: 14px;
    padding: 16px 20px;
}

.meta-exercicio {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.tabela-series-wrap {
    overflow-x: auto;
    margin-top: 8px;
    border-radius: var(--radius);
    -webkit-overflow-scrolling: touch;
}

.tabela-series {
    width: 100%;
    border-collapse: collapse;
    min-width: 520px;
}

.tabela-series th,
.tabela-series td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
}

.tabela-series thead th {
    background: var(--bg-elev-2);
    color: var(--texto-suave);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.5px;
}

.tabela-series tbody tr:last-child td { border-bottom: none; }

.input-serie {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid var(--border-forte);
    border-radius: 8px;
    background: var(--bg-input);
    color: var(--texto);
    font-family: inherit;
    font-size: 0.9rem;
    text-align: center;
    transition: border-color .2s ease;
}

.input-serie:focus {
    outline: none;
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(101,233,217,.15);
}

.acoes-form-fixo {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding: 16px 0 0;
    position: sticky;
    bottom: 0;
    background: linear-gradient(180deg, transparent 0%, var(--bg) 40%);
    padding-top: 24px;
    margin-top: 8px;
}

@media (max-width: 640px) {
    .acoes-form-fixo {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
        background: var(--bg-elev);
        border-top: 1px solid var(--border);
        z-index: 50;
        justify-content: stretch;
    }
    .acoes-form-fixo .btn {
        flex: 1;
        justify-content: center;
    }
    .page-wrap { padding-bottom: 90px; }
}

/* =========================================================
   RELATÓRIO DE MUSCULAÇÃO
   ========================================================= */
#ex_musc_select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-forte);
    border-radius: 8px;
    background: var(--bg-input);
    color: var(--texto);
    font-family: inherit;
    font-size: 0.92rem;
}

[data-ex-metrica] {
    min-width: 110px;
    justify-content: center;
}

@media (max-width: 640px) {
    [data-ex-metrica] {
        min-width: 0;
        flex: 1;
        font-size: 0.75rem;
        padding: 6px 8px;
    }
}

/* =========================================================
   PLAYER DE TREINO (aluno / musculação)
   ========================================================= */
.estado-treino { animation: fadeIn .25s ease-out; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.estado-treino-conteudo {
    text-align: center;
    padding: 40px 20px;
}

.estado-treino-icone {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(101,233,217,0.15);
    color: var(--cyan);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
}

.estado-treino-icone svg,
.estado-treino-icone i {
    width: 36px;
    height: 36px;
}

.btn-lg {
    padding: 14px 32px;
    font-size: 1rem;
}

.player-progresso-topo {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 16px;
    position: sticky;
    top: 8px;
    z-index: 10;
}

.player-progresso-info {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
    gap: 12px;
    flex-wrap: wrap;
}

.player-progresso-texto {
    font-size: 0.9rem;
    color: var(--texto-suave);
}

.player-barra {
    height: 6px;
    background: rgba(255,255,255,0.06);
    border-radius: 999px;
    overflow: hidden;
}

.player-barra-inner {
    height: 100%;
    background: linear-gradient(90deg, var(--cyan), var(--cyan-dark));
    border-radius: 999px;
    transition: width .35s ease;
    width: 0;
}

.player-card {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 22px;
    margin-bottom: 20px;
    animation: fadeIn .2s ease-out;
}

.player-card-pulado { opacity: 0.5; }

.player-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 14px;
}

.player-card-numero {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(101,233,217,0.15);
    color: var(--cyan);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.player-card-icone {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: rgba(101,233,217,0.12);
    color: var(--cyan);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.player-card-icone svg,
.player-card-icone i {
    width: 22px;
    height: 22px;
}

.player-card-titulo {
    flex: 1;
    min-width: 0;
}

.player-card-titulo h3 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.player-btn-pular {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid var(--border-forte);
    background: transparent;
    color: var(--texto-suave);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s ease;
}

.player-btn-pular:hover {
    border-color: #eab308;
    color: #eab308;
}

.player-btn-pular svg,
.player-btn-pular i {
    width: 14px;
    height: 14px;
}

.player-card-ultima {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(101,233,217,0.06);
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 0.85rem;
    color: var(--cyan);
}

.player-card-ultima svg,
.player-card-ultima i {
    width: 14px;
    height: 14px;
}

.player-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}

.player-card-instrucoes {
    font-size: 0.85rem;
    color: var(--texto-suave);
    margin: 0 0 10px;
    padding: 10px 12px;
    background: var(--bg-elev-2);
    border-radius: 8px;
    display: flex;
    gap: 8px;
}

.player-card-instrucoes svg,
.player-card-instrucoes i {
    width: 14px;
    height: 14px;
    color: var(--cyan);
    flex-shrink: 0;
    margin-top: 2px;
}

.player-card-obs-personal {
    font-size: 0.85rem;
    color: #eab308;
    margin: 0 0 14px;
    padding: 10px 12px;
    background: rgba(234,179,8,0.08);
    border-left: 3px solid #eab308;
    border-radius: 4px;
    display: flex;
    gap: 8px;
}

.player-card-obs-personal svg,
.player-card-obs-personal i {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    margin-top: 2px;
}

.player-series { margin-bottom: 16px; }

.player-series-cabecalho {
    display: grid;
    grid-template-columns: 50px 1fr 1fr 56px;
    gap: 10px;
    padding: 0 4px 8px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--texto-fraco);
}

.player-serie-linha {
    display: grid;
    grid-template-columns: 50px 1fr 1fr 56px;
    gap: 10px;
    align-items: center;
    padding: 8px 4px;
    border-top: 1px solid var(--border);
}

.player-serie-num {
    text-align: center;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--cyan);
}

.player-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-forte);
    border-radius: 8px;
    background: var(--bg-input);
    color: var(--texto);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
}

.player-input:focus {
    outline: none;
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(101,233,217,.15);
}

.player-checkbox-serie {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.player-checkbox-serie input { display: none; }

.player-checkbox-serie span {
    width: 28px;
    height: 28px;
    border: 2px solid var(--border-forte);
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all .2s ease;
}

.player-checkbox-serie input:checked + span {
    background: var(--cyan);
    border-color: var(--cyan);
}

.player-checkbox-serie input:checked + span::after {
    content: '✓';
    color: #0a0a0a;
    font-weight: 800;
    font-size: 1rem;
}

.player-card-observacao { margin-bottom: 16px; }

.player-card-observacao label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--texto);
    margin-bottom: 6px;
}

.player-card-observacao label svg,
.player-card-observacao label i {
    width: 14px;
    height: 14px;
    color: var(--cyan);
}

.player-card-observacao textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-forte);
    border-radius: 8px;
    background: var(--bg-input);
    color: var(--texto);
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
}

.player-card-observacao textarea:focus {
    outline: none;
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(101,233,217,.15);
}

.player-card-nav {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.player-card-nav .btn {
    flex: 1;
    justify-content: center;
    max-width: 220px;
}

.player-acoes-fixas { display: none; }

@media (max-width: 640px) {
    .player-acoes-fixas {
        display: flex;
        gap: 8px;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
        background: var(--bg-elev);
        border-top: 1px solid var(--border);
        z-index: 50;
    }
    .player-acoes-fixas .btn {
        flex: 1;
        justify-content: center;
    }
    .page-wrap { padding-bottom: 90px; }
}

.resumo-treino {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.resumo-item {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    background: var(--bg-elev-2);
}

.resumo-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.resumo-item-series {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.resumo-serie-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    font-size: 0.78rem;
    color: var(--texto-suave);
    font-weight: 600;
}

@media (max-width: 640px) {
    .player-card { padding: 16px; }
    .player-card-titulo h3 { font-size: 1rem; }
    .player-series-cabecalho,
    .player-serie-linha {
        grid-template-columns: 40px 1fr 1fr 48px;
        gap: 6px;
    }
    .player-input {
        padding: 10px 8px;
        font-size: 1rem;
    }
    .player-card-nav { flex-wrap: wrap; }
    .player-card-nav .btn { max-width: none; }
}

/* =========================================================
   CARROSSEL / DOTS / TIMER
   ========================================================= */
.player-carrossel {
    touch-action: pan-y;
    position: relative;
    overflow: hidden;
}

.player-card {
    transition: transform .25s ease, opacity .25s ease;
    will-change: transform, opacity;
}

.player-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 20px 0 24px;
    flex-wrap: wrap;
}

.player-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
    background: var(--border-forte);
    cursor: pointer;
    padding: 0;
    transition: all .2s ease;
}

.player-dot.ativo {
    background: var(--cyan);
    width: 24px;
    border-radius: 999px;
}

.player-dot:hover { background: var(--cyan-dark); }

/* =========================================================
   TIMER DE DESCANSO FLUTUANTE
   ========================================================= */
.timer-descanso {
    position: fixed;
    bottom: calc(90px + env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    opacity: 0;
    transition: opacity .25s ease, transform .25s ease;
    z-index: 200;
    width: 90%;
    max-width: 340px;
    pointer-events: none;
}

.timer-descanso.aberto {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.timer-descanso-inner {
    background: linear-gradient(135deg, #0a0a0a, #1a1a2e);
    border: 2px solid var(--cyan);
    border-radius: 16px;
    padding: 16px 20px 20px;
    box-shadow: 0 20px 50px rgba(0,0,0,.5), 0 0 30px rgba(101,233,217,.15);
    position: relative;
    text-align: center;
}

.timer-btn-fechar {
    position: absolute;
    top: 8px;
    right: 8px;
    background: transparent;
    border: none;
    color: var(--texto-suave);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: color .2s ease;
}

.timer-btn-fechar:hover { color: #ef4444; }

.timer-btn-fechar svg,
.timer-btn-fechar i { width: 16px; height: 16px; }

.timer-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--cyan);
    font-weight: 700;
    margin-bottom: 6px;
}

.timer-tempo {
    font-size: 3rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -2px;
    line-height: 1;
    margin-bottom: 12px;
    font-variant-numeric: tabular-nums;
}

.timer-btn-pular {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(101,233,217,0.12);
    color: var(--cyan);
    border: 1px solid rgba(101,233,217,0.35);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s ease;
}

.timer-btn-pular:hover { background: rgba(101,233,217,0.2); }

.timer-btn-pular svg,
.timer-btn-pular i {
    width: 14px;
    height: 14px;
}

.timer-progresso {
    margin-top: 14px;
    height: 4px;
    background: rgba(255,255,255,0.08);
    border-radius: 999px;
    overflow: hidden;
}

.timer-progresso-inner {
    height: 100%;
    background: var(--cyan);
    border-radius: 999px;
    width: 0;
    transition: width 1s linear;
}

@media (max-width: 480px) {
    .timer-tempo { font-size: 2.5rem; }
    .timer-descanso { bottom: calc(100px + env(safe-area-inset-bottom)); }
}

/* =========================================================
   BADGE DE VELOCIDADE
   ========================================================= */
.badge-velocidade {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 600;
}
.badge-velocidade.mais-rapido {
    background: rgba(34,197,94,.15);
    color: #22c55e;
}
.badge-velocidade.mais-lento {
    background: rgba(239,68,68,.15);
    color: #ef4444;
}

/* =========================================================
   MARCA — ícone + texto (navbar + login)
   ========================================================= 
.logo-icon {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #22d3ee, #3b82f6);
    color: #0f172a;
    flex-shrink: 0;
    box-shadow: 0 6px 16px -6px rgba(34, 211, 238, 0.45);
}
*/

.logo-icon svg { display: block; }

.login-logo .logo-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
}

.logo-titulo {
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
}
.logo-ponto { color: #22d3ee; }
[data-tema="light"] .logo-ponto { color: #0891b2; }

.login-marca-mobile {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 22px;
}
.login-marca-mobile .logo-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
}
.login-marca-mobile .logo-titulo { font-size: 1.15rem; }

@media (max-width: 860px) {
    .login-marca[data-so-desktop] { display: none; }
    .login-marca-mobile { display: flex; }
    .login-wrap { grid-template-columns: 1fr; place-items: center; padding: 20px; }
    .login-card { width: 100%; max-width: 420px; }
}

/* =========================================================
   LOGIN — linha "lembrar + recuperar"
   ========================================================= */
.login-opcoes {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 4px 0 18px;
    font-size: 0.875rem;
}
.check-lembrar {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    color: var(--texto-suave);
}
.check-lembrar input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #22d3ee;
    cursor: pointer;
}
.link-recuperar {
    color: #22d3ee;
    text-decoration: none;
    font-weight: 500;
    transition: opacity .15s;
}
.link-recuperar:hover {
    opacity: .8;
    text-decoration: underline;
}
@media (max-width: 380px) {
    .login-opcoes { flex-direction: column; align-items: flex-start; }
}

/* =========================================================
   SUBMENUS DO NAV (dropdown)
   Desktop: hover CSS puro
   Mobile:  clique via JS (.aberto)
   ========================================================= */

ul.nav-menu > li.nav-grupo {
    position: relative;
    display: block;
    list-style: none;
}

ul.nav-menu > li.nav-grupo > a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 8px;
    color: var(--texto-suave);
    font-weight: 500;
    font-size: 0.9rem;
    transition: all var(--transition);
    cursor: pointer;
    user-select: none;
    text-decoration: none;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}

ul.nav-menu > li.nav-grupo > a:hover,
ul.nav-menu > li.nav-grupo.aberto > a {
    background: rgba(101,233,217,0.08);
    color: var(--cyan);
}

ul.nav-menu > li.nav-grupo.ativo > a {
    background: rgba(101,233,217,0.15);
    color: var(--cyan);
    font-weight: 600;
}

ul.nav-menu > li.nav-grupo > a .chevron {
    width: 12px;
    height: 12px;
    transition: transform .2s ease;
    opacity: .7;
    flex-shrink: 0;
    stroke-width: 2.4;
    margin-left: 2px;
}

ul.nav-menu > li.nav-grupo.aberto > a .chevron,
ul.nav-menu > li.nav-grupo:hover > a .chevron {
    transform: rotate(180deg);
}

/* Submenu: escondido por padrão */
ul.nav-menu > li.nav-grupo > ul.submenu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    padding-top: 6px; /* mantém o mouse dentro do grupo (evita o gap) */

    display: none;
    flex-direction: column;
    gap: 2px;

    z-index: 250;
    list-style: none;
    margin: 0;
}

/* Card interno do submenu (o padding-top do UL não conta como borda) */
ul.nav-menu > li.nav-grupo > ul.submenu::before {
    content: '';
    position: absolute;
    inset: 6px 0 0 0;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--sombra);
    z-index: -1;
}

/* Quando a classe .aberto está no <li> (mobile/JS) */
ul.nav-menu > li.nav-grupo.aberto > ul.submenu {
    display: flex;
}

/* No DESKTOP: hover no <li> abre o submenu */
@media (min-width: 901px) {
    ul.nav-menu > li.nav-grupo:hover > ul.submenu {
        display: flex;
    }
    ul.nav-menu > li.nav-grupo:hover > a {
        background: rgba(101,233,217,0.08);
        color: var(--cyan);
    }
}

ul.nav-menu > li.nav-grupo > ul.submenu > li {
    display: block;
    list-style: none;
    padding: 0 6px;
    margin: 0;
}

ul.nav-menu > li.nav-grupo > ul.submenu a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    width: 100%;
    box-sizing: border-box;

    color: var(--texto-suave);
    font-size: 0.86rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;

    transition: background .2s ease, color .2s ease;
}

ul.nav-menu > li.nav-grupo > ul.submenu a svg,
ul.nav-menu > li.nav-grupo > ul.submenu a i {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    stroke-width: 2;
}

ul.nav-menu > li.nav-grupo > ul.submenu a:hover {
    background: rgba(101,233,217,0.08);
    color: var(--cyan);
}

ul.nav-menu > li.nav-grupo > ul.submenu a.ativo {
    background: rgba(101,233,217,0.15);
    color: var(--cyan);
    font-weight: 600;
}

ul.nav-menu > li.nav-grupo > ul.submenu .nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    margin-left: auto;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1;
}

/* ===== MOBILE: acordeão ===== */
@media (max-width: 900px) {

    ul.nav-menu > li.nav-grupo {
        width: 100%;
    }

    ul.nav-menu > li.nav-grupo > a {
        width: 100%;
        justify-content: space-between;
        padding: 12px 14px;
        font-size: 0.95rem;
    }

    /* Reseta o wrapper visual do desktop */
    ul.nav-menu > li.nav-grupo > ul.submenu {
        position: static;
        min-width: 0;
        padding-top: 0;
        margin: 4px 0 4px 12px;
        padding-left: 8px;
        border-left: 2px solid var(--border);
        display: none;
        flex-direction: column;
        gap: 2px;
    }

    ul.nav-menu > li.nav-grupo > ul.submenu::before {
        display: none;
    }

    ul.nav-menu > li.nav-grupo > ul.submenu > li {
        padding: 0;
    }

    /* No mobile, o hover não abre — só a classe .aberto */
    ul.nav-menu > li.nav-grupo.aberto > ul.submenu {
        display: flex;
    }

    ul.nav-menu > li.nav-grupo:hover > ul.submenu {
        display: none;
    }
    ul.nav-menu > li.nav-grupo.aberto:hover > ul.submenu {
        display: flex;
    }

    ul.nav-menu > li.nav-grupo > ul.submenu a {
        font-size: 0.88rem;
        padding: 10px 12px;
    }
}

/* =========================================================
   DASHBOARD ADMIN — gráficos e cards enriquecidos
   ========================================================= */
.metrica-card-grafico {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
}

.metrica-card-grafico .metrica-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.mini-donut {
    width: 72px;
    height: 72px;
    flex-shrink: 0;
    color: var(--cyan);
}

.mini-donut svg {
    display: block;
    width: 100%;
    height: 100%;
}

.sparkline {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 48px;
    flex-shrink: 0;
}

.sparkline-bar {
    width: 6px;
    background: rgba(101,233,217,0.35);
    border-radius: 2px;
    transition: background .2s ease;
    min-height: 3px;
}

.sparkline-bar.hoje { background: var(--cyan); }
.sparkline-bar:hover { background: var(--cyan-dark); }

.dash-alertas {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.dash-alerta {
    flex: 1;
    min-width: 260px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    text-decoration: none;
    transition: transform .2s ease, box-shadow .2s ease;
}

.dash-alerta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,.2);
}

.dash-alerta-icone {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dash-alerta-icone svg,
.dash-alerta-icone i { width: 20px; height: 20px; }

.dash-alerta-conteudo {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.dash-alerta-conteudo strong {
    font-size: 0.95rem;
    line-height: 1.3;
}

.dash-alerta-conteudo span {
    font-size: 0.82rem;
    opacity: .85;
}

.dash-alerta.warn {
    background: rgba(234,179,8,0.08);
    border-color: rgba(234,179,8,0.35);
    color: #eab308;
}
.dash-alerta.warn .dash-alerta-icone { background: rgba(234,179,8,0.15); color: #eab308; }

.dash-alerta.info {
    background: rgba(34,211,238,0.08);
    border-color: rgba(34,211,238,0.35);
    color: #22d3ee;
}
.dash-alerta.info .dash-alerta-icone { background: rgba(34,211,238,0.15); color: #22d3ee; }

.dash-alerta.danger {
    background: rgba(239,68,68,0.08);
    border-color: rgba(239,68,68,0.35);
    color: #ef4444;
}
.dash-alerta.danger .dash-alerta-icone { background: rgba(239,68,68,0.15); color: #ef4444; }

.grid-graficos {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 900px) {
    .grid-graficos { grid-template-columns: 1fr; }
}

.grafico-barras {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 180px;
    padding: 12px 0 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
    overflow-x: auto;
}

.grafico-barras-col {
    flex: 1;
    min-width: 22px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    height: 100%;
    justify-content: flex-end;
    position: relative;
    cursor: default;
}

.grafico-barras-col .barra {
    width: 100%;
    max-width: 32px;
    background: linear-gradient(180deg, var(--cyan), var(--cyan-dark));
    border-radius: 4px 4px 0 0;
    min-height: 4px;
    transition: opacity .2s ease;
    position: relative;
}

.grafico-barras-col:hover .barra { opacity: .85; }

.grafico-barras-col .valor {
    position: absolute;
    top: -20px;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--cyan);
    opacity: 0;
    transition: opacity .15s ease;
    white-space: nowrap;
}

.grafico-barras-col:hover .valor { opacity: 1; }

.grafico-barras-col .dia {
    font-size: 0.68rem;
    color: var(--texto-fraco);
    font-weight: 600;
    text-transform: uppercase;
    margin-top: 2px;
}

.grafico-legenda {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.8rem;
    color: var(--texto-suave);
    margin-top: 12px;
}

.grafico-legenda-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.grafico-legenda-cor {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    flex-shrink: 0;
}

.donut-grande-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.donut-grande {
    position: relative;
    width: 180px;
    height: 180px;
}

.donut-grande svg {
    display: block;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.donut-grande-centro {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.donut-grande-valor {
    font-size: 1.9rem;
    font-weight: 800;
    line-height: 1;
    color: var(--texto);
}

.donut-grande-label {
    font-size: 0.75rem;
    color: var(--texto-suave);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.donut-lista {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.donut-lista-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 0.85rem;
}

.donut-lista-item .esquerda {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.donut-lista-item .cor {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    flex-shrink: 0;
}

.donut-lista-item .nome {
    color: var(--texto);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.donut-lista-item .qtd {
    color: var(--texto-suave);
    font-weight: 600;
    flex-shrink: 0;
}

.metrica-extra {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--texto-suave);
    margin-top: 6px;
}

.metrica-extra strong {
    color: var(--cyan);
    font-weight: 700;
}

.trend-up { color: #22c55e; font-weight: 600; }
.trend-down { color: #ef4444; font-weight: 600; }
.trend-flat { color: var(--texto-fraco); font-weight: 600; }

/* =========================================================
   BANNER DE STATUS DO PLANO (personal)
   ========================================================= */
.banner-plano {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.banner-plano-conteudo {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.banner-plano-conteudo > svg,
.banner-plano-conteudo > i {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    stroke-width: 2.2;
}

.banner-plano-texto {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.banner-plano-texto strong {
    font-size: 0.95rem;
    line-height: 1.3;
    color: var(--texto);
}

.banner-plano-texto span {
    font-size: 0.83rem;
    color: var(--texto-suave);
    line-height: 1.4;
}

.banner-plano-lg { padding: 18px 22px; }

.banner-plano-lg .banner-plano-conteudo > svg,
.banner-plano-lg .banner-plano-conteudo > i {
    width: 26px;
    height: 26px;
}

.banner-plano-lg .banner-plano-texto strong { font-size: 1.05rem; }
.banner-plano-lg .banner-plano-texto span   { font-size: 0.88rem; }

@media (max-width: 600px) {
    .banner-plano {
        flex-direction: column;
        align-items: flex-start;
    }
    .banner-plano .btn {
        width: 100%;
        justify-content: center;
    }
}

/* =========================================================
   BADGE DE NOTIFICAÇÕES — pulsar
   ========================================================= */
.nav-notif-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    font-size: .65rem;
    font-weight: 700;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-elev);
    line-height: 1;
    box-shadow: 0 0 0 1px rgba(239,68,68,.35), 0 2px 8px rgba(239,68,68,.5);
    animation: pulse-badge 1.8s ease-in-out infinite;
    transform-origin: center;
    z-index: 2;
}

@keyframes pulse-badge {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 1px rgba(239,68,68,.35), 0 2px 8px rgba(239,68,68,.5);
    }
    50% {
        transform: scale(1.15);
        box-shadow: 0 0 0 3px rgba(239,68,68,.18), 0 4px 12px rgba(239,68,68,.65);
    }
}

@media (prefers-reduced-motion: reduce) {
    .nav-notif-badge { animation: none; }
}

/* =========================================================
   RADIO CARD
   ========================================================= */
.radio-card {
    display: flex !important;
    align-items: flex-start !important;
    gap: 10px !important;
    cursor: pointer;
    margin: 0 !important;
    padding: 12px 14px;
    border-radius: 8px;
    transition: background .15s ease;
}

.radio-card:hover { background: rgba(101,233,217,0.04); }

.radio-card input[type="radio"] {
    width: auto !important;
    margin: 4px 0 0 0 !important;
    flex-shrink: 0;
    accent-color: var(--cyan);
}

.radio-card-texto {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.radio-card-texto strong {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--texto);
    line-height: 1.3;
}

.radio-card-texto span {
    font-size: 0.83rem;
    color: var(--texto-suave);
    line-height: 1.4;
}

/* =========================================================
   COMPARATIVO — recordes, tendência, variações
   ========================================================= */
.grid-recordes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.recorde-card {
    background: var(--bg-elev-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    text-align: center;
    transition: transform .2s ease, border-color .2s ease;
}

.recorde-card:hover {
    transform: translateY(-2px);
    border-color: rgba(101,233,217,0.4);
}

.recorde-icone {
    width: 40px;
    height: 40px;
    margin: 0 auto 10px;
    border-radius: 50%;
    background: rgba(101,233,217,0.12);
    color: var(--cyan);
    display: flex;
    align-items: center;
    justify-content: center;
}

.recorde-icone svg,
.recorde-icone i { width: 20px; height: 20px; }

.recorde-valor {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--texto);
    letter-spacing: -0.5px;
    line-height: 1.1;
}

.recorde-valor small {
    font-size: 0.55em;
    color: var(--texto-suave);
    font-weight: 600;
}

.recorde-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--texto-fraco);
    font-weight: 600;
    margin-top: 4px;
}

.recorde-data {
    font-size: 0.7rem;
    color: var(--texto-fraco);
    margin-top: 6px;
}

.cmp-positivo {
    color: #22c55e;
    font-weight: 700;
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(34,197,94,0.12);
}

.cmp-negativo {
    color: #ef4444;
    font-weight: 700;
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(220,38,38,0.12);
}

.cmp-neutro {
    color: var(--texto-fraco);
    font-size: 0.75rem;
}

.tabela-cmp { font-size: 0.9rem; }

.tabela-cmp th {
    text-align: left;
    padding: 10px 12px;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--texto-fraco);
    border-bottom: 1px solid var(--border);
}

.tabela-cmp th:last-child,
.tabela-cmp td:last-child { text-align: right; }

.tabela-cmp td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
}

.tabela-cmp tr.cmp-secao td {
    background: var(--bg-elev-2);
    font-weight: 700;
    color: var(--cyan);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 12px;
}

.tabela-cmp .cmp-val { font-weight: 600; }
.tabela-cmp .cmp-var { text-align: right; }

.donut-wrap {
    position: relative;
    height: 220px;
    max-width: 280px;
    margin: 0 auto;
}

.recorde-linha {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-elev-2);
    border-radius: var(--radius);
    font-size: 0.85rem;
}

.recorde-linha svg,
.recorde-linha i {
    width: 16px;
    height: 16px;
    color: var(--cyan);
    flex-shrink: 0;
}

.recorde-linha span {
    flex: 1;
    color: var(--texto-suave);
}

.recorde-linha strong {
    color: var(--texto);
    font-weight: 700;
}

@media (max-width: 600px) {
    .grid-recordes {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .recorde-card { padding: 12px 10px; }
    .recorde-valor { font-size: 1.15rem; }

    .donut-wrap { height: 180px; max-width: 220px; }

    .tabela-cmp th,
    .tabela-cmp td {
        padding: 8px 8px;
        font-size: 0.82rem;
    }

    .tabela-cmp th:nth-child(2),
    .tabela-cmp td.cmp-val { font-size: 0.8rem; }

    .bloco-header {
        flex-wrap: wrap;
        gap: 8px;
    }

    .bloco-header .btn-sm {
        font-size: 0.75rem;
        padding: 5px 10px;
    }
}

/* =========================================================
   =========================================================
   MELHORIAS MOBILE PARA A ÁREA DO ALUNO
   (adicionado depois — não altera nada acima)
   =========================================================
   ========================================================= */

/* ---------------------------------------------------------
   1. BOTTOM NAV — só mobile, só aluno
   --------------------------------------------------------- */
.bottom-nav {
    display: none;
}

@media (max-width: 900px) {
    .bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: calc(58px + env(safe-area-inset-bottom));
        padding-bottom: env(safe-area-inset-bottom);
        background: var(--bg-elev);
        border-top: 1px solid var(--border);
        z-index: 90;
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }

    .bottom-nav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        color: var(--texto-suave);
        font-size: 0.68rem;
        font-weight: 600;
        text-decoration: none;
        -webkit-tap-highlight-color: transparent;
        transition: color .15s ease;
        position: relative;
    }

    .bottom-nav-item svg,
    .bottom-nav-item i {
        width: 22px;
        height: 22px;
        stroke-width: 2;
        transition: transform .15s ease;
    }

    .bottom-nav-item.ativo { color: var(--cyan); }
    .bottom-nav-item.ativo svg { transform: translateY(-1px); }
    .bottom-nav-item:active { background: rgba(101,233,217,0.08); }

    /* Espaço para o conteúdo não ficar atrás da nav */
    body:has(.bottom-nav) .page-wrap {
        padding-bottom: calc(80px + env(safe-area-inset-bottom));
    }
    body:has(.bottom-nav) .footer-sistema {
        padding-bottom: calc(80px + env(safe-area-inset-bottom));
    }

    /* Esconde a bottom nav no player (que tem a própria barra) */
    body.player-body .bottom-nav { display: none !important; }
}

/* Fallback para navegadores sem :has() */
@supports not selector(:has(*)) {
    @media (max-width: 900px) {
        .page-wrap { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
    }
}

/* ---------------------------------------------------------
   2. TABELA RESPONSIVA — vira cards no mobile
   --------------------------------------------------------- */
@media (max-width: 700px) {
    .tabela-responsiva thead {
        display: none;
    }

    .tabela-responsiva,
    .tabela-responsiva tbody,
    .tabela-responsiva tr,
    .tabela-responsiva td {
        display: block;
        width: 100%;
    }

    .tabela-responsiva tr {
        background: var(--bg-elev);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        margin-bottom: 12px;
        padding: 12px 14px;
        position: relative;
    }

    .tabela-responsiva td {
        border: none;
        padding: 5px 0;
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        font-size: 0.88rem;
        text-align: right;
    }

    .tabela-responsiva td::before {
        content: attr(data-label);
        font-weight: 700;
        font-size: 0.72rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        color: var(--texto-fraco);
        text-align: left;
        flex-shrink: 0;
    }

    .tabela-responsiva td[data-label="Descrição"] {
        display: block;
        text-align: left;
        color: var(--texto-suave);
        font-size: 0.82rem;
        padding: 6px 0 8px;
        border-bottom: 1px solid var(--border);
        margin-bottom: 6px;
        white-space: normal;
        word-break: break-word;
    }
    .tabela-responsiva td[data-label="Descrição"]::before {
        display: block;
        margin-bottom: 4px;
    }
    .tabela-responsiva td[data-label="Descrição"] .celula-descricao {
        max-width: none;
        white-space: normal;
        display: block;
    }

    .tabela-responsiva .col-acoes {
        width: 100%;
        display: flex;
        justify-content: flex-end;
        padding-top: 10px;
        margin-top: 6px;
        border-top: 1px solid var(--border);
    }
    .tabela-responsiva .col-acoes::before {
        display: none;
    }

    .tabela-responsiva .acoes-dia {
        display: flex;
        gap: 8px;
        width: 100%;
    }
    .tabela-responsiva .acoes-dia .btn {
        flex: 1;
        justify-content: center;
        min-height: 44px;
    }
}

/* Estilo base da célula de descrição (usada também no desktop) */
.celula-descricao {
    display: inline-block;
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

/* ---------------------------------------------------------
   3. TOUCH TARGETS — botões maiores no mobile
   --------------------------------------------------------- */
@media (max-width: 900px) {
    .btn {
        min-height: 44px;
        padding: 11px 18px;
    }
    .btn-sm {
        min-height: 40px;
        padding: 9px 14px;
        font-size: 0.82rem;
    }
    .col-acoes .btn-sm {
        min-width: 44px;
        min-height: 44px;
    }

    /* Estados de toque (o :hover não existe no toque) */
    .btn:active,
    .nav-menu a:active,
    .usuario-dropdown a:active,
    .bottom-nav-item:active {
        transform: scale(0.97);
        transition: transform .08s ease;
    }

    .btn-primary:active {
        background: var(--cyan-dark);
    }
}

/* Em telas touch, desativa hover "grudento" */
@media (hover: none) {
    .btn:hover,
    .nav-menu a:hover {
        background: inherit;
        color: inherit;
    }
    .btn-primary:hover {
        background: var(--cyan);
        box-shadow: none;
        transform: none;
    }
    .metrica-card:hover {
        transform: none;
        box-shadow: none;
    }
    .metrica-card:hover::before { opacity: 0; }
    .card-planilha:hover { transform: none; }
    .card-ficha:hover,
    .card-exercicio:hover,
    .card-template:hover { transform: none; }
}

/* ---------------------------------------------------------
   4. NAVBAR COMPACTA no mobile
   --------------------------------------------------------- */
@media (max-width: 900px) {
    .navbar-inner {
        padding: 0.5rem 14px;
        gap: 10px;
    }
    .navbar-brand .logo-titulo { font-size: 0.95rem; }
    .navbar-brand .logo-sub    { font-size: 0.55rem; }
    .navbar-brand .logo-icon   { width: 32px; height: 32px; }

    .btn-icone {
        width: 44px;
        height: 44px;
    }
    .btn-usuario {
        padding: 4px 6px 4px 4px;
        min-height: 44px;
    }
    .btn-usuario .avatar {
        width: 34px;
        height: 34px;
    }
}

/* ---------------------------------------------------------
   5. MÉTRICAS — 2 colunas em telas pequenas
   --------------------------------------------------------- */
@media (max-width: 480px) {
    .grid-metricas {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .metrica-card { padding: 14px; }
    .metrica-valor { font-size: 1.5rem; }
    .metrica-label { font-size: 0.78rem; }
    .metrica-icone { width: 36px; height: 36px; }
    .metrica-icone svg { width: 18px; height: 18px; }
}

@media (max-width: 360px) {
    .grid-metricas { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------
   6. BLOCO "PRÓXIMO TREINO" — botão full width no mobile
   --------------------------------------------------------- */
@media (max-width: 600px) {
    .bloco.destaque .btn-primary {
        width: 100%;
        justify-content: center;
        min-height: 50px;
        margin-top: 8px;
        font-size: 0.95rem;
    }
}

/* ---------------------------------------------------------
   7. LISTAS — em coluna no mobile
   --------------------------------------------------------- */
@media (max-width: 600px) {
    .lista-simples li {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        padding: 12px 0;
    }
    .lista-simples li > div:last-child {
        text-align: left !important;
        width: 100%;
    }
    .lista-simples .badge-velocidade {
        margin-top: 4px;
    }
}

/* ---------------------------------------------------------
   8. iOS — font-size 16px em inputs (evita zoom ao focar)
   --------------------------------------------------------- */
@media (max-width: 900px) {
    input,
    select,
    textarea,
    .campo input,
    .campo select,
    .campo textarea,
    .pserie-input,
    .player-input,
    .input-serie {
        font-size: 16px;
    }
}

/* ---------------------------------------------------------
   9. MODAIS — safe-area + dvh
   --------------------------------------------------------- */
.modal-overlay {
    padding:
        max(16px, env(safe-area-inset-top))
        max(16px, env(safe-area-inset-right))
        max(16px, env(safe-area-inset-bottom))
        max(16px, env(safe-area-inset-left));
}
/* =========================================================
   RELATÓRIOS DO ALUNO — AJUSTES MOBILE
   Aplicado apenas em telas ≤ 700px
   Não afeta desktop
   ========================================================= */

@media (max-width: 700px) {

    /* ---------------------------------------------------------
       1. CABEÇALHO DA PÁGINA — mais compacto
       --------------------------------------------------------- */
    .page-header {
        margin-bottom: 16px;
    }
    .page-header h1 {
        font-size: 1.35rem;
        margin-bottom: 2px;
    }
    .page-header .subtitulo {
        font-size: 0.85rem;
    }

    /* ---------------------------------------------------------
       2. ABAS — mais compactas e com fade lateral
       --------------------------------------------------------- */
    .abas {
        margin-bottom: 14px;
        padding-bottom: 2px;
        gap: 2px;
        /* Máscara sutil nas bordas indicando scroll */
        -webkit-mask-image: linear-gradient(to right,
            transparent 0,
            #000 12px,
            #000 calc(100% - 24px),
            transparent 100%);
        mask-image: linear-gradient(to right,
            transparent 0,
            #000 12px,
            #000 calc(100% - 24px),
            transparent 100%);
    }
    .aba {
        padding: 10px 14px;
        font-size: 0.82rem;
        gap: 5px;
    }
    .aba svg, .aba i {
        width: 14px;
        height: 14px;
    }

    /* ---------------------------------------------------------
       3. FILTROS — grid compacto (datas em 2 colunas + botões)
       --------------------------------------------------------- */
    #formFiltros {
        gap: 10px !important;
        flex-direction: column !important;
        align-items: stretch !important;
    }

    /* Datas lado a lado */
    #formFiltros .campo {
        flex: 1 1 auto !important;
        margin: 0 !important;
    }

    /* Wrapper das datas — grid 2 colunas com gap real */
    #formFiltros {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 10px !important;
    }

    /* "De" e "Até" ocupam 1 coluna cada */
    #formFiltros .campo[for="de"],
    #formFiltros .campo[for="ate"] {
        display: flex !important;
        width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
        grid-column: span 1;
    }

    /* Inputs de data — forçados a caber */
    #formFiltros input[type="date"] {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        padding: 8px 8px;
        font-size: 16px;
        min-height: 42px;
        box-sizing: border-box;
        -webkit-appearance: none;
        appearance: none;
        /* Ajusta o alinhamento do texto da data no iOS */
        text-align: left;
    }

    /* iOS: o ícone do calendário interno é grande. Reduz o padding direito */
    #formFiltros input[type="date"]::-webkit-calendar-picker-indicator {
        margin-left: 0;
        padding: 0;
    }

    #formFiltros .campo label {
        font-size: 0.75rem;
        margin-bottom: 3px;
    }

    /* Botões de atalho: grid 4 colunas */
    #formFiltros > div:last-child {
        grid-column: 1 / -1;
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 6px !important;
        width: 100%;
    }
    #formFiltros > div:last-child .btn {
        width: 100%;
        padding: 9px 4px;
        font-size: 0.78rem;
        min-height: 40px;
        justify-content: center;
    }
    /* O botão "Aplicar" ocupa as 4 colunas (linha própria) */
    #formFiltros > div:last-child .btn-primary {
        grid-column: 1 / -1;
        margin-bottom: 2px;
    }

    /* ---------------------------------------------------------
       4. GRID DE MÉTRICAS — 2 colunas fixas
       --------------------------------------------------------- */
    .grid-metricas {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
        margin-bottom: 18px !important;
    }
    .metrica-card {
        padding: 14px !important;
        border-radius: 14px !important;
    }
    .metrica-topo {
        margin-bottom: 8px;
    }
    .metrica-icone {
        width: 34px !important;
        height: 34px !important;
        border-radius: 9px !important;
    }
    .metrica-icone svg {
        width: 17px !important;
        height: 17px !important;
    }
    .metrica-valor {
        font-size: 1.45rem !important;
    }
    .metrica-valor small {
        font-size: 0.55em !important;
    }
    .metrica-label {
        font-size: 0.72rem !important;
        line-height: 1.25;
    }
    .metrica-trend {
        font-size: 0.68rem;
        padding: 2px 6px;
    }

    /* ---------------------------------------------------------
       5. BLOCOS E HEADERS — mais compactos
       --------------------------------------------------------- */
    .bloco {
        padding: 16px !important;
        border-radius: 14px !important;
    }
    .bloco-header {
        margin-bottom: 12px;
        gap: 8px;
    }
    .bloco-header h2 {
        font-size: 0.95rem;
    }
    .bloco-header h2 svg {
        width: 16px;
        height: 16px;
    }

    /* ---------------------------------------------------------
       6. BOTÕES DE MÉTRICA (Distância/Ritmo/Sensação) — linha full
       --------------------------------------------------------- */
    .bloco-header > div[style*="display:flex"] {
        width: 100%;
        display: grid !important;
        grid-template-columns: repeat(3, 1fr);
        gap: 6px !important;
        margin-top: 4px;
    }
    .bloco-header .btn-sm {
        padding: 8px 6px !important;
        font-size: 0.72rem !important;
        min-height: 38px;
        justify-content: center;
        gap: 4px;
    }
    .bloco-header .btn-sm svg,
    .bloco-header .btn-sm i {
        width: 13px;
        height: 13px;
    }

    /* ---------------------------------------------------------
       7. GRÁFICOS — alturas reduzidas
       --------------------------------------------------------- */
    /* Gráfico grande (Evolução) */
    .bloco > div[style*="height:340px"],
    .bloco > div[style*="height: 340px"] {
        height: 240px !important;
    }
    /* Gráficos menores (Volume, Sensação, Tendência) */
    .bloco > div[style*="height:260px"],
    .bloco > div[style*="height: 260px"],
    .bloco > div[style*="height:300px"],
    .bloco > div[style*="height: 300px"],
    .bloco > div[style*="height:320px"],
    .bloco > div[style*="height: 320px"],
    .bloco > div[style*="height:280px"],
    .bloco > div[style*="height: 280px"] {
        height: 220px !important;
    }

    /* "Sensação por treino" — gráfico vazio com eixo 0..5 é feio */
    /* Deixa mais baixo e corrige */
    #graficoSensacao {
        max-height: 200px;
    }

    /* ---------------------------------------------------------
       8. TABELA "Treinos no período" — VIRA CARDS
       --------------------------------------------------------- */
    /* O container da tabela ganha estilo de card-stack */
    #tabelaWrap,
    #tabelaPagamentosWrap,
    #tabelaProgWrap {
        padding: 10px !important;
    }

    #tabelaWrap table,
    #tabelaPagamentosWrap table,
    #tabelaProgWrap table {
        display: block;
        width: 100%;
        border: none;
        background: transparent;
    }

    #tabelaWrap thead,
    #tabelaPagamentosWrap thead,
    #tabelaProgWrap thead {
        display: none;
    }

    #tabelaWrap tbody,
    #tabelaPagamentosWrap tbody,
    #tabelaProgWrap tbody {
        display: block;
        width: 100%;
    }

    #tabelaWrap tr,
    #tabelaPagamentosWrap tr,
    #tabelaProgWrap tr {
        display: block;
        width: 100%;
        background: var(--bg-elev);
        border: 1px solid var(--border);
        border-radius: 12px;
        padding: 12px 14px;
        margin-bottom: 10px;
        position: relative;
    }

    #tabelaWrap tr:last-child,
    #tabelaPagamentosWrap tr:last-child,
    #tabelaProgWrap tr:last-child {
        margin-bottom: 0;
    }

    #tabelaWrap td,
    #tabelaPagamentosWrap td,
    #tabelaProgWrap td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        padding: 5px 0;
        border: none;
        font-size: 0.85rem;
        text-align: right;
        white-space: normal;
        word-break: break-word;
    }

    #tabelaWrap td::before,
    #tabelaPagamentosWrap td::before,
    #tabelaProgWrap td::before {
        content: attr(data-label);
        font-weight: 700;
        font-size: 0.68rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        color: var(--texto-fraco);
        text-align: left;
        flex-shrink: 0;
        margin-right: 8px;
    }

    /* Primeira célula (data) ganha destaque */
    #tabelaWrap td:first-child,
    #tabelaPagamentosWrap td:first-child,
    #tabelaProgWrap td:first-child {
        border-bottom: 1px solid var(--border);
        padding-bottom: 8px;
        margin-bottom: 6px;
        font-size: 0.95rem;
        font-weight: 700;
    }
    #tabelaWrap td:first-child::before,
    #tabelaPagamentosWrap td:first-child::before,
    #tabelaProgWrap td:first-child::before {
        display: none;
    }

    /* Coluna de ações (se tiver) vira full-width */
    #tabelaWrap td.col-acoes,
    #tabelaPagamentosWrap td.col-acoes,
    #tabelaProgWrap td.col-acoes {
        justify-content: flex-end;
        padding-top: 8px;
        border-top: 1px solid var(--border);
        margin-top: 6px;
        width: 100%;
    }
    #tabelaWrap td.col-acoes::before,
    #tabelaPagamentosWrap td.col-acoes::before,
    #tabelaProgWrap td.col-acoes::before {
        display: none;
    }
}

/* =========================================================
   Ajustes MUITO pequenos (≤ 380px)
   ========================================================= */
@media (max-width: 380px) {
    #formFiltros .campo[for="de"],
    #formFiltros .campo[for="ate"] {
        width: 100%;
        margin-left: 0 !important;
    }
    .bloco-header > div[style*="display:flex"] {
        grid-template-columns: 1fr 1fr;
    }
    .metrica-valor {
        font-size: 1.25rem !important;
    }
}/* =========================================================
   RELATÓRIOS DO ALUNO — AJUSTES MOBILE
   Aplicado apenas em telas ≤ 700px
   Não afeta desktop
   ========================================================= */

@media (max-width: 700px) {

    /* ---------------------------------------------------------
       1. CABEÇALHO DA PÁGINA — mais compacto
       --------------------------------------------------------- */
    .page-header {
        margin-bottom: 16px;
    }
    .page-header h1 {
        font-size: 1.35rem;
        margin-bottom: 2px;
    }
    .page-header .subtitulo {
        font-size: 0.85rem;
    }

    /* ---------------------------------------------------------
       2. ABAS — mais compactas e com fade lateral
       --------------------------------------------------------- */
    .abas {
        margin-bottom: 14px;
        padding-bottom: 2px;
        gap: 2px;
        /* Máscara sutil nas bordas indicando scroll */
        -webkit-mask-image: linear-gradient(to right,
            transparent 0,
            #000 12px,
            #000 calc(100% - 24px),
            transparent 100%);
        mask-image: linear-gradient(to right,
            transparent 0,
            #000 12px,
            #000 calc(100% - 24px),
            transparent 100%);
    }
    .aba {
        padding: 10px 14px;
        font-size: 0.82rem;
        gap: 5px;
    }
    .aba svg, .aba i {
        width: 14px;
        height: 14px;
    }

    /* ---------------------------------------------------------
       3. FILTROS — grid compacto (datas em 2 colunas + botões)
       --------------------------------------------------------- */
    #formFiltros {
        gap: 10px !important;
        flex-direction: column !important;
        align-items: stretch !important;
    }

    /* Datas lado a lado */
    #formFiltros .campo {
        flex: 1 1 auto !important;
        margin: 0 !important;
    }

    /* Wrapper das datas em 2 colunas */
    #formFiltros .campo[for="de"] {
        display: inline-flex;
        width: calc(50% - 5px);
        vertical-align: top;
    }
    #formFiltros .campo[for="ate"] {
        display: inline-flex;
        width: calc(50% - 5px);
        vertical-align: top;
        margin-left: 5px !important;
    }

    /* Inputs de data menores */
    #formFiltros input[type="date"] {
        padding: 8px 10px;
        font-size: 16px; /* evita zoom iOS */
        min-height: 42px;
    }
    #formFiltros .campo label {
        font-size: 0.75rem;
        margin-bottom: 3px;
    }

    /* Botões de atalho: grid 4 colunas */
    #formFiltros > div:last-child {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 6px !important;
        width: 100%;
    }
    #formFiltros > div:last-child .btn {
        width: 100%;
        padding: 9px 4px;
        font-size: 0.78rem;
        min-height: 40px;
        justify-content: center;
    }
    /* O botão "Aplicar" ocupa as 4 colunas (linha própria) */
    #formFiltros > div:last-child .btn-primary {
        grid-column: 1 / -1;
        margin-bottom: 2px;
    }

    /* ---------------------------------------------------------
       4. GRID DE MÉTRICAS — 2 colunas fixas
       --------------------------------------------------------- */
    .grid-metricas {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
        margin-bottom: 18px !important;
    }
    .metrica-card {
        padding: 14px !important;
        border-radius: 14px !important;
    }
    .metrica-topo {
        margin-bottom: 8px;
    }
    .metrica-icone {
        width: 34px !important;
        height: 34px !important;
        border-radius: 9px !important;
    }
    .metrica-icone svg {
        width: 17px !important;
        height: 17px !important;
    }
    .metrica-valor {
        font-size: 1.45rem !important;
    }
    .metrica-valor small {
        font-size: 0.55em !important;
    }
    .metrica-label {
        font-size: 0.72rem !important;
        line-height: 1.25;
    }
    .metrica-trend {
        font-size: 0.68rem;
        padding: 2px 6px;
    }

    /* ---------------------------------------------------------
       5. BLOCOS E HEADERS — mais compactos
       --------------------------------------------------------- */
    .bloco {
        padding: 16px !important;
        border-radius: 14px !important;
    }
    .bloco-header {
        margin-bottom: 12px;
        gap: 8px;
    }
    .bloco-header h2 {
        font-size: 0.95rem;
    }
    .bloco-header h2 svg {
        width: 16px;
        height: 16px;
    }

    /* ---------------------------------------------------------
       6. BOTÕES DE MÉTRICA (Distância/Ritmo/Sensação) — linha full
       --------------------------------------------------------- */
    .bloco-header > div[style*="display:flex"] {
        width: 100%;
        display: grid !important;
        grid-template-columns: repeat(3, 1fr);
        gap: 6px !important;
        margin-top: 4px;
    }
    .bloco-header .btn-sm {
        padding: 8px 6px !important;
        font-size: 0.72rem !important;
        min-height: 38px;
        justify-content: center;
        gap: 4px;
    }
    .bloco-header .btn-sm svg,
    .bloco-header .btn-sm i {
        width: 13px;
        height: 13px;
    }

    /* ---------------------------------------------------------
       7. GRÁFICOS — alturas reduzidas
       --------------------------------------------------------- */
    /* Gráfico grande (Evolução) */
    .bloco > div[style*="height:340px"],
    .bloco > div[style*="height: 340px"] {
        height: 240px !important;
    }
    /* Gráficos menores (Volume, Sensação, Tendência) */
    .bloco > div[style*="height:260px"],
    .bloco > div[style*="height: 260px"],
    .bloco > div[style*="height:300px"],
    .bloco > div[style*="height: 300px"],
    .bloco > div[style*="height:320px"],
    .bloco > div[style*="height: 320px"],
    .bloco > div[style*="height:280px"],
    .bloco > div[style*="height: 280px"] {
        height: 220px !important;
    }

    /* "Sensação por treino" — gráfico vazio com eixo 0..5 é feio */
    /* Deixa mais baixo e corrige */
    #graficoSensacao {
        max-height: 200px;
    }

    /* ---------------------------------------------------------
       8. TABELA "Treinos no período" — VIRA CARDS
       --------------------------------------------------------- */
    /* O container da tabela ganha estilo de card-stack */
    #tabelaWrap,
    #tabelaPagamentosWrap,
    #tabelaProgWrap {
        padding: 10px !important;
    }

    #tabelaWrap table,
    #tabelaPagamentosWrap table,
    #tabelaProgWrap table {
        display: block;
        width: 100%;
        border: none;
        background: transparent;
    }

    #tabelaWrap thead,
    #tabelaPagamentosWrap thead,
    #tabelaProgWrap thead {
        display: none;
    }

    #tabelaWrap tbody,
    #tabelaPagamentosWrap tbody,
    #tabelaProgWrap tbody {
        display: block;
        width: 100%;
    }

    #tabelaWrap tr,
    #tabelaPagamentosWrap tr,
    #tabelaProgWrap tr {
        display: block;
        width: 100%;
        background: var(--bg-elev);
        border: 1px solid var(--border);
        border-radius: 12px;
        padding: 12px 14px;
        margin-bottom: 10px;
        position: relative;
    }

    #tabelaWrap tr:last-child,
    #tabelaPagamentosWrap tr:last-child,
    #tabelaProgWrap tr:last-child {
        margin-bottom: 0;
    }

    #tabelaWrap td,
    #tabelaPagamentosWrap td,
    #tabelaProgWrap td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        padding: 5px 0;
        border: none;
        font-size: 0.85rem;
        text-align: right;
        white-space: normal;
        word-break: break-word;
    }

    #tabelaWrap td::before,
    #tabelaPagamentosWrap td::before,
    #tabelaProgWrap td::before {
        content: attr(data-label);
        font-weight: 700;
        font-size: 0.68rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        color: var(--texto-fraco);
        text-align: left;
        flex-shrink: 0;
        margin-right: 8px;
    }

    /* Primeira célula (data) ganha destaque */
    #tabelaWrap td:first-child,
    #tabelaPagamentosWrap td:first-child,
    #tabelaProgWrap td:first-child {
        border-bottom: 1px solid var(--border);
        padding-bottom: 8px;
        margin-bottom: 6px;
        font-size: 0.95rem;
        font-weight: 700;
    }
    #tabelaWrap td:first-child::before,
    #tabelaPagamentosWrap td:first-child::before,
    #tabelaProgWrap td:first-child::before {
        display: none;
    }

    /* Coluna de ações (se tiver) vira full-width */
    #tabelaWrap td.col-acoes,
    #tabelaPagamentosWrap td.col-acoes,
    #tabelaProgWrap td.col-acoes {
        justify-content: flex-end;
        padding-top: 8px;
        border-top: 1px solid var(--border);
        margin-top: 6px;
        width: 100%;
    }
    #tabelaWrap td.col-acoes::before,
    #tabelaPagamentosWrap td.col-acoes::before,
    #tabelaProgWrap td.col-acoes::before {
        display: none;
    }
}

/* =========================================================
   Ajustes MUITO pequenos (≤ 380px)
   ========================================================= */
@media (max-width: 380px) {
    #formFiltros .campo[for="de"],
    #formFiltros .campo[for="ate"] {
        width: 100%;
        margin-left: 0 !important;
    }
    .bloco-header > div[style*="display:flex"] {
        grid-template-columns: 1fr 1fr;
    }
    .metrica-valor {
        font-size: 1.25rem !important;
    }
}
/* =========================================================
   ÁREA DO PERSONAL — AJUSTES MOBILE
   ========================================================= */

/* ---------------------------------------------------------
   TABELA DE ALUNOS — refinamentos mobile
   --------------------------------------------------------- */
@media (max-width: 700px) {

    /* Garante que os labels apareçam corretos */
    .tabela-alunos td[data-label="Aluno"] {
        display: block;
        padding-bottom: 8px;
        border-bottom: 1px solid var(--border);
        margin-bottom: 6px;
    }
    .tabela-alunos td[data-label="Aluno"]::before {
        display: none;
    }

    /* Contato, Mensalidade, Vinculado ficam em linhas */
    .tabela-alunos td[data-label="Contato"],
    .tabela-alunos td[data-label="Mensalidade"],
    .tabela-alunos td[data-label="Vinculado"] {
        padding: 6px 0;
        justify-content: space-between;
    }

    /* Wrapper de contato vira flex linha */
    .tabela-alunos .info-contato {
        display: flex;
        flex-direction: row;
        gap: 10px;
        align-items: center;
        flex-wrap: wrap;
        justify-content: flex-end;
        font-size: 0.82rem;
    }

    .tabela-alunos .info-mensalidade {
        display: flex;
        flex-direction: row;
        gap: 8px;
        align-items: center;
        justify-content: flex-end;
    }

    /* Ações: grid 2 colunas, botão "Excluir" full-width */
    .tabela-alunos td[data-label="Ações"] {
        display: block;
        width: 100%;
        padding: 10px 0 0;
        margin-top: 6px;
        border-top: 1px solid var(--border);
        text-align: left;
    }
    .tabela-alunos td[data-label="Ações"]::before {
        display: none;
    }

    .tabela-alunos .acoes-aluno {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 6px;
        width: 100%;
    }

    .tabela-alunos .acoes-aluno .btn {
        min-height: 42px;
        padding: 8px 10px;
        font-size: 0.78rem;
        justify-content: center;
        gap: 5px;
    }

    .tabela-alunos .acoes-aluno .btn svg,
    .tabela-alunos .acoes-aluno .btn i {
        width: 14px;
        height: 14px;
        flex-shrink: 0;
    }

    /* O último (Excluir, que é danger) ocupa as 2 colunas */
    .tabela-alunos .acoes-aluno .btn-danger {
        grid-column: 1 / -1;
    }

    /* Em telas muito pequenas, esconde o texto e deixa só o ícone */
    .tabela-alunos .acoes-aluno .btn-label {
        display: inline;
    }
}

@media (max-width: 380px) {
    .tabela-alunos .acoes-aluno .btn-label {
        display: none;
    }
    .tabela-alunos .acoes-aluno .btn {
        min-width: 44px;
    }
}

/* ---------------------------------------------------------
   HEADER DA PÁGINA com muitos botões (Voltar/Avisar/Novo)
   --------------------------------------------------------- */
@media (max-width: 700px) {
    /* Se o header tiver mais de 1 botão, empilha em grid */
    .page-header > .flex-between {
        width: 100%;
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 8px !important;
    }

    .page-header > .flex-between .btn {
        width: 100%;
        justify-content: center;
        padding: 10px 8px;
        font-size: 0.82rem;
        min-height: 42px;
    }

    /* O último botão (geralmente "Novo X") ocupa as 2 colunas */
    .page-header > .flex-between .btn:last-child {
        grid-column: 1 / -1;
    }
}

/* =========================================================
   ETAPA 2 — TABELA DE PLANILHAS no mobile
   ========================================================= */
@media (max-width: 700px) {

    .tabela-planilhas td[data-label="Título"] {
        display: block;
        padding-bottom: 10px;
        border-bottom: 1px solid var(--border);
        margin-bottom: 8px;
    }
    .tabela-planilhas td[data-label="Título"]::before {
        display: none;
    }

    .tabela-planilhas td[data-label="Objetivo"],
    .tabela-planilhas td[data-label="Período"],
    .tabela-planilhas td[data-label="Semanas"],
    .tabela-planilhas td[data-label="Alunos"],
    .tabela-planilhas td[data-label="Status"] {
        padding: 6px 0;
        justify-content: space-between;
    }

    /* Badges coloridos */
    .tabela-planilhas .badge-semanas {
        background: rgba(101,233,217,.12);
        color: var(--cyan);
    }
    .tabela-planilhas .badge-alunos {
        background: rgba(168,85,247,.15);
        color: #a855f7;
    }

    /* Ações */
    .tabela-planilhas td[data-label="Ações"] {
        display: block;
        width: 100%;
        padding: 10px 0 0;
        margin-top: 6px;
        border-top: 1px solid var(--border);
        text-align: left;
    }
    .tabela-planilhas td[data-label="Ações"]::before {
        display: none;
    }

    .tabela-planilhas .acoes-planilha {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 6px;
        width: 100%;
    }

    .tabela-planilhas .acoes-planilha .btn {
        min-height: 42px;
        padding: 8px 10px;
        font-size: 0.78rem;
        justify-content: center;
        gap: 5px;
    }

    .tabela-planilhas .acoes-planilha .btn svg,
    .tabela-planilhas .acoes-planilha .btn i {
        width: 14px;
        height: 14px;
        flex-shrink: 0;
    }

    .tabela-planilhas .acoes-planilha .btn-danger {
        grid-column: 1 / -1;
    }
}

@media (max-width: 380px) {
    .tabela-planilhas .acoes-planilha .btn-label {
        display: none;
    }
    .tabela-planilhas .acoes-planilha .btn {
        min-width: 44px;
    }
}
/* =========================================================
   ETAPA 3 — TABELA DE PAGAMENTOS no mobile
   ========================================================= */
@media (max-width: 700px) {

    .tabela-pagamentos td[data-label="Aluno"] {
        display: block;
        padding-bottom: 10px;
        border-bottom: 1px solid var(--border);
        margin-bottom: 8px;
    }
    .tabela-pagamentos td[data-label="Aluno"]::before {
        display: none;
    }

    .tabela-pagamentos td[data-label="Mensalidade"],
    .tabela-pagamentos td[data-label="Vencimento"],
    .tabela-pagamentos td[data-label="Último pgto"],
    .tabela-pagamentos td[data-label="Status"] {
        padding: 6px 0;
        justify-content: space-between;
    }

    /* Ações */
    .tabela-pagamentos td[data-label="Ações"] {
        display: block;
        width: 100%;
        padding: 10px 0 0;
        margin-top: 6px;
        border-top: 1px solid var(--border);
        text-align: left;
    }
    .tabela-pagamentos td[data-label="Ações"]::before {
        display: none;
    }

    .tabela-pagamentos .acoes-pagamento {
        display: flex;
        width: 100%;
    }

    .tabela-pagamentos .acoes-pagamento .btn {
        width: 100%;
        min-height: 44px;
        padding: 10px 14px;
        font-size: 0.85rem;
        justify-content: center;
        gap: 6px;
    }

    .tabela-pagamentos .acoes-pagamento .btn svg,
    .tabela-pagamentos .acoes-pagamento .btn i {
        width: 16px;
        height: 16px;
        flex-shrink: 0;
    }
}

@media (max-width: 380px) {
    .tabela-pagamentos .acoes-pagamento .btn-label {
        display: none;
    }
    .tabela-pagamentos .acoes-pagamento .btn {
        min-width: 44px;
    }
}

/* =========================================================
   ETAPA 4.1 — DASHBOARD DO PERSONAL no mobile
   ========================================================= */
@media (max-width: 700px) {

    /* -------------------------------------------------------
       HEADER — botões compactos, lado a lado
       ------------------------------------------------------- */
    /* O header tem h1+subtítulo e depois um flex-between com 2 botões.
       Empilha tudo, e os 2 botões ficam lado a lado em grid. */
    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .page-header > .flex-between {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 8px !important;
        width: 100%;
    }

    .page-header > .flex-between .btn {
        width: 100%;
        justify-content: center;
        padding: 10px 8px;
        font-size: 0.82rem;
        min-height: 44px;
        gap: 5px;
    }

    .page-header > .flex-between .btn svg,
    .page-header > .flex-between .btn i {
        width: 15px;
        height: 15px;
        flex-shrink: 0;
    }

    /* -------------------------------------------------------
       GRID DE MÉTRICAS — 2 colunas fixas
       ------------------------------------------------------- */
    .grid-metricas {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
        margin-bottom: 18px !important;
    }

    /* -------------------------------------------------------
       CARD DO DONUT — volta a ser 1 coluna só (não ocupa linha toda)
       ------------------------------------------------------- */
    .metrica-card-donut {
        grid-column: span 1 !important; /* desfaz o 1 / -1 anterior */
        display: flex !important;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 14px 10px !important;
        min-height: 0;
    }

    /* Reduz drasticamente o donut para caber em 1 coluna */
    .metrica-card-donut .donut-wrapper {
        width: 80px;
        height: 80px;
        margin: 0 auto;
    }

    .metrica-card-donut .donut-wrapper svg {
        width: 100%;
        height: 100%;
    }

    /* Texto dentro do SVG fica pequeno demais em 80px — aumentar */
    .metrica-card-donut .donut-wrapper svg text {
        font-size: 26px;
        font-weight: 800;
    }

    /* Label "Alunos ativos" */
    .metrica-card-donut .metrica-label {
        margin-top: 8px !important;
        font-size: 0.78rem;
        text-align: center;
        line-height: 1.2;
    }

    /* Legenda do donut — compacta */
    .donut-legenda {
        display: flex;
        gap: 8px;
        margin-top: 6px;
        font-size: 0.72rem;
        justify-content: center;
        flex-wrap: wrap;
    }

    .donut-legenda-item {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        white-space: nowrap;
    }

    .donut-legenda-item .dot {
        width: 7px;
        height: 7px;
        border-radius: 50%;
        display: inline-block;
    }

    .donut-legenda-item .dot-vazio {
        background: rgba(255,255,255,0.15);
    }

    /* -------------------------------------------------------
       OUTROS CARDS DE MÉTRICA — compactos
       ------------------------------------------------------- */
    .grid-metricas .metrica-card {
        padding: 14px 12px !important;
        border-radius: 14px !important;
    }

    .grid-metricas .metrica-topo {
        margin-bottom: 8px;
        gap: 6px;
    }

    .grid-metricas .metrica-icone {
        width: 34px !important;
        height: 34px !important;
        border-radius: 9px !important;
    }

    .grid-metricas .metrica-icone svg,
    .grid-metricas .metrica-icone i {
        width: 17px !important;
        height: 17px !important;
    }

    .grid-metricas .metrica-valor {
        font-size: 1.45rem !important;
        line-height: 1.1;
    }

    /* Nome do plano pode ser longo — reduz */
    .metrica-valor-plano {
        font-size: 1.05rem !important;
        line-height: 1.15;
    }

    .grid-metricas .metrica-label {
        font-size: 0.75rem !important;
        line-height: 1.25;
        margin-top: 4px;
    }

    .grid-metricas .metrica-trend {
        font-size: 0.66rem;
        padding: 2px 6px;
        white-space: nowrap;
    }

    /* -------------------------------------------------------
       AVISO DE SOLICITAÇÃO PENDENTE
       ------------------------------------------------------- */
    .aviso-linha {
        display: flex;
        align-items: flex-start;
        gap: 10px;
        font-size: 0.85rem;
        line-height: 1.5;
    }

    /* -------------------------------------------------------
       GRID DOS 3 BLOCOS (últimos alunos, planilhas, treinos)
       ------------------------------------------------------- */
    .grid-3 {
        gap: 14px !important;
    }
}

/* Telas muito pequenas (iPhone SE 375px) — mantém 2 colunas mesmo assim */
@media (max-width: 360px) {
    .metrica-card-donut .donut-wrapper {
        width: 70px;
        height: 70px;
    }

    .grid-metricas .metrica-valor {
        font-size: 1.25rem !important;
    }

    .metrica-valor-plano {
        font-size: 0.95rem !important;
    }

    .page-header > .flex-between .btn {
        font-size: 0.76rem;
        padding: 8px 6px;
    }
}

/* =========================================================
   ETAPA 4.2 — FICHAS DE TREINO no mobile
   ========================================================= */
@media (max-width: 700px) {

    /* Seletor de aluno: select full-width, botão embaixo */
    .form-seletor-aluno {
        display: flex;
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }
    .form-seletor-aluno .campo {
        width: 100%;
    }
    .form-seletor-aluno select {
        width: 100%;
        min-height: 44px;
        font-size: 16px;
        padding: 10px 12px;
    }

    /* Bloco de info do aluno */
    .info-aluno-selecionado {
        display: flex;
        align-items: center;
        gap: 14px;
        min-width: 0;
    }
    .info-aluno-selecionado .avatar-lista {
        width: 42px;
        height: 42px;
        flex-shrink: 0;
    }
    .info-aluno-label {
        font-size: 0.68rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
    .info-aluno-selecionado strong {
        display: block;
        font-size: 1rem;
        line-height: 1.25;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Grid de fichas: 1 coluna */
    .grid-fichas {
        grid-template-columns: 1fr !important;
        gap: 12px;
    }

    /* Card de ficha mais compacto */
    .card-ficha {
        padding: 14px 16px;
    }

    /* Ações do card: grid 2 colunas, o Excluir ocupa as 2 */
    .card-ficha-acoes {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 6px;
        margin-top: 8px;
    }

    .card-ficha-acoes .btn {
        min-height: 42px;
        padding: 8px 10px;
        font-size: 0.8rem;
        justify-content: center;
        gap: 5px;
    }

    .card-ficha-acoes .btn svg,
    .card-ficha-acoes .btn i {
        width: 14px;
        height: 14px;
        flex-shrink: 0;
    }

    /* Botão danger (Excluir) ocupa as 2 colunas */
    .card-ficha-acoes .btn-danger {
        grid-column: 1 / -1;
    }

    /* Botão PDF fica como o resto */
    .card-ficha-acoes .btn:not(.btn-primary):not(.btn-danger) {
        /* neutro */
    }
}

/* Telas bem pequenas: esconde texto dos botões */
@media (max-width: 380px) {
    .card-ficha-acoes .btn-label {
        display: none;
    }
    .card-ficha-acoes .btn {
        min-width: 44px;
    }
}
/* =========================================================
   ETAPA 4.3 — EXERCÍCIOS no mobile
   ========================================================= */
@media (max-width: 700px) {

    /* Header com botão "Novo Exercício" full-width */
    .page-header > .btn-primary {
        width: 100%;
        justify-content: center;
        min-height: 46px;
        margin-top: 8px;
    }

    /* Grid de métricas: 2 colunas */
    .grid-metricas {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }

    /* Form de filtros vira grid empilhado */
    .form-filtros-exercicios {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .form-filtros-exercicios .campo {
        margin: 0;
        min-width: 0;
    }

    /* Busca ocupa as 2 colunas */
    .form-filtros-exercicios .campo-busca {
        grid-column: 1 / -1;
    }

    /* Grupo e Tipo ficam lado a lado */
    .form-filtros-exercicios .campo-grupo,
    .form-filtros-exercicios .campo-tipo {
        grid-column: span 1;
    }

    /* Ações de filtro (Filtrar + Limpar) ficam embaixo, full-width */
    .form-filtros-exercicios .campo-acoes-filtro {
        grid-column: 1 / -1;
        display: grid !important;
        grid-template-columns: 1fr auto;
        gap: 8px;
        margin-top: 4px;
    }

    .form-filtros-exercicios .campo-acoes-filtro .btn {
        min-height: 44px;
        justify-content: center;
        padding: 10px 14px;
        font-size: 0.88rem;
    }

    .form-filtros-exercicios .campo-acoes-filtro .btn.btn-primary {
        width: 100%;
    }

    /* Inputs e selects ocupam toda a largura */
    .form-filtros-exercicios input,
    .form-filtros-exercicios select {
        width: 100%;
        min-height: 44px;
        font-size: 16px;
        padding: 10px 12px;
    }

    /* Grid de exercícios: 1 coluna */
    .grid-exercicios {
        grid-template-columns: 1fr !important;
        gap: 10px;
    }

    /* Card do exercício mais compacto */
    .card-exercicio {
        padding: 14px 16px;
    }

    /* Ações do card: layout de 2 botões lado a lado */
    .card-exercicio-acoes {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 6px;
        margin-top: 8px;
    }

    .card-exercicio-acoes .btn {
        min-height: 42px;
        padding: 8px 10px;
        font-size: 0.8rem;
        justify-content: center;
        gap: 5px;
    }

    .card-exercicio-acoes .btn svg,
    .card-exercicio-acoes .btn i {
        width: 14px;
        height: 14px;
        flex-shrink: 0;
    }

    /* Quando só tem 1 botão (caso "Duplicar como meu"), ocupa full-width */
    .card-exercicio-acoes .btn:only-child {
        grid-column: 1 / -1;
    }

    /* Header dos grupos de exercícios */
    .bloco-header h2 {
        font-size: 0.95rem;
    }
}

@media (max-width: 380px) {
    .grid-metricas {
        grid-template-columns: 1fr !important;
    }

    .form-filtros-exercicios {
        grid-template-columns: 1fr;
    }

    .form-filtros-exercicios .campo-grupo,
    .form-filtros-exercicios .campo-tipo {
        grid-column: 1 / -1;
    }

    /* Esconde texto dos botões dos cards */
    .card-exercicio-acoes .btn-label {
        display: none;
    }
}

/* =========================================================
   ETAPA 4.4 — MEU PLANO (personal) no mobile
   ========================================================= */
@media (max-width: 700px) {

    /* Botão "Voltar" do header full-width */
    .page-header > .btn {
        width: 100%;
        justify-content: center;
        min-height: 44px;
        margin-top: 4px;
    }

    /* -------------------------------------------------------
       BLOCO "PLANO ATUAL"
       ------------------------------------------------------- */
    .info-plano-atual {
        display: grid;
        grid-template-columns: 1fr;
        gap: 20px;
        margin-top: 8px;
    }

    .info-plano-col {
        min-width: 0;
    }

    .info-plano-nome {
        font-size: 1.4rem;
        font-weight: 800;
        color: var(--cyan);
        margin-bottom: 4px;
        line-height: 1.15;
    }

    .info-plano-slug {
        font-family: monospace;
        font-size: 0.78rem;
        margin-bottom: 14px;
    }

    .info-plano-dados {
        display: flex;
        flex-direction: column;
        gap: 8px;
        font-size: 0.9rem;
    }

    .info-plano-dados > div {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 10px;
    }

    /* Uso de alunos */
    .info-plano-uso {
        font-size: 1.7rem;
        font-weight: 800;
        margin-bottom: 8px;
        line-height: 1.1;
    }

    .barra-uso {
        height: 8px;
        background: rgba(255,255,255,0.06);
        border-radius: 6px;
        overflow: hidden;
        margin-bottom: 8px;
    }

    .barra-uso-inner {
        height: 100%;
        transition: width .3s ease;
    }

    /* -------------------------------------------------------
       GRID DE PLANOS DISPONÍVEIS
       ------------------------------------------------------- */
    .grid-planos {
        display: grid;
        grid-template-columns: 1fr;
        gap: 14px;
        margin-top: 8px;
    }

    .card-plano {
        background: var(--bg-elev-2);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        padding: 18px;
        display: flex;
        flex-direction: column;
        gap: 12px;
        transition: border-color .2s ease;
    }

    .card-plano.card-plano-atual {
        border-color: var(--cyan);
        background: rgba(101,233,217,0.04);
    }

    .card-plano-topo {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 8px;
    }

    .card-plano-nome {
        font-weight: 800;
        font-size: 1.1rem;
        margin-bottom: 2px;
        line-height: 1.15;
    }

    .card-plano-slug {
        font-family: monospace;
        font-size: 0.72rem;
    }

    .card-plano-preco {
        font-size: 1.5rem;
        font-weight: 800;
        color: var(--cyan);
        line-height: 1.1;
    }

    .card-plano-limite {
        font-size: 0.85rem;
        color: var(--texto-suave);
        margin-bottom: 4px;
    }

    /* Botões dentro do card-plano full-width e toque-friendly */
    .card-plano .btn {
        width: 100% !important;
        min-height: 44px;
        justify-content: center;
        font-size: 0.88rem;
    }

    /* -------------------------------------------------------
       BANNERS DE RENOVAÇÃO E SOLICITAÇÃO PENDENTE
       ------------------------------------------------------- */
    /* Os blocos com `border-left: 4px solid` já funcionam bem,
       mas garantimos que o botão "Solicitar renovação" fique full-width */
    .bloco > .flex-between {
        flex-direction: column;
        align-items: stretch !important;
    }

    .bloco > .flex-between .btn {
        width: 100%;
        justify-content: center;
        min-height: 44px;
    }

    /* -------------------------------------------------------
       HISTÓRICO
       ------------------------------------------------------- */
    .lista-simples li {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .lista-simples li > span.badge {
        align-self: flex-start;
    }

    /* -------------------------------------------------------
       BANNER DE PLANO (render_banner_plano)
       ------------------------------------------------------- */
    .banner-plano {
        flex-direction: column;
        align-items: stretch;
    }

    .banner-plano .btn {
        width: 100%;
        justify-content: center;
        min-height: 44px;
    }
}

/* Telas muito pequenas */
@media (max-width: 380px) {
    .info-plano-nome {
        font-size: 1.2rem;
    }

    .info-plano-uso {
        font-size: 1.5rem;
    }

    .card-plano {
        padding: 14px;
    }

    .card-plano-nome {
        font-size: 1rem;
    }

    .card-plano-preco {
        font-size: 1.3rem;
    }
}

@media (max-width: 700px) {
    /* Header da página com 2 botões (Ver relatórios / Atribuir planilha) */
    .page-header > .flex-between {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 8px !important;
        width: 100%;
    }
    .page-header > .flex-between .btn {
        width: 100%;
        justify-content: center;
        padding: 10px 8px;
        font-size: 0.82rem;
        min-height: 44px;
    }

    /* Histórico do aluno — ajustes específicos */
    .tabela-historico-aluno td[data-label="Data"] {
        display: block;
        padding-bottom: 8px;
        border-bottom: 1px solid var(--border);
        margin-bottom: 6px;
        font-weight: 700;
        font-size: 0.95rem;
    }
    .tabela-historico-aluno td[data-label="Data"]::before {
        display: none;
    }
    .tabela-historico-aluno td[data-label="Modalidade"] {
        display: block;
        padding-bottom: 8px;
        border-bottom: 1px solid var(--border);
        margin-bottom: 6px;
        text-align: left;
    }
    .tabela-historico-aluno td[data-label="Modalidade"]::before {
        display: none;
    }
}

@media (max-width: 700px) {
    /* Header com 4 botões de ação */
    .page-header > .flex-between {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 8px !important;
        width: 100%;
    }
    .page-header > .flex-between .btn {
        width: 100%;
        justify-content: center;
        padding: 10px 8px;
        font-size: 0.78rem;
        min-height: 44px;
        gap: 4px;
    }

    /* Último botão (Adicionar Exercício, primary) ocupa 2 colunas */
    .page-header > .flex-between .btn-primary {
        grid-column: 1 / -1;
    }

    /* Letra grande no título */
    .titulo-letra {
        background: linear-gradient(135deg, var(--cyan), var(--cyan-dark));
        color: #0a0a0a;
        border-radius: 10px;
        padding: 2px 10px;
        font-size: 1.1rem;
        vertical-align: middle;
        margin-right: 6px;
        display: inline-block;
    }
}

/* Letra da ficha no título — base */
.titulo-letra {
    background: linear-gradient(135deg, var(--cyan), var(--cyan-dark));
    color: #0a0a0a;
    border-radius: 10px;
    padding: 2px 12px;
    font-size: 1.3rem;
    vertical-align: middle;
    margin-right: 8px;
    display: inline-block;
}

@media (max-width: 700px) {
    /* Header com botões (admin: Trocar dono + Nova Semana) */
    .page-header > .flex-between {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 8px !important;
        width: 100%;
    }
    .page-header > .flex-between .btn {
        width: 100%;
        justify-content: center;
        padding: 10px 8px;
        font-size: 0.82rem;
        min-height: 44px;
    }

    /* Ações da semana (Dia / Editar / Excluir) */
    .semana-acoes {
        display: grid !important;
        grid-template-columns: 1fr 1fr 1fr;
        gap: 6px;
        width: 100%;
        margin-top: 8px;
    }

    .semana-acoes .texto-suave {
        grid-column: 1 / -1;
        margin-bottom: 4px;
        font-size: 0.78rem;
    }

    .semana-acoes .btn {
        min-height: 44px;
        justify-content: center;
        padding: 8px 6px;
        font-size: 0.78rem;
        gap: 4px;
    }

    .semana-acoes .btn svg,
    .semana-acoes .btn i {
        width: 14px;
        height: 14px;
    }

    /* Tabela de dias dentro da semana */
    .tabela-dias-semana td[data-label="Dia"] {
        display: block;
        padding-bottom: 8px;
        border-bottom: 1px solid var(--border);
        margin-bottom: 6px;
        font-weight: 700;
        font-size: 0.95rem;
    }
    .tabela-dias-semana td[data-label="Dia"]::before {
        display: none;
    }

    .tabela-dias-semana td[data-label="Descrição"] {
        display: block;
        padding: 6px 0 8px;
        border-bottom: 1px solid var(--border);
        margin-bottom: 6px;
        text-align: left;
        white-space: normal;
        word-break: break-word;
        color: var(--texto-suave);
        font-size: 0.82rem;
    }
    .tabela-dias-semana td[data-label="Descrição"]::before {
        display: block;
        margin-bottom: 4px;
    }

    .tabela-dias-semana td[data-label="Ações"] {
        display: block;
        width: 100%;
        padding: 10px 0 0;
        margin-top: 6px;
        border-top: 1px solid var(--border);
    }
    .tabela-dias-semana td[data-label="Ações"]::before {
        display: none;
    }

    .tabela-dias-semana .acoes-dia {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 6px;
        width: 100%;
    }

    .tabela-dias-semana .acoes-dia .btn {
        min-height: 44px;
        justify-content: center;
        padding: 8px 10px;
        font-size: 0.8rem;
    }
}

@media (max-width: 380px) {
    .semana-acoes .btn-label,
    .tabela-dias-semana .acoes-dia .btn-label {
        display: none;
    }
    .semana-acoes .btn,
    .tabela-dias-semana .acoes-dia .btn {
        min-width: 44px;
    }
}

/* =========================================================
   ETAPA 6 — BROADCAST (personal) no mobile
   ========================================================= */
@media (max-width: 700px) {

    /* -------------------------------------------------------
       HEADER com botão "Meus alunos" full-width
       ------------------------------------------------------- */
    .page-header > .flex-between {
        width: 100%;
        display: block !important;
    }

    .page-header > .flex-between .btn {
        width: 100%;
        justify-content: center;
        min-height: 44px;
        margin-top: 8px;
    }

    /* Título do broadcast — badge quebra linha */
    .titulo-broadcast {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
        font-size: 1.35rem !important;
        line-height: 1.2;
    }
    .titulo-broadcast .badge {
        font-size: 0.66rem;
    }

    /* -------------------------------------------------------
       BLOQUEIO DE PLANO (personal_broadcast.php)
       ------------------------------------------------------- */
    .bloco-bloqueio-plano > .flex-between {
        flex-direction: column;
        align-items: stretch !important;
    }
    .bloco-bloqueio-plano .btn {
        width: 100%;
        justify-content: center;
        min-height: 44px;
        margin-top: 8px;
    }

    /* -------------------------------------------------------
       FORMULÁRIO DE BROADCAST
       ------------------------------------------------------- */
    .form-broadcast input[type="text"],
    .form-broadcast textarea,
    .form-broadcast select,
    .form-broadcast input[type="datetime-local"] {
        font-size: 16px; /* evita zoom iOS */
        min-height: 44px;
    }

    .form-broadcast textarea {
        min-height: 100px;
    }

    /* Grupo dos radios */
    .destinatarios-radio-group {
        display: flex;
        flex-direction: column;
        padding: 6px;
        background: var(--bg-elev-2);
        border-radius: 10px;
        border: 1px solid var(--border);
    }

    /* Header da lista de alunos */
    .lista-alunos-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 8px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .lista-alunos-header .btn-sm {
        min-height: 38px;
        padding: 8px 12px;
        font-size: 0.78rem;
    }

    /* Container scrollável dos checkboxes */
    .lista-alunos-broadcast {
        max-height: 320px;
        overflow-y: auto;
        border: 1px solid var(--border);
        border-radius: 8px;
        background: var(--bg-elev-2);
    }

    /* Cada item de aluno */
    .item-aluno-broadcast {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px 14px;
        border-bottom: 1px solid var(--border);
        cursor: pointer;
        transition: background 0.15s;
        margin: 0;
        min-height: 56px;
    }

    .item-aluno-broadcast:last-child {
        border-bottom: none;
    }

    .item-aluno-broadcast input[type="checkbox"] {
        margin: 0;
        flex-shrink: 0;
        width: 20px;
        height: 20px;
        accent-color: var(--cyan);
    }

    .item-aluno-info {
        flex: 1;
        min-width: 0;
    }

    .item-aluno-info strong {
        display: block;
        font-size: 0.92rem;
        line-height: 1.25;
    }

    .item-aluno-info .texto-suave {
        font-size: 0.78rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Botão enviar do form */
    .acoes-broadcast {
        justify-content: stretch !important;
    }

    .acoes-broadcast .btn {
        width: 100%;
        justify-content: center;
        min-height: 48px;
        font-size: 0.92rem;
    }

    /* -------------------------------------------------------
       LISTA DE BROADCASTS ENVIADOS (personal_broadcast.php)
       ------------------------------------------------------- */
    .lista-broadcasts-enviados {
        display: flex;
        flex-direction: column;
        gap: 12px;
        margin-top: 8px;
    }

    .card-broadcast-enviado {
        margin: 0;
        padding: 14px 16px;
    }

    .card-broadcast-inner {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .card-broadcast-topo {
        display: flex;
        align-items: center;
        gap: 12px;
        flex-wrap: wrap;
    }

    .card-broadcast-icone {
        width: 38px;
        height: 38px;
        border-radius: 10px;
        background: rgba(168,85,247,0.12);
        color: #a855f7;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    .card-broadcast-icone svg,
    .card-broadcast-icone i {
        width: 18px;
        height: 18px;
    }

    .card-broadcast-titulo {
        display: block;
        font-size: 0.95rem;
        line-height: 1.25;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .card-broadcast-dest {
        font-size: 0.78rem;
        margin-top: 2px;
    }

    .card-broadcast-badge {
        margin-left: auto;
        flex-shrink: 0;
    }

    .card-broadcast-data {
        font-size: 0.83rem;
        margin-top: 4px;
    }

    .card-broadcast-acao {
        width: 100%;
    }

    .card-broadcast-acao .btn {
        width: 100%;
        justify-content: center;
        min-height: 44px;
    }

    /* -------------------------------------------------------
       MENSAGEM ENVIADA (personal_broadcast_ver.php)
       ------------------------------------------------------- */
    .mensagem-enviada {
        display: flex;
        gap: 14px;
        align-items: flex-start;
        margin-top: 8px;
    }

    .mensagem-icone {
        width: 42px;
        height: 42px;
        border-radius: 10px;
        background: rgba(168,85,247,0.12);
        color: #a855f7;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    .mensagem-icone svg,
    .mensagem-icone i {
        width: 20px;
        height: 20px;
    }

    .mensagem-conteudo {
        flex: 1;
        min-width: 0;
    }

    .mensagem-texto {
        white-space: pre-wrap;
        line-height: 1.6;
        margin: 0 0 12px;
        font-size: 0.92rem;
        word-break: break-word;
    }

    .mensagem-meta {
        display: flex;
        align-items: center;
        gap: 14px;
        flex-wrap: wrap;
        font-size: 0.82rem;
    }

    .mensagem-link {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        font-weight: 600;
        word-break: break-all;
    }

    /* -------------------------------------------------------
       GRID DE ESTATÍSTICAS (personal_broadcast_ver.php)
       ------------------------------------------------------- */
    .grid-stats-broadcast {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .stat-broadcast {
        padding: 14px 16px;
        border-radius: 10px;
        background: rgba(255,255,255,0.03);
        border-left: 3px solid var(--border);
        min-width: 0;
    }

    .stat-broadcast.stat-neutro {
        border-left-color: var(--border-forte);
    }

    .stat-broadcast.stat-sucesso {
        background: rgba(34,197,94,0.06);
        border-left-color: #22c55e;
    }

    .stat-broadcast.stat-aviso {
        background: rgba(234,179,8,0.06);
        border-left-color: #eab308;
    }

    .stat-broadcast.stat-arquivada {
        background: rgba(107,114,128,0.08);
        border-left-color: #6b7280;
    }

    .stat-label {
        font-size: 0.7rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: var(--texto-fraco);
        margin-bottom: 4px;
        font-weight: 600;
    }

    .stat-broadcast.stat-sucesso .stat-label { color: #22c55e; }
    .stat-broadcast.stat-aviso .stat-label   { color: #eab308; }

    .stat-valor {
        font-size: 1.6rem;
        font-weight: 700;
        line-height: 1.1;
    }

    .stat-broadcast.stat-sucesso .stat-valor { color: #22c55e; }

    /* -------------------------------------------------------
       TABELA DE DESTINATÁRIOS (personal_broadcast_ver.php)
       ------------------------------------------------------- */
    .tabela-destinatarios td[data-label="Nome"] {
        display: block;
        padding-bottom: 8px;
        border-bottom: 1px solid var(--border);
        margin-bottom: 6px;
        text-align: left;
    }
    .tabela-destinatarios td[data-label="Nome"]::before {
        display: none;
    }

    .tabela-destinatarios td[data-label="Email"] {
        display: block;
        padding: 4px 0 8px;
        border-bottom: 1px solid var(--border);
        margin-bottom: 6px;
        text-align: left;
        word-break: break-all;
        font-size: 0.8rem;
    }
    .tabela-destinatarios td[data-label="Email"]::before {
        display: none;
    }

    .tabela-destinatarios td[data-label="Status"] {
        padding: 6px 0;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 8px;
    }
    .tabela-destinatarios td[data-label="Status"]::before {
        display: none;
    }
}

@media (max-width: 380px) {
    /* Em telas muito pequenas, grid de stats vira 1 coluna */
    .grid-stats-broadcast {
        grid-template-columns: 1fr;
    }

    .titulo-broadcast {
        font-size: 1.15rem !important;
    }

    .card-broadcast-titulo {
        font-size: 0.88rem;
    }
}

/* =========================================================
   LOGO — PNG substituindo o SVG
   ========================================================= */

/* Imagem do logo (navbar + login) */
.logo-marca {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 8px;
}

/* No navbar, tamanho fixo e alinhamento com o texto */
.navbar-brand .logo-marca {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

/* No login (desktop), tamanho maior */
.login-logo .logo-marca {
    width: 48px;
    height: 48px;
    border-radius: 10px;
}

/* No login (mobile compacto) */
.login-marca-mobile .logo-marca {
    width: 38px;
    height: 38px;
    border-radius: 9px;
}

/* Em telas muito pequenas, navbar enxuta */
@media (max-width: 900px) {
    .navbar-brand .logo-marca {
        width: 32px;
        height: 32px;
    }
}

/* =========================================================
   FIX — Ícones Lucide (stroke herda currentColor em ambos temas)
   ========================================================= */
svg.lucide,
svg[data-lucide],
[data-lucide] svg {
    color: inherit;
    stroke: currentColor;
    flex-shrink: 0;
    vertical-align: middle;
}

/* Garante que ícones em botões/labels/link herdem a cor do contexto */
.btn svg.lucide,
.campo label svg.lucide,
.nav-menu a svg.lucide,
.bloco-header h2 svg.lucide,
.perfil-secao svg.lucide,
.metrica-icone svg.lucide,
.usuario-dropdown a svg.lucide {
    stroke: currentColor;
}

/* Fallback: se o SVG ainda não foi renderizado, mostra o <i> com tamanho certo */
i[data-lucide] {
    display: inline-block;
    width: 1em;
    height: 1em;
    vertical-align: -0.125em;
}

/* Botões que usam <i> antes do lucide substituir */
.btn i[data-lucide],
.campo label i[data-lucide],
.nav-menu a i[data-lucide] {
    color: currentColor;
}

/* =========================================================
   MODAL DE VÍDEO DO EXERCÍCIO (admin + personal)
   ========================================================= */

.exbtn-video {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1.5px solid rgba(101, 233, 217, 0.45);
    background: rgba(101, 233, 217, 0.10);
    color: var(--cyan);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all .2s ease;
    -webkit-tap-highlight-color: transparent;
    margin-left: 6px;
    padding: 0;
}

.exbtn-video:hover,
.exbtn-video:focus-visible {
    background: rgba(101, 233, 217, 0.22);
    border-color: var(--cyan);
    transform: scale(1.08);
    outline: none;
}

.exbtn-video:active { transform: scale(0.95); }

.exbtn-video svg,
.exbtn-video i {
    width: 14px;
    height: 14px;
    stroke-width: 2.4;
}

/* Overlay */
.exvideo {
    position: fixed;
    inset: 0;
    z-index: 300;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding:
        max(16px, env(safe-area-inset-top))
        max(16px, env(safe-area-inset-right))
        max(16px, env(safe-area-inset-bottom))
        max(16px, env(safe-area-inset-left));
    animation: exvideoFade .18s ease-out;
}
.exvideo[hidden] { display: none !important; }

@keyframes exvideoFade { from { opacity: 0; } to { opacity: 1; } }

.exvideo-box {
    width: 100%;
    max-width: 920px;
    max-height: calc(100dvh - 32px);
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0,0,0,0.6);
    animation: exvideoPop .22s cubic-bezier(.22,1.1,.4,1);
}

@keyframes exvideoPop {
    from { transform: scale(.96) translateY(8px); opacity: 0; }
    to   { transform: scale(1) translateY(0); opacity: 1; }
}

.exvideo-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-elev);
    flex-shrink: 0;
}

.exvideo-header h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--texto);
    min-width: 0;
}

.exvideo-header h2 svg,
.exvideo-header h2 i {
    width: 18px;
    height: 18px;
    color: var(--cyan);
    flex-shrink: 0;
}

.exvideo-x {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid var(--border-forte);
    background: transparent;
    color: var(--texto-suave);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all .15s ease;
}
.exvideo-x:hover { color: #ef4444; border-color: #ef4444; }
.exvideo-x svg, .exvideo-x i { width: 18px; height: 18px; }

.exvideo-body {
    flex: 1 1 auto;
    min-height: 0;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.exvideo-iframe,
.exvideo-video {
    width: 100%;
    height: 100%;
    max-height: calc(100dvh - 200px);
    border: none;
    display: block;
    background: #000;
    object-fit: contain;
}

/* SVG */
.exvideo-svg-wrap {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center,
        rgba(101, 233, 217, 0.06) 0%,
        rgba(0, 0, 0, 0.85) 70%);
    padding: 24px;
}

.exvideo-svg-img {
    max-width: 100%;
    max-height: calc(100dvh - 220px);
    width: auto;
    height: auto;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
    display: block;
    filter: drop-shadow(0 8px 24px rgba(101, 233, 217, 0.12));
}

.exvideo-svg-legenda {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--texto-fraco);
    background: rgba(0, 0, 0, 0.5);
    padding: 4px 10px;
    border-radius: 999px;
    backdrop-filter: blur(4px);
    pointer-events: none;
    white-space: nowrap;
}

.exvideo-fallback {
    padding: 32px 20px;
    text-align: center;
    color: var(--texto-suave);
    width: 100%;
}

.exvideo-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 18px;
    border-top: 1px solid var(--border);
    background: var(--bg-elev);
    flex-shrink: 0;
    flex-wrap: wrap;
}

.exvideo-titulo {
    font-size: 0.85rem;
    color: var(--texto-suave);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    flex: 1;
}

.exvideo-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--cyan);
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 8px;
    transition: background .15s ease;
    flex-shrink: 0;
}
.exvideo-link:hover { background: rgba(101, 233, 217, 0.10); }
.exvideo-link svg, .exvideo-link i { width: 14px; height: 14px; }

@media (max-width: 640px) {
    .exvideo { padding: 8px; }
    .exvideo-box { max-height: calc(100dvh - 16px); border-radius: 12px; }
    .exvideo-header { padding: 12px 14px; }
    .exvideo-header h2 { font-size: 0.92rem; }
    .exvideo-footer { padding: 10px 14px; }
    .exvideo-iframe, .exvideo-video { max-height: calc(100dvh - 180px); }
    .exvideo-svg-wrap { padding: 12px; }
    .exvideo-svg-img { max-height: calc(100dvh - 180px); }
}

/* =========================================================
   AJUSTE — Nome do exercício no card
   (permite 2 linhas + botão ▶ sempre visível)
   ========================================================= */

/* O container do topo vira grid: ícone | título | ações */
.card-exercicio-topo {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    align-items: center;
    gap: 8px;
}

.card-exercicio-topo > div:first-child {
    /* Ícone do exercício */
    grid-column: 1;
}

.card-exercicio-topo > div:nth-child(2) {
    /* Bloco do título */
    grid-column: 2;
    min-width: 0;
}

.card-exercicio-topo .exbtn-video {
    grid-column: 3;
    margin-left: 0;
}

.card-exercicio-topo .badge {
    grid-column: 4;
    flex-shrink: 0;
}

/* Nome do exercício: 2 linhas com ellipsis */
.card-exercicio h3 {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.25;
    /* em vez de nowrap, deixa quebrar */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    word-break: break-word;
}

/* Equipamento embaixo do nome, 1 linha */
.card-exercicio-topo .texto-suave {
    font-size: 0.75rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 2px;
}

/* Em telas pequenas, o card fica mais compacto */
@media (max-width: 480px) {
    .card-exercicio h3 {
        font-size: 0.85rem;
        -webkit-line-clamp: 2;
    }
}