/* ===== RESET E BASE ===== */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

:root {
    --dark: #14141a;
    --grey: #6b7280;
    --grey-soft: #9ca3af;
    --line: #ececef;
    --bg: #f6f6f8;
    --card-bg: #ffffff;
    --accent: #e5384f;
    --accent-dark: #c22540;
    --accent-soft: #fde8ea;
    --green: #1f9d63;
    --green-soft: #e4f8ee;
    --radius-sm: 10px;
    --radius: 14px;
    --radius-lg: 20px;
    --shadow-sm: 0 1px 3px rgba(20, 20, 26, 0.06);
    --shadow: 0 4px 16px rgba(20, 20, 26, 0.08);
    --shadow-lg: 0 12px 32px rgba(20, 20, 26, 0.12);
}

html { -webkit-text-size-adjust: 100%; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--dark);
    line-height: 1.5;
    padding-bottom: 40px;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { color: var(--dark); letter-spacing: -0.01em; }

button { font-family: inherit; cursor: pointer; transition: transform 0.08s ease, opacity 0.15s ease, background 0.15s ease, border-color 0.15s ease; }
button:active { transform: scale(0.97); }
button:disabled { cursor: default; }

input { font-family: inherit; }

/* ===== LOGIN ===== */
.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(180deg, #fafafa 0%, var(--bg) 100%);
}

.login-card {
    width: 100%;
    max-width: 340px;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 36px 28px;
    text-align: center;
}

.login-card h1 { font-size: 24px; margin-bottom: 4px; font-weight: 800; }
.login-sub { color: var(--grey); font-size: 14px; margin-bottom: 26px; }

.login-card form { display: flex; flex-direction: column; gap: 14px; text-align: left; }
.login-card label { font-size: 12.5px; font-weight: 700; color: var(--grey); text-transform: uppercase; letter-spacing: 0.4px; }

.login-card input {
    padding: 13px 14px;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    font-size: 16px;
    background: var(--bg);
    transition: border-color 0.15s ease;
}

.login-card input:focus { outline: none; border-color: var(--accent); background: #fff; }

.login-card button {
    margin-top: 6px;
    padding: 14px;
    background: var(--dark);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 700;
}

.erro-msg {
    background: var(--accent-soft);
    color: var(--accent-dark);
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 18px;
    font-weight: 600;
}

/* ===== TOPBAR ===== */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 16px 10px;
}

.topbar h1 { font-size: 21px; font-weight: 800; }

.topbar-links { display: flex; gap: 8px; }

.link-sair, .link-dash {
    color: var(--grey);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    background: var(--card-bg);
    box-shadow: var(--shadow-sm);
    padding: 8px 14px;
    border-radius: 20px;
    transition: box-shadow 0.15s ease;
}

.link-dash { color: var(--dark); font-weight: 700; }

/* ===== HOME (BOTAO TREINAR) ===== */
.home-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 68vh;
    padding: 24px;
    text-align: center;
}

.btn-treinar {
    width: 100%;
    max-width: 320px;
    padding: 34px 22px;
    border: none;
    border-radius: var(--radius-lg);
    background: linear-gradient(155deg, var(--accent) 0%, var(--accent-dark) 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: 0 14px 28px -8px rgba(229, 56, 79, 0.45);
}

.btn-treinar span {
    font-size: 21px;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.btn-treinar small {
    font-size: 13px;
    opacity: 0.9;
    font-weight: 500;
}

.home-msg { margin-top: 16px; font-size: 13px; color: var(--grey); }

.btn-extra {
    width: 100%;
    max-width: 320px;
    margin-top: 16px;
    padding: 15px 20px;
    border: none;
    border-radius: var(--radius);
    background: var(--card-bg);
    color: var(--dark);
    font-size: 14.5px;
    font-weight: 700;
    box-shadow: var(--shadow-sm);
}

/* ===== FAIXA DE SESSAO (tela de treino) ===== */
.faixa-sessao {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 16px;
    margin: 0 16px 16px;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    font-size: 13px;
    font-weight: 600;
    flex-wrap: wrap;
}

.faixa-sessao button {
    border: none;
    background: var(--accent-soft);
    color: var(--accent-dark);
    font-size: 12px;
    font-weight: 700;
    padding: 7px 12px;
    border-radius: 20px;
}

/* ===== TABS EXERCICIO ===== */
.tabs-exercicio {
    display: flex;
    gap: 8px;
    padding: 0 16px 18px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tabs-exercicio::-webkit-scrollbar { display: none; }

.tab-exercicio {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: var(--card-bg);
    box-shadow: var(--shadow-sm);
    color: var(--grey);
    font-weight: 700;
    font-size: 14px;
}

.tab-exercicio.ativa {
    background: var(--dark);
    color: #fff;
    box-shadow: 0 6px 14px -4px rgba(20, 20, 26, 0.4);
}

/* ===== PAINEL EXERCICIO ===== */
.painel-exercicio {
    padding: 0 16px 32px;
}

.kicker {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.6px;
    color: var(--accent);
    text-transform: uppercase;
    margin-bottom: 6px;
}

.painel-exercicio h2 { font-size: 21px; line-height: 1.3; margin-bottom: 2px; font-weight: 800; }
.apelido { color: var(--grey); font-size: 14px; margin-bottom: 18px; }

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 18px;
}

.info-grid > div {
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.info-label {
    font-size: 10px;
    font-weight: 800;
    color: var(--grey-soft);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-valor { font-size: 14px; font-weight: 700; }

/* ===== DETALHES (COLAPSAVEL) ===== */
.bloco-detalhes {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
    overflow: hidden;
}

.bloco-detalhes summary {
    padding: 15px 16px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bloco-detalhes summary::after {
    content: "+";
    font-size: 18px;
    color: var(--grey-soft);
    font-weight: 400;
}

.bloco-detalhes[open] summary::after { content: "–"; }

.bloco-detalhes summary::-webkit-details-marker { display: none; }

.detalhes-conteudo {
    padding: 0 16px 18px;
    border-top: 1px solid var(--line);
}

.detalhes-conteudo h3 {
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--grey);
    font-weight: 800;
    margin: 16px 0 8px;
}

.detalhes-conteudo ul, .detalhes-conteudo ol {
    padding-left: 18px;
    font-size: 14px;
}

.lista-passos li { margin-bottom: 5px; }
.lista-erros li { color: var(--accent-dark); margin-bottom: 5px; }

/* ===== REGISTRO DE CARGA ===== */
.bloco-registro {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 18px;
    margin-bottom: 20px;
}

.bloco-registro h3 { font-size: 15px; margin-bottom: 16px; font-weight: 800; }

.rotulo-campo {
    font-size: 11.5px;
    font-weight: 800;
    color: var(--grey);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 9px;
}

.rotulo-linha {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 9px;
}

.rotulo-linha .rotulo-campo { margin-bottom: 0; }

.btn-repetir {
    border: none;
    background: none;
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
    padding: 4px 0;
}

.btn-repetir:disabled { color: var(--grey-soft); }

.cores-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.cor-btn {
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 11px 8px;
    background: var(--card-bg);
    font-size: 12px;
    font-weight: 700;
    color: var(--dark);
    position: relative;
    padding-left: 18px;
    text-align: left;
}

.cor-btn::before {
    content: "";
    position: absolute;
    left: 7px;
    top: 11px;
    bottom: 11px;
    width: 4px;
    border-radius: 2px;
    background: var(--cor-hex);
}

.cor-btn small { color: var(--grey); font-weight: 500; }

.cor-btn.selecionada {
    border-color: var(--cor-hex);
    background: color-mix(in srgb, var(--cor-hex) 8%, white);
    box-shadow: var(--shadow-sm);
}

.carga-total {
    text-align: center;
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 13px;
    font-size: 14px;
    margin-bottom: 16px;
    font-weight: 600;
}

.carga-valor, .carga-valor-edit { font-size: 21px; font-weight: 800; }

.campo-linha { margin-bottom: 14px; }

.reps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.campo-serie { margin-bottom: 0; }
.campo-serie input { text-align: center; }

.campo { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }

.campo label {
    font-size: 11.5px;
    font-weight: 800;
    color: var(--grey);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.campo input {
    padding: 12px 13px;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    font-size: 16px;
    background: var(--bg);
    transition: border-color 0.15s ease, background 0.15s ease;
}

.campo input:focus { outline: none; border-color: var(--accent); background: #fff; }

.dificuldade-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 18px;
}

.dif-btn {
    padding: 11px 0;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--card-bg);
    font-size: 13px;
    font-weight: 700;
    color: var(--grey);
}

.dif-btn.selecionada { background: var(--dark); color: #fff; border-color: var(--dark); }

.btn-salvar {
    width: 100%;
    padding: 14px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 800;
    box-shadow: 0 8px 18px -6px rgba(229, 56, 79, 0.5);
}

.btn-salvar:disabled { opacity: 0.5; box-shadow: none; }

.msg-salvo {
    text-align: center;
    font-size: 13px;
    margin-top: 12px;
    color: var(--green);
    min-height: 16px;
    font-weight: 600;
}

.msg-salvo.erro { color: var(--accent-dark); }

/* ===== TAGS E BOTÕES USADOS NOS CARDS DE SESSÃO ===== */
.hist-tag {
    display: inline-block;
    font-size: 10px;
    font-weight: 800;
    padding: 3px 9px;
    border-radius: 20px;
    background: var(--bg);
    color: var(--grey);
    text-transform: uppercase;
    white-space: nowrap;
}

.hist-del-extra {
    background: none;
    border: none;
    color: var(--grey-soft);
    font-size: 14px;
    padding: 0 4px;
}

/* ===== DASHBOARD ===== */
.dash-wrap { padding: 0 16px 32px; }

.dash-resumo {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 22px;
}

.dash-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 16px;
    text-align: center;
}

.dash-card .dash-num { font-size: 26px; font-weight: 800; display: block; color: var(--accent-dark); }
.dash-card .dash-label { font-size: 11px; color: var(--grey); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 700; }

.dash-secao { margin-bottom: 24px; }
.dash-secao h3 { font-size: 15px; margin-bottom: 12px; font-weight: 800; }

.dash-secao-topo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.dash-secao-topo h3 { margin-bottom: 0; }

.btn-exportar {
    font-size: 12px;
    font-weight: 700;
    color: var(--dark);
    text-decoration: none;
    background: var(--card-bg);
    box-shadow: var(--shadow-sm);
    padding: 7px 14px;
    border-radius: 20px;
}

.calendario {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 18px;
}

.calendario-cabecalho {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.calendario-cabecalho button {
    border: none;
    background: var(--bg);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 15px;
    color: var(--dark);
    font-weight: 700;
}

.calendario-mes { font-weight: 800; font-size: 14px; text-transform: capitalize; }

.calendario-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    text-align: center;
}

.calendario-dow {
    font-size: 10px;
    color: var(--grey-soft);
    font-weight: 800;
    padding-bottom: 6px;
}

.calendario-dia {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    border-radius: 8px;
    color: var(--dark);
}

.calendario-dia.vazio { visibility: hidden; }

.calendario-dia.treinado {
    background: var(--green);
    color: #fff;
    font-weight: 800;
}

.evolucao-item {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 16px;
    margin-bottom: 12px;
}

.evolucao-item h4 { font-size: 13.5px; margin-bottom: 8px; font-weight: 700; }

.evolucao-item svg { display: block; width: 100%; height: 60px; }

.evolucao-vazio { color: var(--grey); font-size: 13px; text-align: center; padding: 22px 0; }

.evolucao-legenda {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: var(--grey-soft);
    margin-top: 6px;
    font-weight: 600;
}

.sessao-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 10px;
    overflow: hidden;
}

.sessao-card summary {
    padding: 15px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    list-style: none;
    gap: 8px;
}

.sessao-card summary::-webkit-details-marker { display: none; }

.sessao-card-titulo { font-size: 13.5px; font-weight: 700; }
.sessao-card-total { font-size: 13px; font-weight: 800; color: var(--accent-dark); white-space: nowrap; }

.sessao-card-corpo {
    padding: 4px 16px 16px;
    border-top: 1px solid var(--line);
}

.sessao-exercicio {
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.sessao-exercicio:last-child { border-bottom: none; }

.sessao-exercicio-topo {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.sessao-exercicio-nome { font-size: 13px; font-weight: 700; }

.sessao-exercicio-detalhe { font-size: 12px; color: var(--grey); }

.btn-editar-registro {
    border: none;
    background: none;
    color: var(--grey);
    font-size: 11px;
    font-weight: 700;
    text-decoration: underline;
    padding: 6px 0 0;
}

.sessao-exercicio-edit {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--line);
}

.btn-apagar-sessao {
    width: 100%;
    margin-top: 14px;
    padding: 11px;
    background: none;
    border: 1.5px solid var(--accent-soft);
    border-radius: var(--radius-sm);
    color: var(--accent);
    font-size: 12.5px;
    font-weight: 700;
}

.edicao-botoes {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.edicao-botoes .btn-salvar-edicao {
    flex: 1;
    padding: 11px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 800;
}

.edicao-botoes .btn-cancelar-edicao {
    flex: 1;
    padding: 11px;
    background: none;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 700;
    color: var(--grey);
}

/* ===== TELAS MAIORES (min-width, mobile-first) ===== */
@media (min-width: 600px) {
    .topbar, .tabs-exercicio, .painel-exercicio, .dash-wrap, .faixa-sessao, .home-wrap {
        max-width: 560px;
        margin-left: auto;
        margin-right: auto;
    }

    .painel-exercicio h2 { font-size: 25px; }

    .cores-grid { grid-template-columns: repeat(5, 1fr); }
}

@media (min-width: 900px) {
    .topbar, .tabs-exercicio, .painel-exercicio, .dash-wrap, .faixa-sessao, .home-wrap {
        max-width: 680px;
    }
}
