/* Lift Log Styles */
.lift-log-layout {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.lift-log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.lift-log-header h2 {
    margin: 0;
    color: var(--text-primary);
}

.split-navigation {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

.nav-arrow {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.25rem;
    color: var(--text-primary);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.nav-arrow:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.lift-log-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Date Button */
.date-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    background: linear-gradient(135deg, var(--primary-color), #5b21b6);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    color: white;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
}

.lift-log-controls {
    position: relative;
}

.date-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
}

.date-btn svg {
    width: 18px;
    height: 18px;
    color: white;
    opacity: 0.9;
}

.date-btn #selected-date {
    font-size: 0.9rem;
    font-weight: 500;
}

/* Manage Split Button */
.manage-split-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
}

.manage-split-btn:hover {
    background: var(--hover-bg);
    border-color: var(--primary-color);
}

.manage-split-btn svg {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

/* Coach Generated Plan Button */
.coach-plan-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #10b981, #059669);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2);
}

.coach-plan-btn:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
}

.coach-plan-btn svg {
    width: 16px;
    height: 16px;
    color: white;
    opacity: 0.9;
}

/* Workout Plan Modal */
.plan-controls {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.ai-plan-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
}

.ai-plan-btn:hover {
    background: linear-gradient(135deg, #4f46e5, #4338ca);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
}

.coach-adjust-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.2);
}

.coach-adjust-btn:hover {
    background: linear-gradient(135deg, #d97706, #b45309);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.3);
}

.adjust-plan-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.2);
}

.adjust-plan-btn:hover {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.3);
}

.ai-plan-btn svg,
.coach-adjust-btn svg,
.adjust-plan-btn svg {
    width: 18px;
    height: 18px;
    opacity: 0.9;
}

.plan-content {
    min-height: 300px;
    padding: 20px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.empty-plan {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    height: 100%;
    min-height: 260px;
    color: var(--text-muted);
}

.empty-plan-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-plan-icon svg {
    width: 100%;
    height: 100%;
}

.empty-plan h4 {
    margin: 0 0 8px 0;
    color: var(--text-primary);
    font-size: 1.2rem;
}

.empty-plan p {
    margin: 0;
    max-width: 300px;
    line-height: 1.5;
}

.loading-plan {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 260px;
    color: var(--text-muted);
}

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

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.ai-plan-display,
.user-plan-display {
    padding: 0;
}

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

.plan-header h4 {
    margin: 0;
    color: var(--text-primary);
}

.plan-badge {
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ai-badge {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
}

.user-badge {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
}

.plan-overview {
    margin-bottom: 24px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 8px;
}

.plan-overview p {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.5;
}

.plan-schedule {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.plan-day {
    padding: 16px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.plan-day:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.plan-day h5 {
    margin: 0 0 8px 0;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.plan-day p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.plan-editor {
    text-align: center;
    padding: 40px 20px;
}

.plan-editor p {
    margin: 0 0 16px 0;
    color: var(--text-muted);
}

.ai-plan-form {
    padding: 0;
}

.form-header {
    text-align: center;
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.form-header h4 {
    margin: 0 0 8px 0;
    color: var(--text-primary);
    font-size: 1.3rem;
}

.form-header p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-group select {
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.9rem;
}

.body-parts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 12px;
}

.body-part-card {
    position: relative;
}

.body-part-card input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.body-part-card label {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 12px;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    min-height: 60px;
}

.body-part-card:hover label {
    border-color: var(--primary-color);
    background: var(--hover-bg);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.1);
}

.body-part-card input:checked + label {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(99, 102, 241, 0.05));
    color: var(--primary-color);
}

.body-part-icon {
    font-size: 1.5rem;
    margin-bottom: 4px;
}

.body-part-card span {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
}

.body-part-card input:checked + label span {
    color: var(--primary-color);
    font-weight: 600;
}

.form-group textarea {
    min-height: 80px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    resize: vertical;
    line-height: 1.4;
}

.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group textarea::placeholder {
    color: var(--text-muted);
    font-style: italic;
}

.saved-plans h4 {
    margin: 0 0 20px 0;
    color: var(--text-primary);
    text-align: center;
}

.plans-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.plan-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.plan-item:hover {
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.plan-info h5 {
    margin: 0 0 4px 0;
    color: var(--text-primary);
    font-size: 1rem;
}

.plan-info p {
    margin: 0 0 8px 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.delete-plan-btn {
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 4px;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 14px;
}

.plan-details {
    padding: 0;
}

.plan-stats {
    display: flex;
    gap: 16px;
    margin-top: 12px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.plan-day-detail {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.plan-day-detail h5 {
    margin: 0 0 4px 0;
    color: var(--text-primary);
}

.day-focus {
    margin: 0 0 12px 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}

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

.exercise-item {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid var(--border-color);
}

.exercise-name {
    color: var(--text-primary);
    font-size: 0.9rem;
}

.exercise-sets {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.plan-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.error-state {
    text-align: center;
    padding: 40px 20px;
}

.error-state h4 {
    margin: 0 0 8px 0;
    color: var(--danger-color);
}

.error-state p {
    margin: 0 0 20px 0;
    color: var(--text-muted);
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.btn-primary,
.btn-secondary {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

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

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--text-muted);
    color: white;
}

.btn-secondary:hover {
    background: #6b7280;
}

/* View Toggle */
.view-toggle {
    display: flex;
    background: var(--card-bg);
    border-radius: 8px;
    padding: 4px;
    border: 1px solid var(--border-color);
}

.view-btn {
    padding: 0.5rem 0.75rem;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
}

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

.view-btn:not(.active):hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

/* Calendar Popup */
.lift-log-controls {
    position: relative;
}

.calendar-popup {
    position: static;
    width: 100%;
    height: 300px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    margin: 10px 0 20px 0;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0 0.5rem;
}

.calendar-nav {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    color: var(--text-primary);
    transition: background 0.2s ease;
}

.calendar-nav:hover {
    background: var(--hover-bg);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    flex: 1;
}

.calendar-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 6px;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    color: var(--text-primary);
    min-height: 32px;
    padding: 4px;
}

.calendar-day:hover {
    background: var(--hover-bg);
}

.calendar-day.selected {
    background: var(--primary-color);
    color: white;
}

.calendar-day.other-month {
    color: var(--text-muted);
}

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

.calendar-day.has-workout {
    background: var(--success-color);
    color: white;
    font-weight: 600;
}

.calendar-day.has-workout.today {
    background: linear-gradient(45deg, var(--primary-color), var(--success-color));
}

.workout-display {
    margin-top: 32px;
    padding: 24px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

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

.workout-display-header h3 {
    margin: 0;
    color: var(--text-primary);
}

.workout-display-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.close-workout-display {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
}

.close-workout-display:hover {
    color: var(--text-primary);
}

.workout-display-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.workout-exercise {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.workout-exercise:hover {
    background: var(--hover-bg);
}

.workout-exercise-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 8px;
}

.workout-exercise-name {
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.workout-exercise-toggle {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s ease;
}

.workout-exercise-toggle:hover {
    color: var(--text-primary);
}

.workout-sets {
    flex-direction: column;
    gap: 4px;
    margin-top: 8px;
    display: none;
}

.workout-sets.expanded {
    display: flex;
}

.workout-set {
    font-size: 0.9rem;
    color: var(--text-muted);
    padding: 2px 0;
}

/* Split Views */
.lift-log-content {
    position: relative;
    transition: margin-top 0.3s ease;
}

.lift-log-content.calendar-open {
    margin-top: 0;
}

.split-container {
    overflow: hidden;
    flex: 1;
}

.weekly-split,
.xday-split {
    display: flex;
    gap: 1rem;
    transition: transform 0.3s ease;
    padding: 0.5rem 0;
}

.weekly-split {
    width: 100%;
    display: flex;
    gap: 1rem;
}

.xday-split {
    width: fit-content;
}

/* Day Cards */
.day-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    transition: all 0.2s ease;
    min-height: 100px;
    min-width: 120px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.weekly-split .day-card {
    flex: 1;
    min-width: 0;
}

.xday-split .day-card {
    min-width: 120px;
    flex-shrink: 0;
}

.day-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

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

.day-name {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.session-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 0.7rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    white-space: nowrap;
}

.session-btn:hover {
    background: var(--primary-hover);
}

.session-btn.adjust {
    background: var(--warning-color);
}

.session-btn.adjust:hover {
    background: var(--warning-hover);
}

.muscle-groups {
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.workout-log-section {
    margin-top: 32px;
    padding: 24px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

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

.workout-header h3 {
    margin: 0;
    color: var(--text-primary);
}

.close-workout {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
}

.close-workout:hover {
    color: var(--text-primary);
}

.workout-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.workout-name-input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--bg-secondary);
}

.exercises-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.exercise-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.2s ease;
}

.exercise-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.1);
}

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

.exercise-title {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.exercise-number {
    background: var(--primary-color);
    color: white;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 32px;
    text-align: center;
}

.exercise-name-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    background: var(--bg-secondary);
}

.exercise-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.expand-sets-btn {
    background: none;
    border: none;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-muted);
}

.expand-sets-btn:hover {
    color: var(--primary-color);
}

.expand-sets-btn svg {
    width: 16px;
    height: 16px;
}

.remove-exercise-btn {
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease;
}

.remove-exercise-btn:hover {
    background: #dc2626;
    transform: scale(1.05);
}

.exercise-meta {
    margin-bottom: 16px;
}

.meta-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.meta-group label {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

.cadence-select {
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.875rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.sets-section {
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
    max-height: 60px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.sets-section.expanded {
    max-height: 500px;
}

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

.sets-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sets-title h5 {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.sets-count {
    background: var(--bg-secondary);
    color: var(--text-muted);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
}

.add-set-btn {
    background: var(--success-color);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.add-set-btn:hover {
    background: #059669;
    transform: translateY(-1px);
}

.sets-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.set-headers {
    display: grid;
    grid-template-columns: 40px 1fr 1fr 80px 40px;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.set-row {
    display: grid;
    grid-template-columns: 40px 1fr 1fr 80px 40px;
    gap: 8px;
    align-items: center;
    padding: 8px 0;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.set-row:hover {
    background: var(--bg-secondary);
}

.set-number {
    background: var(--bg-secondary);
    color: var(--text-muted);
    border-radius: 4px;
    padding: 4px;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 600;
}

.set-weight,
.set-reps,
.set-rpe {
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    text-align: center;
    font-size: 0.9rem;
    background: var(--bg-secondary);
    transition: border-color 0.2s ease;
}

.set-weight:focus,
.set-reps:focus,
.set-rpe:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

.remove-set-btn {
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 4px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
}

.remove-set-btn:hover {
    background: #dc2626;
    transform: scale(1.1);
}



.add-exercise-btn {
    background: var(--success-color);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    cursor: pointer;
    font-size: 0.9rem;
    align-self: flex-start;
}

.workout-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.save-workout-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
}

.cancel-workout-btn {
    background: var(--text-muted);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    cursor: pointer;
    font-size: 1rem;
}

.log-session-container {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.log-session-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.log-session-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.day-card.active {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, var(--primary-color)10, var(--card-bg));
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.2);
}

.day-card {
    cursor: pointer;
}

.workout-log-container {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.workout-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.workout-name-input {
    width: 100%;
    padding: 6px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.8rem;
}

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

.exercise-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px;
    background: var(--bg-secondary);
    border-radius: 4px;
    font-size: 0.75rem;
}

.exercise-name {
    flex: 1;
    padding: 3px 5px;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    font-size: 0.75rem;
}

.set-input {
    width: 35px;
    padding: 3px;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    text-align: center;
    font-size: 0.7rem;
}

.remove-exercise {
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 3px;
    padding: 3px 5px;
    cursor: pointer;
    font-size: 0.65rem;
}

.add-exercise-btn {
    background: var(--success-color);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 0.7rem;
    align-self: flex-start;
}

.workout-actions {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

.save-workout-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 0.7rem;
}

.cancel-workout-btn {
    background: var(--text-muted);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 0.7rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .lift-log-layout {
        padding: 1rem;
    }
    
    .lift-log-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .lift-log-controls {
        justify-content: space-between;
    }
    
    .day-card {
        min-width: 100px;
        padding: 0.75rem;
    }
    
    .day-header {
        flex-direction: column;
        gap: 6px;
        align-items: center;
    }
    
    .session-btn {
        font-size: 0.65rem;
        padding: 3px 6px;
    }
    
    .manage-split-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .manage-split-btn svg {
        width: 14px;
        height: 14px;
    }
    
    .calendar-popup {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 90vw;
        max-width: 320px;
    }
}
/* Confirmation Modal */
.confirmation-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.confirmation-content {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 24px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.confirmation-content h3 {
    margin: 0 0 12px 0;
    color: var(--text-primary);
}

.confirmation-content p {
    margin: 0 0 24px 0;
    color: var(--text-muted);
}

.confirmation-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.confirm-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 0.9rem;
}

.cancel-btn {
    background: var(--text-muted);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 0.9rem;
}
/* Workout Form Improvements */
.workout-info {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 24px;
    margin-bottom: 32px;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: 12px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.workout-date-input,
.workout-name-input {
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--card-bg);
    color: var(--text-primary);
}

.workout-date-input:focus,
.workout-name-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.exercises-section {
    margin-bottom: 32px;
}

.exercises-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border-color);
}

.exercises-header h4 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.3rem;
    font-weight: 600;
}

.workout-notes {
    margin-bottom: 32px;
}

.workout-notes label {
    display: block;
    margin-bottom: 12px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.workout-notes textarea {
    width: 100%;
    min-height: 100px;
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    resize: vertical;
    font-family: inherit;
}

.workout-notes textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.workout-actions {
    display: flex;
    gap: 16px;
    justify-content: flex-end;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.save-workout-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 32px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.save-workout-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.cancel-workout-btn {
    background: var(--text-muted);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.cancel-workout-btn:hover {
    background: #6b7280;
}
.loading-plan p {
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
    font-weight: 500;
}

.loading-plan small {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.error-state {
    text-align: center;
    padding: 2rem;
}

.error-state h4 {
    color: var(--error);
    margin: 0 0 1rem 0;
}

.error-state p {
    color: var(--text-muted);
    margin: 0 0 1.5rem 0;
    line-height: 1.5;
}

.error-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.plan-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.plan-item:hover {
    border-color: var(--primary);
    background: var(--bg-secondary);
}

.plan-info h5 {
    margin: 0 0 0.25rem 0;
    color: var(--text-primary);
}

.plan-info p {
    margin: 0 0 0.5rem 0;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.delete-plan-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.delete-plan-btn:hover {
    background: var(--error);
    color: white;
}