/* ── Reset ─────────────────────────────────────────────────── */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* ── Base ──────────────────────────────────────────────────── */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #0d0d0d;
    color: #d4d4d4;
    min-height: 100vh;
}

h1, h2, h3 { color: #e8e8e8; }
p { color: #aaa; }
strong { color: #d4d4d4; }

/* ── Nav ───────────────────────────────────────────────────── */
nav {
    background: #111;
    border-bottom: 1px solid #1e1e1e;
    padding: 15px 20px;
}
nav .container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}
nav h1 { font-size: 24px; color: #e8e8e8; }
nav .nav-links { display: flex; gap: 10px; flex-wrap: wrap; }
nav a {
    color: #aaa;
    text-decoration: none;
    padding: 7px 14px;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: background 0.2s, color 0.2s;
}
nav a:hover { background: #1a1a1a; color: #2ecc71; }

/* ── Layout ────────────────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 20px; }

/* ── Cards ─────────────────────────────────────────────────── */
.card {
    background: #111;
    border: 1px solid #1e1e1e;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 20px;
}
.card h2 { color: #e8e8e8; margin-bottom: 20px; }

/* ── Dashboard grid ────────────────────────────────────────── */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}
.stat {
    font-size: 36px;
    font-weight: bold;
    color: #2ecc71;
    margin: 10px 0;
}
.stat-label { color: #666; font-size: 14px; }

/* ── List items ────────────────────────────────────────────── */
.list-item {
    padding: 12px;
    background: #161616;
    margin-bottom: 8px;
    border-radius: 6px;
    border-left: 3px solid #2ecc71;
    color: #d4d4d4;
}

/* ── Forms ─────────────────────────────────────────────────── */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}
.form-group { display: flex; flex-direction: column; }
label { margin-bottom: 5px; color: #999; font-weight: 500; font-size: 0.9rem; }

input, select, textarea {
    padding: 10px 12px;
    background: #161616;
    border: 1px solid #252525;
    border-radius: 6px;
    color: #d4d4d4;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #2ecc71;
}
select option { background: #161616; }

/* ── Buttons ───────────────────────────────────────────────── */
button, .btn {
    padding: 10px 22px;
    background: #162d1e;
    color: #2ecc71;
    border: 1px solid #2a5c3a;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s, border-color 0.2s, transform 0.15s;
    text-decoration: none;
    display: inline-block;
}
button:hover, .btn:hover {
    background: #1e4028;
    border-color: #2ecc71;
    transform: translateY(-1px);
}

.delete-btn {
    background: #2d1010;
    color: #ff7878;
    border: 1px solid #5c2a2a;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: background 0.2s;
}
.delete-btn:hover { background: #3d1414; }

.toggle-btn {
    background: #0d2d1a;
    color: #5df59a;
    border: 1px solid #1e6e3e;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
}
.toggle-btn:hover { background: #162d1e; }

/* ── Tables ────────────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px; text-align: left; border-bottom: 1px solid #1a1a1a; }
th { background: #141414; color: #888; font-weight: 600; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.03em; }
tr:hover td { background: #141414; }

/* ── Empty states ──────────────────────────────────────────── */
.empty-state { text-align: center; color: #555; padding: 40px; }

/* ── Alerts ────────────────────────────────────────────────── */
.error   { background: #2d1010; color: #ff7878; border: 1px solid #5c2a2a; padding: 10px 14px; border-radius: 6px; margin-bottom: 20px; }
.success { background: #0d2d1a; color: #5df59a; border: 1px solid #1e6e3e; padding: 10px 14px; border-radius: 6px; margin-bottom: 20px; }

/* ── Goals ─────────────────────────────────────────────────── */
.goal-item {
    background: #141414;
    border: 1px solid #1e1e1e;
    border-left: 3px solid #2ecc71;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 8px;
}
.goal-item.completed { opacity: 0.55; border-left-color: #1e6e3e; }
.goal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.goal-actions { display: flex; gap: 10px; }

/* ── Settings / Danger zone ────────────────────────────────── */
.danger-zone {
    border: 1px solid #5c2a2a;
    padding: 20px;
    border-radius: 8px;
    margin-top: 10px;
}
.danger-zone h3 { color: #ff7878; margin-bottom: 15px; }
.btn-danger {
    background: #2d1010;
    color: #ff7878;
    border: 1px solid #5c2a2a;
}
.btn-danger:hover { background: #3d1414; border-color: #ff7878; }

/* ── Competition widget (dashboard) ───────────────────────── */
.comp-widget {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    background: #111;
    border: 1px solid #1e3d2a;
    border-left: 3px solid #2ecc71;
    border-radius: 10px;
    padding: 18px 22px;
    margin-bottom: 24px;
}
.comp-widget-name { font-size: 18px; font-weight: 700; color: #e8e8e8; margin: 4px 0; }
.comp-widget-sub  { font-size: 13px; color: #666; }
.comp-widget-phase { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }

/* ── Training schedule (planner) ───────────────────────────── */
.week-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-bottom: 18px;
}
@media (max-width: 700px) { .week-grid { grid-template-columns: repeat(4, 1fr); } }
.week-day {
    background: #161616;
    border: 1px solid #1e1e1e;
    border-radius: 8px;
    padding: 10px 6px;
    text-align: center;
    min-height: 72px;
}
.week-day-name {
    font-size: 11px;
    font-weight: 700;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 6px;
}
.tag {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
    margin: 2px 1px;
}
.tag-work { background: #152030; color: #6ab0d4; }
.tag-bjj  { background: #16163a; color: #9090ff; }
.tag-mt   { background: #3a1616; color: #ff9090; }
.tag-mat  { background: #221a3a; color: #cc88ff; }

.schedule-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 20px;
    margin-bottom: 10px;
}
.schedule-col { display: flex; flex-direction: column; gap: 4px; }
.schedule-col-label { margin-bottom: 8px; font-size: 11px; }
.day-check {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #aaa;
    font-size: 14px;
    cursor: pointer;
    padding: 3px 0;
}
.day-check input[type="checkbox"] { accent-color: #2ecc71; width: 15px; height: 15px; }

details > summary { cursor: pointer; }
.edit-schedule-toggle {
    color: #2ecc71;
    font-size: 14px;
    font-weight: 600;
    padding: 6px 0;
    list-style: none;
    user-select: none;
}
.edit-schedule-toggle::-webkit-details-marker { display: none; }
.edit-schedule-toggle::before { content: '▶ '; font-size: 10px; }
details[open] .edit-schedule-toggle::before { content: '▼ '; }

/* ── Session rows ──────────────────────────────────────────── */
.session-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: #161616;
    border-radius: 6px;
    margin-bottom: 6px;
    gap: 10px;
    flex-wrap: wrap;
}
.session-info { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.session-date { color: #666; font-size: 13px; min-width: 90px; }
.session-type { font-weight: 600; color: #d4d4d4; }
.session-title { color: #888; font-size: 13px; }
.session-dur  { color: #555; font-size: 12px; }
.session-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }

.btn-sm {
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    border: 1px solid;
}
.btn-done    { background: #0d2d1a; color: #2ecc71; border-color: #1e6e3e; }
.btn-done:hover { background: #162d1e; }
.btn-partial { background: #2d1e0d; color: #e67e22; border-color: #7a4010; }
.btn-partial:hover { background: #3d2810; }
.btn-miss    { background: #2d0d0d; color: #ff7878; border-color: #5c1a1a; }
.btn-miss:hover { background: #3d1010; }

/* ── Status badges ─────────────────────────────────────────── */
.status-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.status-planned   { background: #1e2d3d; color: #6ab0d4; }
.status-completed { background: #0d2d1a; color: #2ecc71; }
.status-partial   { background: #2d1e0d; color: #e67e22; }
.status-missed    { background: #2d0d0d; color: #ff7878; }

/* ── Competition cards ─────────────────────────────────────── */
.comp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.comp-card {
    background: #111;
    border: 1px solid #1e1e1e;
    border-radius: 10px;
    padding: 20px;
}
.comp-card-past { opacity: 0.6; }
.comp-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}
.comp-card h3 { font-size: 16px; margin-bottom: 0; }
.sport-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.sport-muay_thai { background: #3a1616; color: #ff9090; }
.sport-bjj       { background: #16163a; color: #9090ff; }
.sport-other     { background: #1e2a1e; color: #90cc90; }
.phase-badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 4px;
    white-space: nowrap;
}
.comp-meta { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.comp-countdown { font-size: 20px; font-weight: 700; color: #e8e8e8; }
.comp-loc, .comp-wc, .comp-reg { font-size: 13px; color: #666; }
.comp-notes { font-size: 13px; color: #666; margin: 8px 0; font-style: italic; }
.comp-result { font-size: 13px; color: #2ecc71; }
.reg-warning { font-size: 12px; color: #e67e22; font-weight: 600; }
.phase-timeline {
    display: flex;
    gap: 4px;
    margin-top: 14px;
    flex-wrap: wrap;
}
.phase-step {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 3px;
    background: #1a1a1a;
    color: #444;
    border: 1px solid #222;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.phase-step.active { background: #1e3d2a; color: #2ecc71; border-color: #2a5c3a; }

/* ── Activity heatmap ──────────────────────────────────────── */
.heatmap { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 14px; }
.heatmap-day {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 3px;
    cursor: default;
}
.heatmap-label { font-size: 9px; color: rgba(255,255,255,0.3); }
.heatmap-empty     { background: #1a1a1a; }
.heatmap-future    { background: #151515; border: 1px dashed #222; }
.heatmap-planned   { background: #152030; }
.heatmap-completed { background: #0d3d1a; }
.heatmap-partial   { background: #3d2810; }
.heatmap-missed    { background: #2d0d0d; }
.heatmap-legend { font-size: 12px; color: #666; margin-top: 4px; }

/* ── Routines ──────────────────────────────────────────────── */
.routine-card { border-left: 3px solid #2ecc71; }
.routine-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 10px;
}
.routine-type-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.routine-type-warmup     { background: #3a1e0d; color: #ff9955; }
.routine-type-stretching { background: #0d2233; color: #55bbff; }
.routine-type-cooldown   { background: #0d1e33; color: #88aaff; }

/* ── Login page ────────────────────────────────────────────── */
body.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}
.login-container {
    background: #111;
    border: 1px solid #1e1e1e;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.6);
    width: 100%;
    max-width: 400px;
}
.login-container h1 { text-align: center; margin-bottom: 30px; color: #e8e8e8; }
.login-container input {
    width: 100%;
    padding: 12px;
    font-size: 15px;
}
.login-container button {
    width: 100%;
    padding: 12px;
    font-size: 15px;
    justify-content: center;
}
.toggle-link { text-align: center; margin-top: 20px; color: #666; }
.toggle-link a { color: #2ecc71; font-weight: 600; text-decoration: none; }
.toggle-link a:hover { color: #5df59a; }
