* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0a1628 0%, #1a2940 100%);
    min-height: 100vh;
    padding: 20px;
    color: #fff;
    position: relative;
}



body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><rect width="100" height="100" fill="none"/><circle cx="50" cy="50" r="30" fill="rgba(26, 188, 156, 0.03)"/></svg>');
    pointer-events: none;
    z-index: 0;
}

.header-flex {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

header {
    text-align: center;
    margin-bottom: 40px;
    animation: fadeInDown 0.8s ease;
}

.logo-container {
    margin-bottom: 20px;
}

.logo {
    max-width: 135px;
    height: auto;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.hidden {
    display: none !important;
}

header h1 {
    font-size: 3em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    line-height: 1.2;
}

.brand-calistenia {
    color: #1abc9c;
    font-weight: 700;
    letter-spacing: 2px;
}

.brand-valencia {
    color: #ffffff;
    font-weight: 700;
    letter-spacing: 2px;
}

.goma-badge {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-left: 8px;
    font-size: 12px;
    line-height: 20px;
    text-align: center;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    vertical-align: middle;
    transition: transform 0.2s ease;
}

.goma-badge:hover {
    transform: scale(1.2);
}

.leaderboard-item .score {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 80px;
}

.score-number {
    min-width: 40px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.goma-badge-container {
    margin-right: 6px;
    display: flex;
    align-items: center;
}

.subtitle {
    font-size: 1.4em;
    opacity: 0.9;
    color: #1abc9c;
}

.date {
    font-size: 1em;
    opacity: 0.7;
    margin-top: 5px;
}

.exercise-selector {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
    flex-wrap: wrap;
    animation: fadeIn 1s ease;
}

.exercise-btn {
    padding: 12px 24px;
    background: rgba(26, 188, 156, 0.1);
    border: 2px solid #1abc9c;
    border-radius: 5px;
    color: white;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.exercise-btn:hover {
    background: rgba(26, 188, 156, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(26, 188, 156, 0.3);
}

.exercise-btn.active {
    background: #1abc9c;
    border-color: #1abc9c;
    color: #0a1628;
    box-shadow: 0 5px 20px rgba(26, 188, 156, 0.5);
}

.podium-container {
    margin-bottom: 50px;
    animation: fadeIn 1.2s ease;
}

.podium-wrapper {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 20px;
    padding: 20px;
}

.podium-place {
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: slideUp 0.8s ease;
}

.medal {
    font-size: 3em;
    margin-bottom: 10px;
    animation: bounce 1s ease infinite;
}

.person-name {
    font-size: 1.4em;
    font-weight: bold;
    margin-bottom: 10px;
    text-align: center;
    color: #1abc9c;
    max-width: 120px;
}

.reps {
    font-size: 1.4em;
    font-weight: bold;
    margin-bottom: 20px;
    color: #1abc9c;
    text-shadow: 0 0 10px rgba(26, 188, 156, 0.5);
}

.podium-base {
    width: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0a1628;
    font-size: 2em;
    font-weight: bold;
    border-radius: 5px 5px 0 0;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    border: 3px solid rgba(26, 188, 156, 0.3);
}

.base-gold {
    height: 200px;
    background: linear-gradient(135deg, #1abc9c 0%, #16a085 100%);
}

.base-silver {
    height: 150px;
    background: linear-gradient(135deg, #1abc9c 0%, #16a085 100%);
    opacity: 0.8;
}

.base-bronze {
    height: 120px;
    background: linear-gradient(135deg, #1abc9c 0%, #16a085 100%);
    opacity: 0.6;
}

.leaderboard {
    background: rgba(26, 188, 156, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(26, 188, 156, 0.3);
    animation: fadeIn 1.4s ease;
}

.leaderboard h2 {
    text-align: center;
    margin-bottom: 25px;
    font-size: 2em;
    color: #1abc9c;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.sort-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.7);
}

.sort-btn {
    background: transparent;
    border: 1px solid rgba(26, 188, 156, 0.3);
    color: rgba(255, 255, 255, 0.7);
    padding: 5px 15px;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9em;
}

.sort-btn:hover {
    background: rgba(26, 188, 156, 0.1);
    border-color: #1abc9c;
    color: #fff;
}

.sort-btn.active {
    background: #1abc9c;
    border-color: #1abc9c;
    color: #0a1628;
    font-weight: bold;
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    background: rgba(26, 188, 156, 0.1);
    padding: 15px 20px;
    border-radius: 5px;
    transition: all 0.3s ease;
    animation: slideInLeft 0.5s ease;
    border-left: 3px solid #1abc9c;
    position: relative;
    overflow: hidden;
}

.leaderboard-item:hover {
    background: rgba(26, 188, 156, 0.25);
    transform: translateX(10px) scale(1.02);
    box-shadow: 0 5px 20px rgba(26, 188, 156, 0.4);
    border-left-width: 6px;
    cursor: pointer;
}

/* Updated Profile Link Styling */
.profile-link {
    font-size: 0.8em;
    color: #1abc9c;
    margin: 0 15px;
    opacity: 0.7;
    white-space: nowrap;
    font-weight: 600;
    transition: all 0.3s ease;
}

.leaderboard-item:hover .profile-link {
    opacity: 1;
    text-decoration: underline;
}

@media (max-width: 600px) {
    .profile-link {
        display: none;
        /* Hide on small screens to save space */
    }
}

.rank {
    font-size: 1.4em;
    font-weight: bold;
    min-width: 50px;
    color: #1abc9c;
}

.list-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1abc9c 0%, #16a085 100%);
    color: #0a1628;
    font-weight: bold;
    font-size: 0.95em;
    margin-right: 12px;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.list-avatar img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.list-avatar .avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

@media (max-width: 600px) {
    .list-avatar {
        width: 30px;
        height: 30px;
        margin-right: 8px;
        font-size: 0.85em;
    }
}

.name {
    flex: 1;
    font-size: 1.2em;
    font-weight: 600;
}

.score {
    font-size: 1.4em;
    font-weight: bold;
    color: #1abc9c;
}

.modifier {
    font-size: 0.8em;
    color: #7ed6c1;
    margin-left: 5px;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 1.5em;
    }

    .logo {
        max-width: 80px;
    }

    .podium-wrapper {
        flex-wrap: wrap;
    }

    .podium-base {
        width: 80px;
    }

    .base-gold {
        height: 100px;
    }

    .base-silver {
        height: 80px;
    }

    .base-bronze {
        height: 70px;
    }

    .exercise-btn {
        font-size: 0.8em;
        padding: 5px 10px;
    }
}

.loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(26, 188, 156, 0.3);
    border-top-color: #1abc9c;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-screen p {
    font-size: 1.5em;
    color: #1abc9c;
}

.error-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
    padding: 20px;
}

.error-screen h2 {
    color: #1abc9c;
    font-size: 2em;
    margin-bottom: 20px;
}

.error-screen p {
    font-size: 1.2em;
    margin-bottom: 30px;
    opacity: 0.9;
}

.btn-reload {
    padding: 12px 30px;
    background: #1abc9c;
    color: #0a1628;
    border: none;
    border-radius: 5px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-reload:hover {
    background: #16a085;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(26, 188, 156, 0.3);
}

.session-info {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.info-item {
    background: rgba(26, 188, 156, 0.1);
    padding: 8px 16px;
    border-radius: 5px;
    border: 2px solid rgba(26, 188, 156, 0.3);
    font-size: 0.9em;
}

.session-selector {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.session-btn {
    padding: 12px 24px;
    background: rgba(26, 188, 156, 0.1);
    border: 2px solid #1abc9c;
    border-radius: 5px;
    color: white;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.session-btn:hover {
    background: rgba(26, 188, 156, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(26, 188, 156, 0.3);
}

.session-btn.active {
    background: #1abc9c;
    border-color: #1abc9c;
    color: #0a1628;
    box-shadow: 0 5px 20px rgba(26, 188, 156, 0.5);
}

@media (max-width: 768px) {
    .session-info {
        font-size: 0.85em;
        width: 480px;
        gap: 2px;
        justify-content: left;
    }

    .info-item {
        padding: 6px 12px;
    }
}

.filter-section {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-bottom: 40px;
    background: rgba(26, 188, 156, 0.08);
    border: 2px solid rgba(26, 188, 156, 0.3);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(6px);
}

.filter-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 180px;
}

.filter-group label {
    font-size: 0.9em;
    margin-bottom: 5px;
    color: #1abc9c;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.filter-select {
    background: rgba(26, 188, 156, 0.1);
    border: 2px solid #1abc9c;
    color: rgb(172, 172, 172);
    padding: 10px 15px;
    border-radius: 5px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    font-weight: 600;
}

.filter-select:hover {
    background: rgba(26, 188, 156, 0.2);
}

.filter-select:focus {
    outline: none;
    border-color: #16a085;
    box-shadow: 0 0 10px rgba(26, 188, 156, 0.3);
}

/* Adapt filters nicely on mobile */
@media (max-width: 768px) {
    .filter-section {
        flex-direction: column;
        align-items: center;
        gap: 5px;
        padding: 5px;
    }

    .filter-group {
        width: 100%;
        max-width: 300px;
        align-items: center;
    }

    .filter-select {
        width: 100%;
    }

    .header-flex {
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        gap: 10px;
        width: 100%;
    }

    .logo-container {
        margin-bottom: 0;
        margin-right: 12px;
    }

    .brand-title {
        flex: 1 1 0%;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .brand-title h1 {
        font-size: 1.2em;
        margin: 0;
        text-align: center;
        width: 100%;
        line-height: 1.15;
    }

    .brand-title h1 br {
        display: none;

    }


}

/* Search Bar Styles */
.search-container {
    position: relative;
    max-width: 500px;
    margin: 0 auto 30px;
    z-index: 100;
}

.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 15px;
    font-size: 1.2em;
    opacity: 0.7;
    pointer-events: none;
    z-index: 2;
}

#search-input {
    width: 100%;
    padding: 15px 15px 15px 45px;
    border: 2px solid rgba(26, 188, 156, 0.3);
    border-radius: 30px;
    background: rgba(26, 188, 156, 0.1);
    color: white;
    font-size: 1.1em;
    outline: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

#search-input:focus {
    border-color: #1abc9c;
    background: rgba(26, 188, 156, 0.15);
    box-shadow: 0 0 15px rgba(26, 188, 156, 0.3);
}

#search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.search-results {
    position: absolute;
    top: 110%;
    left: 0;
    width: 100%;
    background: #1a2940;
    border: 1px solid rgba(26, 188, 156, 0.3);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
    backdrop-filter: blur(10px);
}

.search-result-item {
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: rgba(26, 188, 156, 0.2);
}

.search-match-name {
    font-weight: bold;
    color: #1abc9c;
}

/* Scrollbar for search results */
.search-results::-webkit-scrollbar {
    width: 8px;
}

.search-results::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.search-results::-webkit-scrollbar-thumb {
    background: rgba(26, 188, 156, 0.5);
    border-radius: 4px;
}
/* ====================================================================
 * Theme variants & enhancements (added)
 * ==================================================================== */

/* Light theme overrides — opt-in via body.theme-light. Default keeps the
   original dark gradient & teal accent untouched. */
body.theme-light {
    background: linear-gradient(135deg, #f5f7fb 0%, #e8eef7 100%);
    color: #1a2940;
}
body.theme-light header h1 .brand-valencia { color: #1a2940; }
body.theme-light .filter-section,
body.theme-light .leaderboard-item,
body.theme-light .card,
body.theme-light .session-card-user,
body.theme-light .exercise-card,
body.theme-light .achievement-card,
body.theme-light .pr-card,
body.theme-light .goal-card,
body.theme-light .attendance-section,
body.theme-light .prs-section,
body.theme-light .goals-section {
    background: rgba(255, 255, 255, 0.85);
    color: #1a2940;
    box-shadow: 0 4px 14px rgba(10, 22, 40, 0.08);
    border-color: rgba(10, 22, 40, 0.08);
}
body.theme-light .filter-select,
body.theme-light .date-input,
body.theme-light input,
body.theme-light select {
    background: #fff;
    color: #1a2940;
    border-color: rgba(10, 22, 40, 0.15);
}
body.theme-light #search-input {
    background: #fff;
    color: #1a2940;
    border-color: rgba(26, 188, 156, 0.55);
}
body.theme-light #search-input::placeholder {
    color: rgba(10, 22, 40, 0.55);
}
body.theme-light #search-input:focus {
    background: #fff;
    border-color: #16a085;
    box-shadow: 0 0 0 3px rgba(22, 160, 133, 0.18);
}
body.theme-light .search-icon { color: #16a085; opacity: 1; }
body.theme-light .stat-row span { color: #1a2940; }
body.theme-light .session-history h2,
body.theme-light .exercises-section h2,
body.theme-light .chart-section h2 { color: #16a085; }

/* Theme toggle button (top-right in index header) */
.icon-btn {
    background: rgba(26, 188, 156, 0.15);
    color: #1abc9c;
    border: 1px solid rgba(26, 188, 156, 0.4);
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.2s ease;
}
.icon-btn:hover { background: rgba(26, 188, 156, 0.3); }
.icon-btn:disabled { opacity: 0.5; cursor: wait; }
.theme-toggle-fixed {
    position: absolute;
    top: 10px;
    right: 10px;
}
header { position: relative; }

/* Skeleton loader */
.skeleton-card {
    background: linear-gradient(90deg,
        rgba(255,255,255,0.04) 25%,
        rgba(255,255,255,0.10) 37%,
        rgba(255,255,255,0.04) 63%);
    background-size: 400% 100%;
    animation: skeleton-pulse 1.4s ease infinite;
    border-radius: 12px;
    height: 80px;
    margin-bottom: 12px;
}
@keyframes skeleton-pulse {
    0% { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}

/* Empty states */
.empty-state {
    text-align: center;
    padding: 30px;
    color: rgba(255,255,255,0.55);
    font-size: 1em;
}

/* Improvement ranking tags */
.improvement-tags {
    display: flex;
    gap: 8px;
    margin-top: 4px;
    flex-wrap: wrap;
}
.improvement-tags .tag-clean,
.improvement-tags .tag-drop {
    font-size: 0.72em;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(26, 188, 156, 0.18);
    color: #1abc9c;
    font-weight: 600;
}
.improvement-tags .tag-drop {
    background: rgba(46, 204, 113, 0.18);
    color: #2ecc71;
}

/* A11y: focus rings */
.icon-btn:focus-visible,
.btn-apply:focus-visible,
.exercise-btn:focus-visible,
.filter-select:focus-visible,
.date-input:focus-visible,
input:focus-visible {
    outline: 2px solid #1abc9c;
    outline-offset: 2px;
}

/* ====================================================================
 * Theme/contrast fixes (combobox, options, light theme readability)
 * ==================================================================== */

/* Fix native <option> rendering: inherit a readable bg/color on dark theme. */
select option,
.filter-select option,
.goal-form select option {
    background: #0a1628;
    color: #ffffff;
}
body.theme-light select option,
body.theme-light .filter-select option,
body.theme-light .goal-form select option {
    background: #ffffff;
    color: #1a2940;
}

/* Native selects: explicit colors so iOS / Windows don't render white-on-white. */
select,
.filter-select,
.goal-form select,
.goal-form input {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
}
body.theme-light select,
body.theme-light .filter-select,
body.theme-light .goal-form select,
body.theme-light .goal-form input,
body.theme-light input,
body.theme-light .date-input,
body.theme-light textarea {
    color: #1a2940;
    background: #ffffff;
    border: 1px solid rgba(10, 22, 40, 0.18);
}
body.theme-light ::placeholder { color: rgba(10, 22, 40, 0.45); }

/* Light theme: filter labels, welcome message, headings */
body.theme-light label,
body.theme-light .filter-group label,
body.theme-light .welcome-message,
body.theme-light .welcome-message h2,
body.theme-light .welcome-message p {
    color: #1a2940;
}
body.theme-light header h1 { text-shadow: 0 1px 2px rgba(10, 22, 40, 0.08); }
body.theme-light .leaderboard h2,
body.theme-light .exercises-section h2,
body.theme-light .session-history h2,
body.theme-light .chart-section h2,
body.theme-light .next-challenges-section h2 { color: #16a085; }

body.theme-light .exercise-btn {
    color: #16a085;
    border-color: #16a085;
    background: rgba(22, 160, 133, 0.08);
}
body.theme-light .exercise-btn.active,
body.theme-light .exercise-btn:hover {
    background: #16a085;
    color: #ffffff;
}
body.theme-light .exercise-btn:disabled {
    color: rgba(10, 22, 40, 0.35);
    border-color: rgba(10, 22, 40, 0.18);
    background: rgba(10, 22, 40, 0.04);
}

body.theme-light .leaderboard-item .name,
body.theme-light .leaderboard-item .score,
body.theme-light .leaderboard-item .score-multi,
body.theme-light .leaderboard-item .rank,
body.theme-light .stat-card,
body.theme-light .stat-card .stat-value,
body.theme-light .stat-card .stat-label {
    color: #1a2940;
}
body.theme-light .stat-card .stat-value { color: #16a085; }
body.theme-light .stat-card { background: rgba(22, 160, 133, 0.06); border-color: rgba(22, 160, 133, 0.25); }

body.theme-light .profile-link { color: #16a085; }
body.theme-light .global-description,
body.theme-light .exercise-description { color: rgba(10, 22, 40, 0.78); }
body.theme-light .global-description .highlight { color: #16a085; }
body.theme-light .details-toggle { color: #16a085; border-color: #16a085; }

/* Loading screen on light theme */
body.theme-light .loading-screen,
body.theme-light .loading-screen p { color: #1a2940; }
body.theme-light .skeleton-card {
    background: linear-gradient(90deg,
        rgba(10,22,40,0.04) 25%,
        rgba(10,22,40,0.10) 37%,
        rgba(10,22,40,0.04) 63%);
    background-size: 400% 100%;
}
body.theme-light .empty-state { color: rgba(10, 22, 40, 0.55); }

/* Better icon-button contrast on light */
body.theme-light .icon-btn {
    background: #ffffff;
    color: #16a085;
    border-color: rgba(22, 160, 133, 0.4);
}
body.theme-light .icon-btn:hover { background: rgba(22, 160, 133, 0.1); }

/* "Welcome" dashboard cards (used on index page) */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin: 0 0 28px;
}
.dash-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(26, 188, 156, 0.22);
    border-radius: 12px;
    padding: 16px 18px;
    transition: all 0.25s ease;
}
.dash-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(26, 188, 156, 0.15); }
.dash-card h3 {
    color: #1abc9c;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 8px;
}
.dash-value {
    font-size: 2em;
    font-weight: 800;
    color: #ffffff;
    line-height: 1;
    margin-bottom: 4px;
}
.dash-meta { font-size: 0.85em; color: rgba(255, 255, 255, 0.6); }
.dash-list { list-style: none; padding: 0; margin: 4px 0 0; }
.dash-list li {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.9em;
    cursor: pointer;
}
.dash-list li:last-child { border-bottom: 0; }
.dash-list li:hover { color: #1abc9c; }
.dash-pr-badge {
    font-size: 0.7em;
    padding: 2px 6px;
    border-radius: 8px;
    background: rgba(241, 196, 15, 0.2);
    color: #f1c40f;
    margin-left: 6px;
}

body.theme-light .dash-card { background: #ffffff; }
body.theme-light .dash-value { color: #1a2940; }
body.theme-light .dash-meta { color: rgba(10, 22, 40, 0.6); }
body.theme-light .dash-list li { border-bottom-color: rgba(10, 22, 40, 0.06); }
body.theme-light .dash-card h3 { color: #16a085; }

/* ====================================================================
 * Light theme: leaderboard panel & sort buttons readability fix
 * ==================================================================== */

body.theme-light .leaderboard {
    background: #ffffff;
    border: 2px solid rgba(22, 160, 133, 0.35);
    box-shadow: 0 6px 22px rgba(10, 22, 40, 0.08);
}
body.theme-light .leaderboard h2 { color: #16a085; }

body.theme-light .sort-controls { color: #1a2940; }
body.theme-light .sort-btn {
    background: #ffffff;
    color: #16a085;
    border: 1px solid #16a085;
}
body.theme-light .sort-btn:hover {
    background: rgba(22, 160, 133, 0.1);
    color: #16a085;
}
body.theme-light .sort-btn.active {
    background: #16a085;
    color: #ffffff;
    border-color: #16a085;
}

body.theme-light .leaderboard-item {
    background: #ffffff;
    border: 1px solid rgba(10, 22, 40, 0.08);
}
body.theme-light .leaderboard-item:hover {
    background: rgba(22, 160, 133, 0.06);
}
body.theme-light .leaderboard-item .name,
body.theme-light .leaderboard-item .score-number,
body.theme-light .leaderboard-item .modifier { color: #1a2940; }

body.theme-light .podium-place .person-name,
body.theme-light .podium-place .reps { color: #1a2940; }

/* Goals sync badge */
.sync-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 14px;
    font-size: 0.82em;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.75);
}
.sync-badge.sync-syncing {
    background: rgba(241, 196, 15, 0.18);
    color: #f1c40f;
    border-color: rgba(241, 196, 15, 0.4);
}
.sync-badge.sync-ok {
    background: rgba(46, 204, 113, 0.18);
    color: #2ecc71;
    border-color: rgba(46, 204, 113, 0.4);
}
.sync-badge.sync-error {
    background: rgba(231, 76, 60, 0.16);
    color: #e74c3c;
    border-color: rgba(231, 76, 60, 0.4);
}
body.theme-light .sync-badge { background: #f0f3f8; color: #1a2940; }
body.theme-light .sync-badge.sync-ok { background: rgba(46, 204, 113, 0.18); color: #1e7e44; }
body.theme-light .sync-badge.sync-syncing { background: rgba(241, 196, 15, 0.22); color: #8a6d00; }
body.theme-light .sync-badge.sync-error { background: rgba(231, 76, 60, 0.18); color: #a72424; }
