/* =====================================================
   REPS LOG - App CSS
   ===================================================== */

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

:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #60a5fa;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --bg-dark: #1a1a2e;
    --bg-card: #16213e;
    --bg-input: #0f3460;
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border: #334155;
    --border-subtle: rgba(255, 255, 255, 0.08);
    --shadow: rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.4);
    --glass-bg: rgba(22, 33, 62, 0.8);
    --glass-border: rgba(255, 255, 255, 0.1);
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
    position: relative;
}

/* Background Image */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('https://images.unsplash.com/photo-1534438327276-14e5300c3a48?q=80&w=2850&auto=format&fit=crop');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -2;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(26, 26, 46, 0.92) 0%, rgba(26, 26, 46, 0.96) 50%, rgba(26, 26, 46, 0.98) 100%);
    z-index: -1;
}

#app {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    background: transparent;
}

/* Settings View */
.settings-container {
    padding: 20px;
}

.settings-group {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 20px;
    border: 1px solid var(--border-subtle);
}

.settings-group h3 {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-subtle);
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-item input[type="number"] {
    width: 80px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: white;
    padding: 8px;
    border-radius: 8px;
    text-align: center;
}

/* Switch Toggle */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-input);
    transition: .4s;
    border: 1px solid var(--border);
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: var(--primary);
    border-color: var(--primary-light);
}

input:checked + .slider:before {
    transform: translateX(22px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

.settings-footer {
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 40px;
}

/* Rest Timer Overlay */
.timer-overlay {
    position: fixed;
    bottom: 80px;
    left: 20px;
    right: 20px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 20px;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

@keyframes slideUp {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.timer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.timer-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--primary-light);
    letter-spacing: 1px;
}

.timer-display {
    font-size: 48px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary);
}

.timer-controls {
    display: flex;
    gap: 16px;
    width: 100%;
}

.timer-controls button {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: white;
    padding: 12px;
    border-radius: 12px;
    font-weight: 600;
}

.timer-controls .stop-btn {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
    color: #fca5a5;
}

/* Animations for Finished State */
.timer-overlay.finished {
    background: rgba(16, 185, 129, 0.2);
    border-color: var(--success);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
}

.logout-btn {
    font-size: 16px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.header-link {
    font-size: 16px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-secondary);
    transition: background 0.2s, color 0.2s;
}

.header-link:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

.header h1 {
    font-size: 22px;
    font-weight: 800;
    background: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.2s;
}

.icon-btn:hover, .icon-btn:active {
    background: var(--bg-input);
}

/* Tabs */
.tabs {
    display: flex;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    padding: 0 16px;
}

.tab {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 16px 4px; /* Reduced padding from 12px to 4px */
    font-size: 13px; /* Reduced font size from 14px */
    font-weight: 600;
    cursor: pointer;
    position: relative;
    transition: color 0.2s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

.tab.active {
    color: var(--primary-light);
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 10%;
    right: 10%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 3px 3px 0 0;
}

/* Main Content */
.content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: env(safe-area-inset-bottom);
}

.view {
    display: none;
    padding: 20px;
}

.view.active {
    display: block;
}

/* Loading & Error */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    padding: 16px;
    margin: 20px;
    border-radius: 12px;
    border-left: 4px solid var(--danger);
    font-size: 14px;
}

/* Workout View */
.workout-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

/* Workout Duration Display */
.workout-duration {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(59, 130, 246, 0.15);
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 14px;
    color: var(--primary-light);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.workout-duration .duration-icon {
    font-size: 16px;
}

.workout-duration .duration-text {
    font-weight: 600;
}

.workout-date {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.workout-date span:first-child {
    font-size: 20px;
    font-weight: 600;
}

.small-btn {
    background: var(--bg-input);
    border: none;
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
}

.primary-btn {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.primary-btn:active {
    transform: scale(0.98);
}

.primary-btn:hover {
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
    transform: translateY(-1px);
}

.primary-btn.full-width {
    width: 100%;
}

/* Exercise List */
.exercise-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.exercise-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 18px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    border: 1px solid var(--border-subtle);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.exercise-card:hover {
    border-color: var(--glass-border);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.exercise-card:active {
    transform: scale(0.98);
}

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

.exercise-card.no-sets .exercise-card-header {
    margin-bottom: 0;
}

.exercise-card.no-sets {
    padding: 12px 16px;
    opacity: 0.7;
}

.exercise-card.no-sets:hover,
.exercise-card.no-sets:active {
    opacity: 1;
}

.exercise-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.exercise-badge {
    background: var(--bg-input);
    color: var(--text-secondary);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
}

.exercise-last-data {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.data-item {
    display: flex;
    flex-direction: column;
}

.data-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-light);
}

.data-value.sets {
    color: var(--success);
}

.today-sets {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.set-pill {
    background: var(--bg-input);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.set-pill .weight {
    font-weight: 600;
    color: var(--primary-light);
}

.set-pill .reps {
    color: var(--text-secondary);
}

.set-pill .diff {
    font-size: 14px;
}

.set-pill.superset {
    border: 1px solid var(--primary);
    cursor: pointer;
    transition: background 0.2s;
}

.set-pill.superset:hover {
    background: var(--primary-dark);
}

.set-pill .superset-icon {
    font-size: 12px;
    margin-right: 2px;
}

/* Add Exercise Button */
.add-exercise-btn {
    width: 100%;
    background: transparent;
    border: 2px dashed var(--border);
    color: var(--text-secondary);
    padding: 20px;
    border-radius: 16px;
    font-size: 15px;
    cursor: pointer;
    margin-top: 16px;
    transition: border-color 0.2s, color 0.2s;
}

.add-exercise-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Search Bar */
.search-bar {
    margin-bottom: 16px;
}

.search-bar input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 14px 16px;
    border-radius: 12px;
    font-size: 15px;
}

.search-bar input::placeholder {
    color: var(--text-muted);
}

.search-bar input:focus {
    outline: none;
    border-color: var(--primary);
}

/* All Exercises List */
.all-exercises-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.all-exercise-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
    cursor: pointer;
    gap: 12px;
}

.all-exercise-item > div:first-child {
    flex: 1;
    min-width: 0;
}

.all-exercise-item:active {
    background: var(--bg-input);
}

.exercise-item-name {
    font-weight: 500;
}

.exercise-item-stats {
    color: var(--text-secondary);
    font-size: 13px;
}

.delete-exercise-btn {
    background: none;
    border: none;
    font-size: 18px;
    padding: 8px;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.delete-exercise-btn:hover,
.delete-exercise-btn:active {
    opacity: 1;
}

/* Stats Filter */
.stats-filter {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.filter-btn {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.filter-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Stats View */
.stats-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 16px;
    border: 1px solid var(--border-subtle);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.stats-card h3 {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-light);
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.chart-wrapper {
    position: relative;
    min-height: 250px;
    margin-top: 16px;
}

.chart-wrapper canvas {
    max-height: 300px;
}

.exercise-select {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 15px;
    cursor: pointer;
}

.exercise-select:focus {
    outline: none;
    border-color: var(--primary);
}

/* Date Picker */
.quick-dates {
    margin-bottom: 20px;
}

.quick-date-btn {
    width: 100%;
    background: var(--bg-input);
    border: 2px solid var(--border);
    color: var(--text-primary);
    padding: 14px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.quick-date-btn.active {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.1);
}

.quick-date-btn:hover:not(.active) {
    border-color: var(--text-muted);
}

.recent-workouts {
    margin-bottom: 20px;
}

.recent-workouts > label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.workout-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 250px;
    overflow-y: auto;
}

.workout-date-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-input);
    border: 2px solid transparent;
    color: var(--text-primary);
    padding: 12px 14px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.workout-date-btn .date {
    font-weight: 500;
}

.workout-date-btn .sets-count {
    font-size: 13px;
    color: var(--text-muted);
}

.workout-date-btn.active {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.1);
}

.workout-date-btn:hover:not(.active) {
    background: var(--bg-card);
}

.custom-date > label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.date-input-row {
    display: flex;
    gap: 10px;
}

.date-input-row input[type="date"] {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 12px;
    border-radius: 10px;
    font-size: 15px;
}

.date-input-row input[type="date"]:focus {
    outline: none;
    border-color: var(--primary);
}

.date-input-row .primary-btn {
    padding: 12px 20px;
}

/* Side Menu */
.side-menu {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100%;
    background: var(--bg-card);
    z-index: 1000;
    transition: left 0.3s ease;
    box-shadow: 4px 0 20px var(--shadow);
}

.side-menu.open {
    left: 0;
}

.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.menu-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

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

.menu-header h2 {
    font-size: 18px;
}

.menu-nav {
    padding: 16px 0;
}

.menu-nav a {
    display: block;
    padding: 14px 20px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 15px;
    transition: background 0.2s;
}

.menu-nav a:hover, .menu-nav a:active {
    background: var(--bg-input);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1001;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.modal-content {
    background: var(--bg-card);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    border-radius: 24px 24px 0 0;
    overflow: hidden;
    animation: slideUp 0.3s ease;
    border: 1px solid var(--glass-border);
    border-bottom: none;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.4);
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

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

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.close-modal {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 28px;
    cursor: pointer;
    padding: 0 8px;
    line-height: 1;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(90vh - 70px);
}

/* Exercise Detail Modal */
.last-workout-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-input);
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 14px;
}

.last-workout-info .label {
    color: var(--text-secondary);
}

.sets-container {
    margin-bottom: 24px;
}

.sets-container h3 {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.set-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-input);
    border-radius: 10px;
    margin-bottom: 8px;
}

.set-number {
    background: var(--primary);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
}

.set-details {
    flex: 1;
    display: flex;
    gap: 16px;
}

.set-weight, .set-reps {
    font-weight: 600;
}

.set-difficulty {
    font-size: 18px;
}

.set-rest-time {
    font-size: 11px;
    color: var(--text-muted);
    background: rgba(59, 130, 246, 0.15);
    padding: 3px 6px;
    border-radius: 4px;
    white-space: nowrap;
}

.set-actions {
    display: flex;
    gap: 8px;
}

.set-action-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 6px;
    cursor: pointer;
    border-radius: 6px;
}

.set-action-btn:hover {
    background: var(--bg-dark);
    color: var(--text-primary);
}

/* Last workout reference */
.last-sets-container {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.last-sets-container h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.last-sets-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.last-set-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: var(--bg-dark);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-secondary);
    border: 1px solid transparent;
    transition: all 0.2s;
}

.last-set-row.highlighted {
    background: rgba(59, 130, 246, 0.15);
    border-color: var(--primary);
    color: var(--text-primary);
}

.last-set-row .set-number {
    background: var(--text-muted);
    width: 24px;
    height: 24px;
    font-size: 12px;
}

.last-set-row.highlighted .set-number {
    background: var(--primary);
}

.last-set-row .set-weight,
.last-set-row .set-reps {
    font-weight: 500;
}

.last-set-row .set-metric {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    font-weight: 500;
}

.last-set-row .set-metric .weight {
    font-weight: 600;
    color: var(--primary-light);
}

.last-set-row .set-metric .reps {
    color: var(--text-secondary);
}

.last-set-row .set-difficulty {
    font-size: 14px;
    margin-left: auto;
}

/* History swipe (carousel) */
.history-carousel {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
}

.history-carousel::-webkit-scrollbar {
    height: 6px;
}

.history-carousel::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.5);
    border-radius: 10px;
}

.history-card {
    /* Keep cards narrow so 2–3 are visible */
    flex: 0 0 clamp(160px, 42vw, 220px);
    scroll-snap-align: start;
    padding: 12px;
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border);
    border-radius: 14px;
}

.history-card-header {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.history-card .last-set-row {
    background: rgba(15, 52, 96, 0.45);
}

.history-swipe-hint {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.set-action-btn.delete:hover {
    color: var(--danger);
}

/* Quick Add Set */
.quick-add-set {
    background: rgba(15, 52, 96, 0.6);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid var(--border-subtle);
}

.quick-add-set h3 {
    font-size: 15px;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.set-inputs {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.input-group {
    flex: 1;
}

.input-group label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.number-input {
    display: flex;
    align-items: stretch;
    background: var(--bg-dark);
    border-radius: 10px;
    overflow: hidden;
}

.number-input button {
    background: var(--bg-card);
    border: none;
    color: var(--text-primary);
    width: 44px;
    font-size: 20px;
    cursor: pointer;
    transition: background 0.2s;
}

.number-input button:active {
    background: var(--primary);
}

.number-input input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    padding: 12px 8px;
    min-width: 60px;
}

.number-input input:focus {
    outline: none;
}

/* Hide number input spinners */
.number-input input::-webkit-outer-spin-button,
.number-input input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.number-input input[type=number] {
    -moz-appearance: textfield;
}

.difficulty-selector {
    margin-bottom: 20px;
}

.difficulty-selector label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.difficulty-options {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.diff-btn {
    background: var(--bg-dark);
    border: 2px solid transparent;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.2s;
}

.diff-btn.active {
    border-color: var(--primary);
    background: var(--bg-card);
}

.diff-btn:hover:not(.active) {
    background: var(--bg-card);
}

/* Date Picker Modal */
.date-picker {
    padding: 20px;
}

.date-picker input[type="date"] {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 14px;
    border-radius: 12px;
    font-size: 16px;
}

/* Exercise Selector */
.exercise-selector {
    max-height: 400px;
    overflow-y: auto;
}

.exercise-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.2s;
}

.exercise-option:hover, .exercise-option:active {
    background: var(--bg-input);
}

.exercise-option:last-child {
    border-bottom: none;
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 12px 24px;
    border-radius: 12px;
    box-shadow: 0 4px 20px var(--shadow);
    z-index: 1002;
    animation: fadeInUp 0.3s ease;
}

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.error {
    border-left: 4px solid var(--danger);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Desktop Adjustments */
@media (min-width: 768px) {
    .modal-content {
        border-radius: 24px;
        margin-bottom: 20px;
    }
    
    .modal {
        align-items: center;
    }
}

/* Safe Area for iOS */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .content {
        padding-bottom: calc(20px + env(safe-area-inset-bottom));
    }
    
    .modal-content {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* Form elements */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-group input,
.form-group select {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 14px;
    border-radius: 12px;
    font-size: 15px;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    margin-bottom: 20px;
}

/* Progress Bar */
.progress-bar {
    height: 4px;
    background: var(--bg-input);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--success));
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* Icon Selector */
.icon-selector {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.current-icon {
    font-size: 48px;
    text-align: center;
    padding: 16px;
    background: var(--bg-input);
    border-radius: 12px;
    border: 2px solid var(--border);
}

.icon-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 6px;
    max-height: 200px;
    overflow-y: auto;
    padding: 4px;
}

.icon-option {
    background: var(--bg-input);
    border: 2px solid transparent;
    border-radius: 8px;
    font-size: 20px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.icon-option:hover {
    background: var(--bg-card);
    border-color: var(--border);
}

.icon-option.active {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.15);
}

/* Muscle Group Selector */
.muscle-group-selector {
    position: relative;
}

.muscle-group-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-input);
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    cursor: pointer;
    min-height: 48px;
}

.muscle-group-display:hover {
    border-color: var(--primary);
}

.muscle-group-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex: 1;
}

.muscle-tag {
    background: var(--primary);
    color: white;
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
}

.muscle-tag.empty {
    background: var(--bg-card);
    color: var(--text-muted);
}

.dropdown-arrow {
    color: var(--text-muted);
    font-size: 10px;
    margin-left: 8px;
    transition: transform 0.2s;
}

.muscle-group-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 8px;
    margin-top: 4px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 8px 24px var(--shadow);
}

.muscle-group-dropdown.open {
    display: block;
}

.muscle-group-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid var(--border);
}

.muscle-group-option:last-child {
    border-bottom: none;
}

.muscle-group-option:hover {
    background: var(--bg-input);
}

.muscle-group-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

.muscle-group-option span {
    font-size: 14px;
    color: var(--text-primary);
}

/* Superset Styles */
.set-row.has-superset {
    border-left: 3px solid var(--primary);
    padding-left: 10px;
}

.superset-indicator {
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.15s;
}

.superset-indicator:hover {
    background: var(--bg-input);
}

.superset-info-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.superset-info-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px;
    background: var(--bg-input);
    border-radius: 8px;
}

.superset-info-item .exercise-name {
    font-weight: 600;
    font-size: 15px;
    word-break: break-word;
}

.superset-info-item .set-details {
    color: var(--primary-light);
    font-size: 14px;
    font-weight: 500;
}

.last-set-row.has-superset {
    border-left: 3px solid var(--primary);
    padding-left: 9px;
}

.superset-indicator.small {
    font-size: 14px;
    padding: 2px 4px;
    margin-left: 6px;
}

.superset-link-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.superset-link-group {
    margin-bottom: 12px;
}

.superset-link-group-title {
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-weight: 600;
    word-break: break-word;
    padding: 8px 10px;
    background: var(--bg-card);
    border-radius: 6px;
    border-left: 3px solid var(--primary);
}

.superset-link-option {
    width: 100%;
    text-align: left;
    background: var(--bg-input);
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.superset-link-option:hover {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.1);
}

.superset-link-option:last-child {
    margin-bottom: 0;
}

.superset-link-option .set-number {
    font-weight: 600;
    color: var(--text-secondary);
    margin-right: 10px;
}

.superset-link-option .set-meta {
    color: var(--text-primary);
}

/* Desktop & Tablet Optimizations */
@media (min-width: 768px) {
    /* Layout */
    .exercise-list, 
    .all-exercises-list {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
        gap: 20px;
        align-content: flex-start;
    }

    .view {
        padding: 24px 32px;
    }

    /* Modal - Center on Desktop */
    .modal {
        align-items: center;
        padding: 20px;
    }

    .modal-content {
        max-width: 600px;
        border-radius: 24px; /* All corners rounded */
        max-height: 85vh;
        box-shadow: var(--shadow-lg);
        border: 1px solid var(--glass-border);
    }

    /* Charts - Give more space */
    .chart-container {
        height: 400px;
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

/* Large Desktop */
@media (min-width: 1200px) {
    .exercise-list, 
    .all-exercises-list {
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
        gap: 24px;
    }

    .view {
        padding: 32px 48px;
    }

    .stats-card {
        padding: 28px;
    }
}

/* Landscape Mobile Fixes */
@media (max-height: 500px) and (orientation: landscape) {
    .modal {
        align-items: flex-end;
    }
    
    .modal-content {
        max-height: 100vh;
        border-radius: 0;
    }
}

/* =====================================================
   Coach View Styles
   ===================================================== */

.coach-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: calc(100vh - 140px);
}

/* Goals Section */
.coach-goals-section {
    flex-shrink: 0;
    margin-bottom: 12px;
}

.goals-toggle {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.goals-toggle:hover {
    background: var(--bg-input);
}

.toggle-icon {
    transition: transform 0.2s;
    font-size: 12px;
}

.goals-toggle.open .toggle-icon {
    transform: rotate(180deg);
}

.goals-content {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-top: none;
    border-radius: 0 0 12px 12px;
    padding: 16px;
    margin-top: -12px;
    padding-top: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.goals-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.goals-form textarea {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    resize: vertical;
}

.goals-form select {
    width: 100%;
    padding: 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
}

/* Chat Section */
.coach-chat-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    overflow: hidden;
    min-height: 0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.chat-title {
    font-weight: 600;
    font-size: 15px;
}

.chat-actions {
    display: flex;
    gap: 8px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Welcome Screen */
.chat-welcome {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
}

.coach-avatar {
    font-size: 48px;
    margin-bottom: 12px;
}

.chat-welcome h3 {
    color: var(--text-primary);
    margin-bottom: 8px;
}

.chat-welcome ul {
    list-style: none;
    margin: 16px 0;
    text-align: left;
    max-width: 250px;
    margin-left: auto;
    margin-right: auto;
}

.chat-welcome li {
    padding: 6px 0;
}

.quick-prompts {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 20px;
}

.quick-prompts button {
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    text-align: left;
    transition: background 0.2s, border-color 0.2s;
}

.quick-prompts button:hover {
    background: var(--bg-dark);
    border-color: var(--primary);
}

/* Chat Messages */
.chat-message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.chat-message.user {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-bottom-right-radius: 4px;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.chat-message.assistant {
    align-self: flex-start;
    background: var(--bg-input);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

.chat-message.assistant pre {
    background: var(--bg-dark);
    padding: 12px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 8px 0;
    font-size: 13px;
}

.chat-message.assistant code {
    background: var(--bg-dark);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
}

.chat-message.typing {
    display: flex;
    gap: 4px;
    padding: 16px 20px;
}

.chat-message.typing span {
    width: 8px;
    height: 8px;
    background: var(--text-secondary);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.chat-message.typing span:nth-child(2) {
    animation-delay: 0.2s;
}

.chat-message.typing span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-4px);
        opacity: 1;
    }
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translateX(-50%) translateY(20px); }
    15% { opacity: 1; transform: translateX(-50%) translateY(0); }
    85% { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-20px); }
}

/* Chat Input */
.chat-input-section {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.chat-input-container {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.chat-input-container textarea {
    flex: 1;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-primary);
    font-size: 14px;
    resize: none;
    max-height: 120px;
    line-height: 1.4;
}

.chat-input-container textarea:focus {
    outline: none;
    border-color: var(--primary);
}

#sendChatBtn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

#sendChatBtn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#sendChatBtn:not(:disabled):hover {
    background: var(--primary-dark);
}

.send-icon {
    font-size: 18px;
}

/* Conversation History Modal */
.conversation-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.conversation-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-input);
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s;
}

.conversation-item:hover {
    background: var(--bg-dark);
}

.conversation-item.active {
    border: 1px solid var(--primary);
}

.conversation-info {
    flex: 1;
    min-width: 0;
}

.conversation-title {
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-preview {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 4px;
}

.conversation-delete {
    padding: 8px;
    background: transparent;
    border: none;
    color: var(--danger);
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.conversation-delete:hover {
    opacity: 1;
}

/* Responsive adjustments for Coach */
@media (min-width: 768px) {
    .coach-container {
        max-width: 800px;
        margin: 0 auto;
    }
    
    .chat-message {
        max-width: 70%;
    }
    
    .quick-prompts {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .quick-prompts button {
        flex: 0 1 auto;
    }
}

/* =====================================================
   Warmup Styles
   ===================================================== */

.warmup-section {
    margin-bottom: 20px;
}

.warmup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.warmup-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.warmup-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.warmup-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 14px 16px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.warmup-card:hover {
    border-color: var(--primary);
    transform: translateY(-1px);
}

.warmup-icon {
    font-size: 28px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(239, 68, 68, 0.15);
    border-radius: 10px;
}

.warmup-details {
    flex: 1;
}

.warmup-type {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.warmup-stats {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--text-secondary);
}

.warmup-duration {
    color: var(--primary-light);
    font-weight: 600;
}

.warmup-distance {
    color: var(--success);
}

.warmup-hr {
    color: #ef4444;
}

.warmup-empty {
    background: transparent;
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.warmup-empty:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Warmup Modal */
.warmup-type-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.warmup-type-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 12px;
    background: var(--bg-input);
    border: 2px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.warmup-type-btn:hover {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.1);
}

.warmup-type-icon {
    font-size: 28px;
}

.warmup-type-name {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
}

.selected-warmup-type {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(239, 68, 68, 0.15);
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 600;
}

/* Warmup Detail Modal */
.warmup-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.warmup-detail-item {
    background: var(--bg-input);
    border-radius: 10px;
    padding: 12px;
}

.warmup-detail-item.full-width {
    grid-column: span 2;
}

.warmup-detail-item .label {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.warmup-detail-item .value {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Warmup form textarea */
#warmupNotes {
    width: 100%;
    min-height: 60px;
    padding: 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    resize: vertical;
}

#warmupNotes:focus {
    outline: none;
    border-color: var(--primary);
}

/* Responsive Warmup Grid */
@media (min-width: 768px) {
    .warmup-list {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 12px;
    }
    
    .warmup-type-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Dashboard Grid */
.dashboard-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* KPI Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.kpi-card {
    background: var(--bg-card);
    padding: 16px;
    border-radius: 16px;
    border: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 4px 12px var(--shadow);
}

.kpi-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 4px 0;
}

.kpi-label {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.kpi-trend {
    font-size: 12px;
    font-weight: 600;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.kpi-trend.positive { color: var(--success); }
.kpi-trend.negative { color: var(--danger); }
.kpi-trend.neutral { color: var(--text-muted); }

/* Dashboard Cards */
.dashboard-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid var(--border-subtle);
    box-shadow: 0 4px 12px var(--shadow);
}

.dashboard-card h3 {
    font-size: 14px;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 16px;
    font-weight: 600;
}

/* Calendar */
.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.calendar-header h3 {
    margin: 0;
    font-size: 16px;
}

.calendar-nav {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    padding: 4px 12px;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.2s, color 0.2s;
}

.calendar-nav:hover {
    background: var(--bg-input);
    color: var(--text-primary);
}

.calendar-container {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    max-width: 320px;
    margin: 0 auto;
}

.calendar-weekday {
    text-align: center;
    font-size: 11px;
    color: var(--text-muted);
    padding: 4px 0;
    font-weight: 500;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    border-radius: 8px;
    background: var(--bg-input);
    color: var(--text-secondary);
    position: relative;
}

.calendar-day.empty {
    background: transparent;
}

.calendar-day.today {
    border: 2px solid var(--primary);
    color: var(--text-primary);
}

.calendar-day.trained {
    background: var(--primary);
    color: white;
    font-weight: 600;
}

.calendar-day.trained.today {
    border: 2px solid var(--primary-light);
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.5);
}

/* Chart Controls */
.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.chart-header h3 { margin-bottom: 0; }

.chart-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chart-select {
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 13px;
    max-width: 150px;
}

.toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--bg-input);
    padding: 4px 8px;
    border-radius: 20px;
    border: 1px solid var(--border);
}

.switch-sm {
    position: relative;
    display: inline-block;
    width: 32px;
    height: 18px;
}

.switch-sm input { opacity: 0; width: 0; height: 0; }

.switch-sm .slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--bg-dark);
    transition: .4s;
    border-radius: 34px;
}

.switch-sm .slider:before {
    position: absolute;
    content: "";
    height: 12px;
    width: 12px;
    left: 3px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.switch-sm input:checked + .slider {
    background-color: var(--primary);
}

.switch-sm input:checked + .slider:before {
    transform: translateX(14px);
}

@media (min-width: 768px) {
    .dashboard-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto auto;
    }
    
    #kpiGrid { grid-column: 1 / -1; }
    .dashboard-card:nth-child(2) { grid-column: 1 / -1; } /* Heatmap full width */
}

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid var(--danger);
}
.btn-danger:hover {
    background: var(--danger);
    color: white;
}
.setting-link {
    display: block;
    padding: 12px;
    color: var(--text-primary);
    text-decoration: none;
    background: var(--bg-input);
    border-radius: 8px;
    margin-bottom: 8px;
}
.setting-link:hover {
    background: var(--border);
}

/* Updated KPI Layout */
.kpi-section {
    margin-bottom: 24px;
}

.kpi-header {
    font-size: 13px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 12px;
    letter-spacing: 1px;
    font-weight: 600;
}

.kpi-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

@media (max-width: 600px) {
    .kpi-card {
        padding: 12px 8px;
    }
    .kpi-value {
        font-size: 20px;
    }
    .kpi-label {
        font-size: 11px;
    }
}
