/* ===================================================
   FORÇA PRO 21K — CSS PRINCIPAL
   Design moderno para planilha de musculação
   =================================================== */

:root {
    --primary: #E8521A;
    --primary-dark: #c44010;
    --primary-light: #ff7043;
    --secondary: #1E3A5F;
    --secondary-light: #2a5298;
    --accent: #F5A623;
    --success: #27AE60;
    --warning: #F39C12;
    --danger: #E74C3C;
    --info: #2980B9;
    --bg: #0F1923;
    --bg-card: #182536;
    --bg-card2: #1E3045;
    --bg-input: #0d1b2a;
    --text: #E8EDF3;
    --text-muted: #7B9AB2;
    --text-light: #B8C8D8;
    --border: #2A4060;
    --border-light: #3A5070;
    --radius: 14px;
    --radius-sm: 8px;
    --shadow: 0 4px 24px rgba(0,0,0,0.35);
    --shadow-sm: 0 2px 10px rgba(0,0,0,0.2);
    --transition: all 0.25s ease;

    /* Phase colors */
    --phase-base: #27AE60;
    --phase-construcao: #2980B9;
    --phase-pico: #E8521A;
    --phase-recuperacao: #8E44AD;
}

/* ===================== RESET & BASE ===================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    font-size: 15px;
    line-height: 1.6;
}

/* ===================== HEADER ===================== */
.main-header {
    background: linear-gradient(135deg, #0d1b2a 0%, #182536 50%, #1a2e45 100%);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 30px rgba(0,0,0,0.5);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    font-size: 2.2rem;
    animation: run 1.5s ease-in-out infinite alternate;
}

@keyframes run {
    from { transform: translateX(-3px) rotate(-2deg); }
    to   { transform: translateX(3px) rotate(2deg); }
}

.logo-text h1 {
    font-size: 1.3rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 1px;
}

.logo-text p {
    font-size: 0.72rem;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.athlete-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.5rem 1rem;
}

.athlete-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.85rem;
    color: white;
}

.athlete-name { display: block; font-weight: 600; font-size: 0.9rem; }
.athlete-detail { display: block; font-size: 0.72rem; color: var(--text-muted); }

/* ===================== NAV ===================== */
.main-nav {
    display: flex;
    gap: 0.25rem;
    padding: 0 1.5rem 0.75rem;
    overflow-x: auto;
    scrollbar-width: none;
}
.main-nav::-webkit-scrollbar { display: none; }

.nav-btn {
    display: flex; align-items: center; gap: 0.4rem;
    padding: 0.5rem 1rem;
    border: none; border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
}

.nav-btn:hover { background: rgba(255,255,255,0.06); color: var(--text); }
.nav-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 0 15px rgba(232,82,26,0.4);
}

/* ===================== MAIN CONTENT ===================== */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* ===================== TAB SECTIONS ===================== */
.tab-section { display: none; animation: fadeIn 0.3s ease; }
.tab-section.active { display: block; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ===================== PHASE BANNER ===================== */
.phase-banner {
    background: linear-gradient(135deg, var(--secondary) 0%, #1a3a5c 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}

.phase-banner::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
}

.phase-banner-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.phase-icon-wrap { font-size: 2.5rem; }

.phase-text h2 { font-size: 1.4rem; font-weight: 700; color: var(--text); }
.phase-text p  { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.2rem; }

.phase-progress-wrap { margin-left: auto; text-align: right; min-width: 200px; }
.phase-label { font-size: 0.75rem; color: var(--text-muted); }
.phase-bar {
    height: 8px; background: rgba(255,255,255,0.1);
    border-radius: 10px; margin: 0.4rem 0;
    overflow: hidden;
}
.phase-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 10px;
    transition: width 1s ease;
    width: 0%;
}
.phase-pct { font-size: 0.85rem; font-weight: 700; color: var(--accent); }

/* ===================== STATS GRID ===================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-align: center;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }

.stat-card::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0; height: 3px;
}
.stat-card.primary::after  { background: var(--primary); }
.stat-card.success::after  { background: var(--success); }
.stat-card.warning::after  { background: var(--warning); }
.stat-card.info::after     { background: var(--info); }

.stat-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    display: block;
}
.stat-card.primary .stat-icon { color: var(--primary); }
.stat-card.success .stat-icon { color: var(--success); }
.stat-card.warning .stat-icon { color: var(--warning); }
.stat-card.info .stat-icon    { color: var(--info); }

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1;
    margin-bottom: 0.3rem;
}
.stat-label { font-size: 0.75rem; color: var(--text-muted); }

/* ===================== DASHBOARD GRID ===================== */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 768px) { .dashboard-grid { grid-template-columns: 1fr; } }

/* ===================== CARDS ===================== */
.dashboard-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    transition: var(--transition);
}
.dashboard-card:hover { border-color: var(--border-light); }

.card-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.card-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    display: flex; align-items: center; gap: 0.5rem;
}

.card-header h3 i { color: var(--primary); }

/* ===================== TODAY CARD ===================== */
.today-badge {
    background: var(--primary);
    color: white;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
}

.today-preview { min-height: 120px; margin-bottom: 1rem; }

.no-workout-msg {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 0.5rem;
    padding: 2rem;
    color: var(--text-muted);
    text-align: center;
}

.no-workout-msg i { font-size: 2rem; }

.today-exercise-list { list-style: none; }
.today-exercise-list li {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-size: 0.85rem;
    color: var(--text-light);
}
.today-exercise-list li i { color: var(--primary); font-size: 0.7rem; }

/* ===================== JOURNEY TIMELINE ===================== */
.journey-timeline {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 280px;
    overflow-y: auto;
    padding-right: 0.5rem;
}
.journey-timeline::-webkit-scrollbar { width: 4px; }
.journey-timeline::-webkit-scrollbar-track { background: transparent; }
.journey-timeline::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.journey-item {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    transition: var(--transition);
}
.journey-item.current {
    background: rgba(232,82,26,0.1);
    border-color: var(--primary);
}
.journey-item.done {
    opacity: 0.6;
}

.journey-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.journey-item.done   .journey-dot { background: var(--success); }
.journey-item.current .journey-dot { background: var(--primary); box-shadow: 0 0 8px var(--primary); }
.journey-item.future .journey-dot { background: var(--border); }

.journey-label { font-size: 0.82rem; font-weight: 500; }
.journey-dates { font-size: 0.72rem; color: var(--text-muted); margin-left: auto; }

/* ===================== WEEK DAYS GRID ===================== */
.week-days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
}

@media (max-width: 600px) { .week-days-grid { grid-template-columns: repeat(4, 1fr); } }

.day-cell {
    text-align: center;
    padding: 0.75rem 0.25rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.02);
    transition: var(--transition);
    cursor: pointer;
}
.day-cell:hover { border-color: var(--primary); }
.day-cell.today { background: rgba(232,82,26,0.15); border-color: var(--primary); }
.day-cell.done  { background: rgba(39,174,96,0.1); border-color: var(--success); }
.day-cell.rest  { opacity: 0.5; }

.day-cell-name { font-size: 0.68rem; color: var(--text-muted); text-transform: uppercase; font-weight: 600; letter-spacing: 0.5px; }
.day-cell-icon { font-size: 1.2rem; margin: 0.3rem 0; }
.day-cell-label { font-size: 0.65rem; color: var(--text-light); }

/* ===================== ALERTS ===================== */
.alerts-section { display: flex; flex-direction: column; gap: 1rem; margin-top: 1.5rem; }

.alert-card {
    display: flex; gap: 1rem; align-items: flex-start;
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    border: 1px solid;
}

.warning-alert { background: rgba(243,156,18,0.08); border-color: rgba(243,156,18,0.3); }
.info-alert    { background: rgba(41,128,185,0.08); border-color: rgba(41,128,185,0.3); }

.alert-icon { font-size: 1.4rem; }
.warning-alert .alert-icon { color: var(--warning); }
.info-alert    .alert-icon { color: var(--info); }

.alert-text strong { display: block; margin-bottom: 0.3rem; font-size: 0.9rem; }
.alert-text p { font-size: 0.82rem; color: var(--text-muted); line-height: 1.5; }

/* ===================== SECTION TITLE ===================== */
.section-title {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}
.section-title h2 {
    font-size: 1.4rem;
    font-weight: 700;
    display: flex; align-items: center; gap: 0.5rem;
}
.section-title h2 i { color: var(--primary); }
.section-title p { color: var(--text-muted); font-size: 0.85rem; margin-top: 0.3rem; }

/* ===================== MACRO TIMELINE ===================== */
.macro-overview {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.macro-header {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 0.5rem;
    margin-bottom: 1.25rem;
}
.macro-header h3 { font-size: 1rem; font-weight: 600; }

.macro-legend {
    display: flex; align-items: center; gap: 1rem;
    font-size: 0.78rem; color: var(--text-muted);
}
.legend-dot {
    display: inline-block; width: 10px; height: 10px;
    border-radius: 50%; margin-right: 3px;
}
.legend-dot.base       { background: var(--phase-base); }
.legend-dot.construcao { background: var(--phase-construcao); }
.legend-dot.pico       { background: var(--phase-pico); }
.legend-dot.recuperacao{ background: var(--phase-recuperacao); }

.macro-timeline {
    display: grid;
    grid-template-columns: repeat(28, 1fr);
    gap: 3px;
    margin-bottom: 0.5rem;
}

@media (max-width: 768px) { .macro-timeline { grid-template-columns: repeat(14, 1fr); } }
@media (max-width: 480px) { .macro-timeline { grid-template-columns: repeat(7, 1fr); } }

.macro-week {
    height: 40px;
    border-radius: 5px;
    position: relative;
    cursor: pointer;
    transition: var(--transition);
    display: flex; align-items: flex-end; justify-content: center;
    padding-bottom: 3px;
}
.macro-week:hover { transform: scaleY(1.1); filter: brightness(1.2); }
.macro-week.base       { background: var(--phase-base); opacity: 0.7; }
.macro-week.construcao { background: var(--phase-construcao); opacity: 0.7; }
.macro-week.pico       { background: var(--phase-pico); opacity: 0.7; }
.macro-week.recuperacao{ background: var(--phase-recuperacao); opacity: 0.7; }
.macro-week.current    { opacity: 1; box-shadow: 0 0 10px currentColor; }
.macro-week.done       { opacity: 0.4; }
.macro-week-num { font-size: 0.55rem; color: white; font-weight: 600; }

/* ===================== PHASES DETAIL ===================== */
.phases-detail {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
}

.phase-detail-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.25rem;
    border: 1px solid var(--border);
    border-top-width: 3px;
    transition: var(--transition);
}
.phase-detail-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.phase-detail-card.base       { border-top-color: var(--phase-base); }
.phase-detail-card.construcao { border-top-color: var(--phase-construcao); }
.phase-detail-card.pico       { border-top-color: var(--phase-pico); }
.phase-detail-card.recuperacao{ border-top-color: var(--phase-recuperacao); }

.phase-card-header {
    display: flex; align-items: center; gap: 0.5rem;
    margin-bottom: 1rem;
}
.phase-card-icon { font-size: 1.6rem; }
.phase-card-title { font-size: 1rem; font-weight: 700; }
.phase-card-weeks { font-size: 0.75rem; color: var(--text-muted); }

.phase-card-goals { list-style: none; margin-bottom: 1rem; }
.phase-card-goals li {
    display: flex; align-items: flex-start; gap: 0.4rem;
    font-size: 0.82rem; color: var(--text-light);
    padding: 0.3rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.phase-card-goals li i { color: var(--success); font-size: 0.7rem; margin-top: 3px; flex-shrink: 0; }

.phase-card-params {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
}
.param-item {
    background: rgba(255,255,255,0.03);
    border-radius: 6px;
    padding: 0.4rem 0.5rem;
    font-size: 0.73rem;
}
.param-label { color: var(--text-muted); display: block; }
.param-value { color: var(--accent); font-weight: 600; }

/* ===================== MESOCYCLE TABLE ===================== */
.table-responsive { overflow-x: auto; }

.data-table {
    width: 100%; border-collapse: collapse;
    font-size: 0.82rem;
}
.data-table th {
    background: rgba(255,255,255,0.04);
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.5px;
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.data-table td {
    padding: 0.65rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    color: var(--text-light);
    vertical-align: middle;
}
.data-table tr:hover td { background: rgba(255,255,255,0.02); }
.data-table .phase-tag {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
}
.phase-tag.base       { background: rgba(39,174,96,0.15); color: var(--phase-base); }
.phase-tag.construcao { background: rgba(41,128,185,0.15); color: var(--phase-construcao); }
.phase-tag.pico       { background: rgba(232,82,26,0.15); color: var(--phase-pico); }
.phase-tag.recuperacao{ background: rgba(142,68,173,0.15); color: var(--phase-recuperacao); }

/* ===================== WORKOUT SELECTOR ===================== */
.workout-selector {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.workout-selector-inner {
    display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end;
}

.selector-group { display: flex; flex-direction: column; gap: 0.35rem; flex: 1; min-width: 140px; }
.selector-group label { font-size: 0.78rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }

.form-select, .form-input, .form-textarea {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-family: inherit;
    font-size: 0.88rem;
    padding: 0.55rem 0.75rem;
    outline: none;
    transition: var(--transition);
    width: 100%;
}
.form-select:focus, .form-input:focus, .form-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(232,82,26,0.15);
}
option { background: var(--bg-card2); }

.form-range {
    width: 100%;
    accent-color: var(--primary);
}

.form-textarea {
    min-height: 80px;
    resize: vertical;
}

/* ===================== TIMER BAR ===================== */
.timer-bar {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem 1.25rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.timer-display {
    display: flex; align-items: center; gap: 0.75rem;
    font-size: 1.6rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--accent);
}

.timer-display i { color: var(--primary); }

.timer-controls { display: flex; gap: 0.5rem; }

.timer-btn {
    width: 38px; height: 38px;
    border-radius: 50%;
    border: none;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
    transition: var(--transition);
}
.timer-btn.start { background: var(--success); color: white; }
.timer-btn.pause { background: var(--warning); color: white; }
.timer-btn.stop  { background: var(--danger);  color: white; }
.timer-btn:hover { transform: scale(1.1); filter: brightness(1.15); }

/* ===================== WORKOUT CONTENT ===================== */
.workout-content { margin-bottom: 1.5rem; }

.workout-header-card {
    background: linear-gradient(135deg, var(--secondary), #1a3a5c);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    display: flex; align-items: flex-start; gap: 1rem; flex-wrap: wrap;
}

.workout-type-badge {
    display: flex; flex-direction: column; align-items: center;
    background: var(--primary);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    text-align: center;
    min-width: 80px;
}
.workout-type-icon { font-size: 1.5rem; }
.workout-type-label { font-size: 0.65rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; margin-top: 0.25rem; }

.workout-header-info h2 { font-size: 1.2rem; font-weight: 700; }
.workout-header-info .wh-meta { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 0.5rem; }
.wh-meta-item { font-size: 0.8rem; color: var(--text-muted); }
.wh-meta-item strong { color: var(--accent); }

.workout-objective {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: rgba(255,255,255,0.04);
    border-radius: 8px;
    font-size: 0.83rem;
    color: var(--text-light);
    border-left: 3px solid var(--primary);
}

/* EXERCISE TABLE */
.exercise-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 1rem;
    overflow: hidden;
}

.exercise-section-header {
    background: rgba(255,255,255,0.04);
    padding: 0.75rem 1.25rem;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    display: flex; align-items: center; gap: 0.5rem;
    border-bottom: 1px solid var(--border);
}
.exercise-section-header i { color: var(--primary); }

.exercise-table {
    width: 100%;
    border-collapse: collapse;
}
.exercise-table th {
    background: rgba(0,0,0,0.15);
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.6rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.exercise-table td {
    padding: 0.7rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    vertical-align: middle;
    font-size: 0.85rem;
}
.exercise-table tr:last-child td { border-bottom: none; }
.exercise-table tr:hover td { background: rgba(255,255,255,0.02); }

.exercise-name-cell strong { display: block; color: var(--text); }
.exercise-name-cell span { font-size: 0.72rem; color: var(--text-muted); }

.badge-sets {
    display: inline-block;
    background: rgba(232,82,26,0.15);
    color: var(--primary-light);
    border: 1px solid rgba(232,82,26,0.3);
    padding: 0.15rem 0.5rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.rest-badge {
    display: inline-flex; align-items: center; gap: 0.3rem;
    background: rgba(255,255,255,0.06);
    color: var(--text-muted);
    padding: 0.15rem 0.5rem;
    border-radius: 20px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
}
.rest-badge:hover { background: rgba(232,82,26,0.2); color: var(--primary-light); }

.done-checkbox {
    width: 20px; height: 20px;
    accent-color: var(--success);
    cursor: pointer;
}

.exercise-note {
    font-size: 0.72rem;
    color: var(--info);
    font-style: italic;
}

/* LOG FORM */
.log-form-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.log-form { display: flex; flex-direction: column; gap: 1rem; }

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.form-group { display: flex; flex-direction: column; gap: 0.35rem; }
.form-group.full { grid-column: 1 / -1; }
.form-group label { font-size: 0.78rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }

.pse-value {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--accent);
    display: block;
    margin-top: 0.3rem;
}

/* ===================== HISTORY ===================== */
.history-filters {
    margin-bottom: 1.5rem;
    display: flex; gap: 1rem;
}

.history-list { display: flex; flex-direction: column; gap: 1rem; }

.history-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
    transition: var(--transition);
}
.history-item:hover { border-color: var(--border-light); }

.history-date {
    text-align: center;
    min-width: 55px;
}
.history-date-day { font-size: 1.6rem; font-weight: 800; color: var(--primary); line-height: 1; }
.history-date-month { font-size: 0.68rem; color: var(--text-muted); text-transform: uppercase; }

.history-info h4 { font-size: 0.92rem; font-weight: 600; }
.history-info p  { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.2rem; }

.history-meta {
    margin-left: auto;
    display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap;
}
.history-meta-item {
    background: rgba(255,255,255,0.04);
    border-radius: 6px;
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
    color: var(--text-light);
}
.history-meta-item i { color: var(--text-muted); margin-right: 3px; }

.phase-dot {
    width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.phase-dot.base       { background: var(--phase-base); }
.phase-dot.construcao { background: var(--phase-construcao); }
.phase-dot.pico       { background: var(--phase-pico); }
.phase-dot.recuperacao{ background: var(--phase-recuperacao); }

/* ===================== CHARTS ===================== */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.exercise-filter { margin: 1rem 0; max-width: 350px; }

/* ===================== EXERCISES LIBRARY ===================== */
.exercise-filters {
    display: flex; gap: 0.5rem; flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.filter-btn {
    padding: 0.4rem 1rem;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.82rem;
    cursor: pointer;
    transition: var(--transition);
}
.filter-btn:hover { border-color: var(--primary); color: var(--primary); }
.filter-btn.active { background: var(--primary); border-color: var(--primary); color: white; }

.exercises-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.exercise-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    transition: var(--transition);
}
.exercise-card:hover { transform: translateY(-3px); border-color: var(--border-light); box-shadow: var(--shadow); }

.exercise-card-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    margin-bottom: 0.75rem;
}

.exercise-card-name { font-size: 0.95rem; font-weight: 700; color: var(--text); }
.exercise-card-group {
    font-size: 0.68rem;
    padding: 0.15rem 0.5rem;
    border-radius: 20px;
    font-weight: 600;
    white-space: nowrap;
}
.group-superior { background: rgba(232,82,26,0.15); color: var(--primary-light); }
.group-inferior { background: rgba(41,128,185,0.15); color: #5dade2; }
.group-core     { background: rgba(245,166,35,0.15); color: var(--accent); }

.exercise-card-muscles {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}
.exercise-card-muscles strong { color: var(--text-light); }

.exercise-card-note {
    font-size: 0.78rem;
    color: var(--info);
    background: rgba(41,128,185,0.08);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    border-left: 3px solid var(--info);
    font-style: italic;
}

/* ===================== BUTTONS ===================== */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    border-radius: 10px;
    padding: 0.7rem 1.5rem;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
    text-decoration: none;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(232,82,26,0.35); filter: brightness(1.1); }
.btn-primary.full-width { width: 100%; justify-content: center; }

/* ===================== MODAL ===================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 1000;
    display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(4px);
}

.modal-box {
    background: var(--bg-card2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem;
    text-align: center;
    min-width: 280px;
    box-shadow: var(--shadow);
}

.modal-box h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--text);
}

.rest-timer-display {
    font-size: 4rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
    margin: 0.5rem 0;
}

.rest-timer-bar {
    height: 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    overflow: hidden;
    margin: 1rem 0;
}

.rest-timer-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 10px;
    transition: width 1s linear;
    width: 100%;
}

/* ===================== TOAST ===================== */
.toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: var(--bg-card2);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.75rem 1.5rem;
    border-radius: 30px;
    font-size: 0.88rem;
    z-index: 2000;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0;
    box-shadow: var(--shadow);
    pointer-events: none;
    white-space: nowrap;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast.success { border-color: var(--success); }
.toast.error   { border-color: var(--danger); }

/* ===================== EMPTY STATE ===================== */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}
.empty-state i { font-size: 3rem; margin-bottom: 1rem; display: block; }
.empty-state p { font-size: 0.9rem; }

/* ===================== VIDEO MODAL ===================== */
.video-modal-overlay {
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.video-modal-box {
    background: var(--bg-card2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 100%;
    max-width: 800px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    overflow: hidden;
    animation: modalIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.85) translateY(20px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.video-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.video-modal-header h3 {
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text);
}

.video-close-btn {
    background: rgba(255,255,255,0.07);
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
    transition: var(--transition);
}
.video-close-btn:hover {
    background: rgba(232,82,26,0.2);
    color: var(--primary);
    border-color: var(--primary);
}

.video-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    border-radius: 10px;
    background: #000;
    margin-bottom: 1rem;
}

.video-wrapper iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border-radius: 10px;
}

.video-modal-info {
    font-size: 0.85rem;
    color: var(--text-muted);
    padding: 0.75rem 1rem;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
    border-left: 3px solid var(--primary);
    line-height: 1.6;
}
.video-modal-info strong { color: var(--text); display: block; margin-bottom: 0.25rem; }

.video-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
    flex-wrap: wrap;
}

.btn-youtube {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: #FF0000;
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 8px;
    padding: 0.55rem 1.1rem;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.btn-youtube:hover {
    background: #cc0000;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255,0,0,0.3);
}

.btn-close-modal {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255,255,255,0.06);
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.55rem 1.1rem;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.btn-close-modal:hover {
    background: rgba(255,255,255,0.1);
    color: var(--text);
}

/* ========== EXERCISE CARD VIDEO BUTTON ========== */
.exercise-card-footer {
    margin-top: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.btn-watch-video {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(255,0,0,0.1);
    color: #ff6b6b;
    border: 1px solid rgba(255,0,0,0.25);
    border-radius: 20px;
    padding: 0.3rem 0.8rem;
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}
.btn-watch-video:hover {
    background: rgba(255,0,0,0.2);
    border-color: rgba(255,0,0,0.5);
    color: #ff4444;
    transform: translateY(-1px);
}
.btn-watch-video i { font-size: 0.85rem; }

/* Video button in exercise TABLE (workout tab) */
.exercise-video-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: rgba(255,0,0,0.1);
    color: #ff6b6b;
    border: 1px solid rgba(255,0,0,0.2);
    border-radius: 20px;
    padding: 0.2rem 0.6rem;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}
.exercise-video-link:hover {
    background: rgba(255,0,0,0.22);
    color: #ff3333;
    transform: translateY(-1px);
}

/* ===================== PSE COLORS ===================== */
.pse-1,.pse-2 { color: var(--success); }
.pse-3,.pse-4 { color: #a9cce3; }
.pse-5,.pse-6 { color: var(--accent); }
.pse-7,.pse-8 { color: var(--warning); }
.pse-9,.pse-10 { color: var(--danger); }

/* ===================== WEEK LABEL ===================== */
.week-label {
    font-size: 0.78rem;
    background: rgba(232,82,26,0.1);
    color: var(--primary-light);
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-weight: 600;
}

/* ===================== SCROLLBAR GLOBAL ===================== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 768px) {
    .header-content { padding: 0.75rem 1rem; }
    .logo-text h1 { font-size: 1rem; }
    .main-content { padding: 1rem; }
    .phase-banner-content { flex-direction: column; }
    .phase-progress-wrap { margin-left: 0; text-align: left; width: 100%; }
    .workout-selector-inner { flex-direction: column; }
    .timer-display { font-size: 1.2rem; }
    .data-table th, .data-table td { padding: 0.5rem 0.75rem; }
    .exercise-table th, .exercise-table td { padding: 0.5rem 0.75rem; }
    .exercise-table { font-size: 0.78rem; }
}
