/* ============================================
   Vespera — Fresh & Vibrant Theme
   ============================================ */

:root {
    --vs-primary: #0D9488;
    --vs-primary-light: #14B8A6;
    --vs-primary-dark: #0F766E;
    --vs-accent: #F97316;
    --vs-accent-light: #FB923C;

    --vs-bg: #FFFFFF;
    --vs-bg-subtle: #F8FAFC;
    --vs-text: #1E293B;
    --vs-text-muted: #64748B;
    --vs-heading: #0F172A;
    --vs-border: #E2E8F0;
    --vs-card-bg: #FFFFFF;
    --vs-card-border: #E2E8F0;
    --vs-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --vs-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --vs-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --vs-danger: #EF4444;

    --font-heading: 'Inter', sans-serif;
    --font-body: 'Nunito', sans-serif;
}

/* ---------- Base ---------- */
html, body {
    font-family: var(--font-body);
    font-weight: 400;
    background: var(--vs-bg-subtle);
    color: var(--vs-text);
    min-height: 100vh;
    margin: 0;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--vs-heading);
    letter-spacing: -0.01em;
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: var(--vs-primary);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover, .btn-link:hover {
    color: var(--vs-primary-dark);
}

p {
    font-size: 1.05rem;
    line-height: 1.6;
}

/* ---------- Content area ---------- */
.content {
    padding-top: 1.1rem;
}

/* ---------- Buttons ---------- */
.btn-primary {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.01em;
    color: #fff;
    background: var(--vs-primary);
    border: none;
    border-radius: 8px;
    padding: 0.6rem 1.6rem;
    transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
}

.btn-primary:hover, .btn-primary:focus {
    background: var(--vs-primary-dark);
    box-shadow: var(--vs-shadow-md);
    transform: translateY(-1px);
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.15rem rgba(13, 148, 136, 0.35);
}

/* ---------- Navigation tiles (Home dashboard) ---------- */
.nav-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2rem 1.5rem;
    background: var(--vs-card-bg);
    border: 1px solid var(--vs-card-border);
    border-radius: 16px;
    text-decoration: none;
    color: var(--vs-text);
    transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
    box-shadow: var(--vs-shadow-sm);
    min-height: 180px;
}

.nav-tile:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: var(--vs-shadow-lg);
    border-color: var(--vs-primary-light);
    color: var(--vs-heading);
    text-decoration: none;
}

.nav-tile .tile-icon {
    font-size: 2.5rem;
    line-height: 1;
}

.nav-tile .tile-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: 0.01em;
    color: var(--vs-heading);
}

.nav-tile .tile-desc {
    font-size: 0.9rem;
    color: var(--vs-text-muted);
    text-align: center;
}

/* ---------- Tables ---------- */
.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--vs-text);
    --bs-table-border-color: var(--vs-border);
    border-collapse: separate;
    border-spacing: 0;
}

.table thead th {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--vs-primary-dark);
    background: var(--vs-bg-subtle);
    border-bottom: 2px solid var(--vs-primary);
    padding: 0.75rem 1rem;
}

.table tbody tr {
    transition: background 0.2s;
}

.table tbody tr:nth-child(odd) {
    background: #FFFFFF;
}

.table tbody tr:nth-child(even) {
    background: var(--vs-bg-subtle);
}

.table tbody tr:hover {
    background: rgba(13, 148, 136, 0.06);
}

.table tbody td {
    padding: 0.65rem 1rem;
    border-bottom: 1px solid var(--vs-border);
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
    --bs-table-bg-type: #FFFFFF;
    color: var(--vs-text);
}

/* ---------- Forms ---------- */
.form-control, .form-select {
    background: #FFFFFF;
    border: 1px solid var(--vs-border);
    color: var(--vs-text);
    border-radius: 8px;
}

.form-control:focus, .form-select:focus {
    background: #FFFFFF;
    border-color: var(--vs-primary);
    color: var(--vs-text);
    box-shadow: 0 0 0 0.15rem rgba(13, 148, 136, 0.2);
}

/* ---------- Validation ---------- */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--vs-primary);
}

.invalid {
    outline: 1px solid var(--vs-danger);
}

.validation-message {
    color: var(--vs-danger);
}

/* ---------- Error boundary ---------- */
.blazor-error-boundary {
    background: #FEF2F2;
    padding: 1rem 1rem 1rem 1.5rem;
    color: #991B1B;
    border-left: 4px solid var(--vs-danger);
    border-radius: 8px;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

/* ---------- Misc ---------- */
.darker-border-checkbox.form-check-input {
    border-color: var(--vs-text-muted);
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--vs-text-muted);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* ---------- Hero heading ---------- */
.hero-title {
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: clamp(2rem, 6vw, 3.5rem);
    background: linear-gradient(135deg, var(--vs-primary), var(--vs-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    margin-bottom: 0.25rem;
}

.hero-subtitle {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 1.1rem;
    color: var(--vs-text-muted);
    letter-spacing: 0.05em;
}

/* ---------- Page header ---------- */
.page-header {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.75rem;
    color: var(--vs-heading);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--vs-border);
}

/* ---------- Loading ---------- */
em {
    color: var(--vs-primary);
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--vs-bg-subtle);
}

::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94A3B8;
}

/* ---------- Auth Pages ---------- */
.auth-card {
    background: var(--vs-card-bg);
    border: 1px solid var(--vs-card-border);
    border-radius: 12px;
    padding: 2rem;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--vs-shadow-lg);
}

.auth-title {
    font-size: 1.5rem;
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--vs-primary);
}

.auth-card .form-label {
    color: var(--vs-text-muted);
    font-weight: 500;
    font-size: 0.9rem;
}

.auth-card .form-control {
    background: #FFFFFF;
    border: 1px solid var(--vs-border);
    color: var(--vs-text);
    border-radius: 6px;
}

.auth-card .form-control:focus {
    background: #FFFFFF;
    border-color: var(--vs-primary);
    box-shadow: 0 0 0 0.2rem rgba(13, 148, 136, 0.15);
    color: var(--vs-text);
}

.auth-card .btn-primary {
    background: var(--vs-primary);
    border: none;
    font-family: var(--font-heading);
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 0.5rem;
    transition: all 0.2s;
}

.auth-card .btn-primary:hover {
    background: var(--vs-primary-dark);
    box-shadow: var(--vs-shadow-md);
}

.auth-card a {
    color: var(--vs-accent);
}

.auth-card a:hover {
    color: var(--vs-accent-light);
}

/* ============================================
   Preferences
   ============================================ */

.preferences-page {
    max-width: 600px;
    margin: 0 auto;
}

.pref-card {
    background: var(--vs-card-bg);
    border: 1px solid var(--vs-card-border);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--vs-shadow-sm);
}

.pref-card-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1rem;
    color: var(--vs-heading);
    margin-bottom: 0.25rem;
}

.pref-card-desc {
    font-size: 0.85rem;
    color: var(--vs-text-muted);
    margin-bottom: 1rem;
}

.unit-selector {
    display: flex;
    gap: 0.75rem;
}

.unit-option {
    flex: 1;
    position: relative;
    cursor: pointer;
}

.unit-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.unit-option-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 1rem;
    border: 2px solid var(--vs-border);
    border-radius: 10px;
    transition: all 0.15s;
    text-align: center;
}

.unit-option.selected .unit-option-content {
    border-color: var(--vs-primary);
    background: rgba(13, 148, 136, 0.05);
}

.unit-option:hover .unit-option-content {
    border-color: var(--vs-primary-light);
}

.unit-option-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--vs-text);
}

.unit-option-abbr {
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--vs-primary);
}

.pref-saved-badge {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--vs-primary);
    animation: pref-fade-in 0.3s ease;
}

@keyframes pref-fade-in {
    from { opacity: 0; transform: translateX(-4px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ============================================
   Change Password
   ============================================ */

.cp-field {
    margin-bottom: 1rem;
}

.cp-label {
    display: block;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--vs-text);
    margin-bottom: 0.35rem;
}

.cp-input {
    width: 100%;
    max-width: 360px;
    padding: 0.6rem 0.85rem;
    font-family: var(--font-body);
    font-size: 0.95rem;
    border: 1.5px solid var(--vs-border);
    border-radius: 10px;
    background: var(--vs-bg);
    color: var(--vs-text);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    box-sizing: border-box;
}

.cp-input:focus {
    outline: none;
    border-color: var(--vs-primary);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

.cp-input::placeholder {
    color: var(--vs-text-muted);
    opacity: 0.6;
}

.cp-validation {
    display: block;
    font-size: 0.8rem;
    color: var(--vs-danger);
    margin-top: 0.25rem;
}

.cp-divider {
    height: 1px;
    background: var(--vs-border);
    margin: 1.25rem 0;
    opacity: 0.5;
}

.cp-success {
    text-align: center;
    padding: 1.5rem 1rem;
}

.cp-success-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: rgba(13, 148, 136, 0.1);
    color: var(--vs-primary);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.cp-success h5 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--vs-heading);
    margin-bottom: 0.35rem;
}

.cp-success p {
    color: var(--vs-text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
}

@media (max-width: 480px) {
    .cp-input {
        max-width: 100%;
    }
}

/* ============================================
   Workout Sessions
   ============================================ */

/* -- Session History Page -- */
.sessions-page {
    max-width: 720px;
    margin: 0 auto;
}

.session-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.session-card {
    display: block;
    background: var(--vs-card-bg);
    border: 1px solid var(--vs-card-border);
    border-left: 4px solid var(--vs-primary);
    border-radius: 12px;
    text-decoration: none;
    color: var(--vs-text);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: var(--vs-shadow-sm);
    overflow: hidden;
}

.session-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--vs-shadow-md);
    color: var(--vs-text);
    border-left-color: var(--vs-accent);
}

.session-card-inner {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    gap: 1rem;
}

.session-card-leading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 3rem;
}

.session-card-day {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1;
    color: var(--vs-primary);
}

.session-card-month {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--vs-text-muted);
}

.session-card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    min-width: 0;
}

.session-card-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--vs-primary);
}

.session-card-workout {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--vs-heading);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.session-card-stats {
    font-size: 0.8rem;
    color: var(--vs-text-muted);
}

.session-card-chevron {
    font-size: 1.5rem;
    color: var(--vs-border);
    font-weight: 300;
    line-height: 1;
}

.session-empty-state {
    text-align: center;
    padding: 4rem 1.5rem;
    color: var(--vs-text-muted);
}

.session-empty-state .empty-icon {
    font-size: 4rem;
    margin-bottom: 0.75rem;
}

.session-empty-state h3 {
    font-family: var(--font-heading);
    color: var(--vs-heading);
    margin-bottom: 0.5rem;
}

/* -- Session Entry Page -- */
.session-entry {
    max-width: 720px;
    margin: 0 auto;
    padding-bottom: 5rem;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 10px;
    background: var(--vs-bg);
    border: 1px solid var(--vs-border);
    color: var(--vs-text);
    font-size: 1.1rem;
    text-decoration: none;
    transition: all 0.15s;
    flex-shrink: 0;
}

.btn-back:hover {
    background: var(--vs-bg-subtle);
    color: var(--vs-primary);
    border-color: var(--vs-primary);
}

/* Unit toggle */
.unit-toggle {
    display: inline-flex;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid var(--vs-primary);
    flex-shrink: 0;
}

.unit-toggle button {
    padding: 0.25rem 0.75rem;
    border: none;
    background: transparent;
    color: var(--vs-primary);
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    letter-spacing: 0.02em;
}

.unit-toggle button.active {
    background: var(--vs-primary);
    color: white;
}

.unit-toggle button:not(.active):hover {
    background: rgba(13, 148, 136, 0.08);
}

/* Exercise entry cards */
.exercise-entry-card {
    background: var(--vs-card-bg);
    border: 1px solid var(--vs-card-border);
    border-radius: 12px;
    margin-bottom: 1rem;
    overflow: hidden;
    box-shadow: var(--vs-shadow-sm);
}

.exercise-entry-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: linear-gradient(135deg, var(--vs-primary) 0%, var(--vs-primary-dark) 100%);
    color: white;
    cursor: pointer;
    user-select: none;
    transition: opacity 0.15s;
}

.exercise-entry-header:hover {
    opacity: 0.92;
}

.exercise-entry-name {
    flex: 1;
    font-weight: 700;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.exercise-entry-badge {
    font-size: 0.7rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.15rem 0.5rem;
    border-radius: 20px;
    white-space: nowrap;
}

.exercise-entry-chevron {
    font-size: 0.85rem;
    transition: transform 0.2s ease;
    opacity: 0.7;
}

.exercise-entry-chevron.expanded {
    transform: rotate(90deg);
}

.exercise-entry-body {
    padding: 0.75rem 1rem 1rem;
}

/* Set rows */
.set-header-row {
    display: grid;
    grid-template-columns: 2.5rem 1fr 1.5fr 2rem;
    gap: 0.5rem;
    padding: 0 0 0.375rem;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--vs-text-muted);
}

.set-row {
    display: grid;
    grid-template-columns: 2.5rem 1fr 1.5fr 2rem;
    gap: 0.5rem;
    align-items: start;
    padding: 0.3rem 0;
}

.set-number-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2.375rem;
    border-radius: 8px;
    background: var(--vs-bg-subtle);
    font-weight: 800;
    font-size: 0.8rem;
    color: var(--vs-primary);
}

.set-row .form-control {
    font-size: 0.95rem;
    padding: 0.4rem 0.5rem;
    min-height: 2.375rem;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
}

.weight-cell {
    min-width: 0;
}

.weight-conversion-text {
    display: block;
    font-size: 0.65rem;
    color: var(--vs-text-muted);
    text-align: center;
    line-height: 1.2;
    margin-top: 1px;
    min-height: 0.85rem;
}

.btn-set-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2.375rem;
    border: none;
    background: transparent;
    color: var(--vs-text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.15s;
    padding: 0;
}

.btn-set-remove:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.1);
    color: var(--vs-danger);
}

.btn-set-remove:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.btn-add-set {
    display: block;
    width: 100%;
    padding: 0.5rem;
    margin-top: 0.5rem;
    border: 2px dashed var(--vs-border);
    border-radius: 8px;
    background: transparent;
    color: var(--vs-primary);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-add-set:hover {
    border-color: var(--vs-primary);
    background: rgba(13, 148, 136, 0.04);
}

/* Numeric Spinner — desktop defaults */
.numeric-spinner {
    min-width: 0;
}

.spinner-mobile {
    display: none;
}

.reps-cell {
    min-width: 0;
}

.set-field-label {
    display: none;
}

/* Action bar */
.session-action-bar {
    position: sticky;
    bottom: 0;
    background: var(--vs-bg);
    border-top: 1px solid var(--vs-border);
    padding: 0.875rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 10;
    margin-top: 1rem;
}

.autosave-status {
    font-size: 0.8rem;
    font-weight: 500;
    transition: opacity 0.3s ease;
}

.autosave-status.saving {
    color: var(--vs-text-muted, #999);
}

.autosave-status.saved {
    color: var(--vs-primary, #0D9488);
}

.autosave-status.error {
    color: var(--vs-danger, #ef4444);
}

/* -- Mobile refinements -- */
@media (max-width: 576px) {
    .session-entry {
        padding-bottom: 6rem;
    }

    .session-action-bar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 0.75rem 1rem;
        box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
    }

    /* Hide column headers — mobile uses inline labels */
    .set-header-row {
        display: none;
    }

    /* Stack reps & weight vertically within each set */
    .set-row {
        grid-template-columns: 2rem 1fr 1.75rem;
        grid-template-rows: auto auto;
        gap: 0.25rem 0.5rem;
        padding: 0.625rem 0;
        border-bottom: 1px solid var(--vs-border);
    }

    .set-row:last-of-type {
        border-bottom: none;
    }

    .set-number-badge {
        grid-row: 1 / 3;
        grid-column: 1;
        align-self: center;
        width: 1.75rem;
        font-size: 0.75rem;
    }

    .reps-cell {
        grid-column: 2;
        grid-row: 1;
    }

    .weight-cell {
        grid-column: 2;
        grid-row: 2;
    }

    .btn-set-remove {
        grid-row: 1 / 3;
        grid-column: 3;
        align-self: center;
        width: 1.75rem;
        height: 2.75rem;
    }

    /* Mobile field labels */
    .set-field-label {
        display: block;
        font-size: 0.6rem;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: 0.08em;
        color: var(--vs-text-muted);
        margin-bottom: 0.2rem;
    }

    /* Spinner: hide desktop input, show mobile stepper */
    .spinner-desktop {
        display: none !important;
    }

    .spinner-mobile {
        display: flex;
        align-items: center;
        gap: 0;
    }

    .spinner-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 2.75rem;
        height: 2.75rem;
        min-width: 2.75rem;
        border: 2px solid var(--vs-primary);
        background: var(--vs-primary);
        color: #fff;
        cursor: pointer;
        padding: 0;
        transition: all 0.12s ease;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }

    .spinner-btn svg {
        pointer-events: none;
    }

    .spinner-btn-dec {
        border-radius: 10px 0 0 10px;
        background: #fff;
        color: var(--vs-primary);
    }

    .spinner-btn-inc {
        border-radius: 0 10px 10px 0;
    }

    .spinner-btn:active:not(:disabled) {
        transform: scale(0.93);
        opacity: 0.85;
    }

    .spinner-btn-dec:active:not(:disabled) {
        background: rgba(13, 148, 136, 0.1);
    }

    .spinner-btn-inc:active:not(:disabled) {
        background: var(--vs-primary-dark);
    }

    .spinner-btn:disabled {
        opacity: 0.3;
        cursor: not-allowed;
    }

    .spinner-input {
        flex: 1;
        min-width: 0;
        text-align: center;
        font-weight: 700;
        font-size: 1.05rem;
        height: 2.75rem;
        min-height: 2.75rem;
        border-radius: 0;
        border-left: none;
        border-right: none;
        border-color: var(--vs-primary);
        padding: 0.25rem 0.4rem;
    }

    .spinner-input:focus {
        border-color: var(--vs-primary);
        box-shadow: none;
        z-index: 1;
    }

    /* Remove browser default number input spinners on mobile */
    .spinner-input::-webkit-outer-spin-button,
    .spinner-input::-webkit-inner-spin-button {
        -webkit-appearance: none;
        margin: 0;
    }

    .spinner-input[type="number"] {
        -moz-appearance: textfield;
    }

    /* Desktop input styles for set-row (fallback, hidden on mobile) */
    .set-row .form-control.spinner-desktop {
        min-height: 2.75rem;
        font-size: 1rem;
    }

    .exercise-entry-header {
        padding: 1rem;
    }

    .session-card-inner {
        padding: 0.875rem 1rem;
    }
}

/* ---------- AI Suggest Button ---------- */

.btn-ai-suggest {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    color: white;
    padding: 0.15rem 0.55rem;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    line-height: 1.3;
}

.btn-ai-suggest:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: scale(1.05);
}

.btn-ai-suggest:active {
    transform: scale(0.95);
}

/* ---------- Bottom Sheet (Exercise Alternatives) ---------- */

.alternatives-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1050;
    display: flex;
    align-items: flex-end;
    animation: fadeIn 0.2s ease;
}

.alternatives-sheet {
    background: var(--vs-card-bg);
    border-radius: 1.25rem 1.25rem 0 0;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    max-height: 70vh;
    overflow-y: auto;
    padding: 1rem 1.25rem 1.5rem;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

.alternatives-sheet.open {
    transform: translateY(0);
}

.alternatives-handle {
    width: 36px;
    height: 4px;
    background: var(--vs-border);
    border-radius: 2px;
    margin: 0 auto 1rem;
}

.alternatives-title {
    font-family: var(--font-heading);
    font-size: 1rem;
    color: var(--vs-heading);
    margin-bottom: 1rem;
    font-weight: 500;
}

.alternatives-title strong {
    color: var(--vs-primary);
}

.alternatives-loading,
.alternatives-error,
.alternatives-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 2rem 1rem;
    color: var(--vs-text-muted);
    font-size: 0.9rem;
}

.alternatives-error {
    color: var(--vs-danger);
}

.alternatives-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.alternative-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    background: var(--vs-bg-subtle);
    border: 1px solid var(--vs-border);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
    text-align: left;
    width: 100%;
    color: var(--vs-text);
}

.alternative-item:hover {
    border-color: var(--vs-primary);
    box-shadow: var(--vs-shadow-sm);
}

.alternative-item:active {
    background: var(--vs-primary);
    color: white;
    border-color: var(--vs-primary);
}

.alternative-item:active .alternative-muscle,
.alternative-item:active .alternative-reason {
    color: rgba(255, 255, 255, 0.8);
}

.alternative-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alternative-name {
    font-weight: 700;
    font-size: 0.95rem;
}

.alternative-badge {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: var(--vs-primary);
    color: white;
    padding: 0.1rem 0.4rem;
    border-radius: 0.375rem;
    white-space: nowrap;
}

.alternative-item.existing {
    border-color: var(--vs-primary);
    border-width: 1.5px;
}

.alternative-muscle {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--vs-primary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.alternative-reason {
    font-size: 0.8rem;
    color: var(--vs-text-muted);
}

/* Desktop: centered modal instead of bottom sheet */
@media (min-width: 768px) {
    .alternatives-overlay {
        align-items: center;
        justify-content: center;
    }

    .alternatives-sheet {
        border-radius: 1rem;
        max-height: 60vh;
        transform: scale(0.95);
        opacity: 0;
        transition: transform 0.25s cubic-bezier(0.32, 0.72, 0, 1),
                    opacity 0.25s ease;
    }

    .alternatives-sheet.open {
        transform: scale(1);
        opacity: 1;
    }

    .alternatives-handle {
        display: none;
    }
}

/* ============================================
   Admin — User Management (Mobile Cards)
   ============================================ */

/* ---- Exercise Cards (mobile CRUD) ---- */
.exercise-cards {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.exercise-card {
    background: var(--vs-card-bg);
    border: 1px solid var(--vs-card-border);
    border-left: 4px solid var(--vs-primary);
    border-radius: 12px;
    padding: 1rem 1.125rem;
    box-shadow: var(--vs-shadow-sm);
}

.exercise-card--adding {
    border-left-color: var(--vs-primary-dark);
    background: var(--vs-bg-subtle);
}

.exercise-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.exercise-card-name {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--vs-heading);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.exercise-card-actions {
    display: flex;
    gap: 0.5rem;
    padding-top: 0.375rem;
    border-top: 1px solid var(--vs-border);
}

.exercise-card-actions .btn {
    font-size: 0.8rem;
    padding: 0.425rem 0.5rem;
}

.exercise-card-edit-form {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.exercise-card-edit-form .form-control {
    font-size: 1rem;
    min-height: 2.75rem;
}

.exercise-card-edit-actions {
    display: flex;
    gap: 0.5rem;
}

.exercise-card-edit-actions .btn {
    font-size: 0.8rem;
    padding: 0.425rem 0.5rem;
}

.exercise-card-confirm {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.exercise-card-confirm-msg {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--vs-heading);
}

/* ---- Workout Cards (mobile) ---- */
.workout-cards {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.workout-card {
    background: var(--vs-card-bg);
    border: 1px solid var(--vs-card-border);
    border-left: 4px solid var(--vs-primary);
    border-radius: 12px;
    padding: 1rem 1.125rem;
    box-shadow: var(--vs-shadow-sm);
}

.workout-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.375rem;
}

.workout-card-name {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--vs-heading);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.workout-card-meta {
    font-size: 0.85rem;
    color: var(--vs-text-muted);
    margin-bottom: 0.625rem;
}

.workout-card-actions {
    display: flex;
    gap: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--vs-border);
}

.workout-card-actions .btn {
    flex: 1;
    font-size: 0.8rem;
    padding: 0.425rem 0.5rem;
}

/* ---- Workout Exercise Cards (mobile editor) ---- */
.workout-exercise-cards {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    margin-bottom: 1rem;
}

.workout-exercise-card {
    background: var(--vs-bg-subtle);
    border: 1px solid var(--vs-border);
    border-radius: 10px;
    padding: 0.75rem 0.875rem;
}

.workout-exercise-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.625rem;
}

.workout-exercise-card-name {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--vs-heading);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.workout-exercise-card-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 0.625rem;
}

.workout-exercise-field .form-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--vs-text-muted);
}

.workout-exercise-field .form-control {
    text-align: center;
    font-weight: 600;
    min-height: 2.75rem;
    font-size: 1rem;
}

.workout-exercise-card-order {
    display: flex;
    gap: 0.5rem;
}

.workout-exercise-card-order .btn {
    min-height: 2.25rem;
    font-size: 0.85rem;
}

.admin-user-cards {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.admin-user-card {
    background: var(--vs-card-bg);
    border: 1px solid var(--vs-card-border);
    border-left: 4px solid var(--vs-primary);
    border-radius: 12px;
    padding: 1rem 1.125rem;
    box-shadow: var(--vs-shadow-sm);
}

.admin-user-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.375rem;
}

.admin-user-card-name {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--vs-heading);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-user-card-meta {
    display: flex;
    flex-direction: column;
    gap: 0.175rem;
    font-size: 0.85rem;
    color: var(--vs-text-muted);
    margin-bottom: 0.625rem;
}

.admin-user-card-meta a {
    color: var(--vs-text-muted);
    text-decoration: none;
}

.admin-user-card-actions {
    display: flex;
    gap: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--vs-border);
}

.admin-user-card-actions .btn {
    flex: 1;
    font-size: 0.8rem;
    padding: 0.425rem 0.5rem;
}

.admin-user-card-you {
    text-align: center;
    padding-top: 0.375rem;
    font-size: 0.8rem;
    font-style: italic;
    color: var(--vs-text-muted);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
