/* ============================================================
   CSS Custom Properties
   ============================================================ */

:root {
    --bg:              #0e0e12;
    --surface:         #18181f;
    --surface-2:       #212129;
    --border:          #2e2e3a;
    --text:            #f0f0f4;
    --text-muted:      #7a7a90;
    --accent:          #c8f135;
    --accent-hover:    #b5d92d;
    --accent-text:     #0d0d10;
    --danger:          #ff4d4d;
    --danger-hover:    #e63e3e;
    --blue:            #5b8df0;
    --blue-hover:      #4a7de0;
    --muted-btn:       #2e2e3a;
    --muted-btn-hover: #383848;
    --muted-btn-text:  #b0b0c8;
    --shadow-card:     0 2px 16px rgba(0,0,0,0.35);
}

[data-theme="light"] {
    --bg:              #f4f5f7;
    --surface:         #ffffff;
    --surface-2:       #f9fafb;
    --border:          #e5e7eb;
    --text:            #111827;
    --text-muted:      #6b7280;
    --accent:          #16a34a;
    --accent-hover:    #15803d;
    --accent-text:     #ffffff;
    --danger:          #dc2626;
    --danger-hover:    #b91c1c;
    --blue:            #2563eb;
    --blue-hover:      #1d4ed8;
    --muted-btn:       #e5e7eb;
    --muted-btn-hover: #d1d5db;
    --muted-btn-text:  #374151;
    --shadow-card:     0 2px 16px rgba(0,0,0,0.08);
}

/* ============================================================
   Reset & Base
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    line-height: 1.5;
}

p { color: var(--text-muted); margin: 0 0 0.5rem; }

/* ============================================================
   Body Variants
   ============================================================ */

body.page-scrollable {
    padding: 40px 20px;
    align-items: flex-start;
}

body.page-landing {
    padding: 0;
    flex-direction: column;
    align-items: stretch;
    min-height: 100vh;
}

body.page-about {
    padding: 40px 20px;
    align-items: flex-start;
}

body.page-dashboard {
    padding: 40px 20px;
    align-items: flex-start;
}

body.page-admin {
    display: block;
    padding: 40px 20px;
}

body.page-admin .container {
    margin: 0 auto;
    overflow-x: hidden;
}

/* ============================================================
   Container
   ============================================================ */

.container {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 32px;
    border-radius: 14px;
    width: 100%;
    max-width: 420px;
    min-width: 0;
    box-shadow: var(--shadow-card);
}

.container--sm { max-width: 340px; }
.container--md { max-width: 520px; }
.container--lg { max-width: 860px; }

.container--flush {
    padding-left: 0;
    padding-right: 0;
}

.container--flush .page-header,
.container--flush .pagination {
    padding-left: 32px;
    padding-right: 32px;
}

.container--flush .table-wrap {
    border-left: none;
    border-right: none;
    border-radius: 0;
    margin-bottom: 0;
}

/* ============================================================
   Utilities
   ============================================================ */

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

/* ============================================================
   Typography
   ============================================================ */

h1 {
    text-align: center;
    margin: 0 0 24px;
    color: var(--text);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

h2 {
    color: var(--text);
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0 0 12px;
}

.error-h1  { font-size: 3.5rem; margin: 0; font-weight: 800; letter-spacing: -0.04em; }
.text-danger  { color: var(--danger); }
.text-warning { color: #f59e0b; }

/* ============================================================
   Forms
   ============================================================ */

label {
    display: block;
    margin-top: 16px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--text-muted);
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 10px 14px;
    margin-top: 6px;
    border-radius: 8px;
    border: 1.5px solid var(--border);
    background: var(--surface-2);
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text);
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
    appearance: none;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}

textarea { resize: vertical; min-height: 88px; }

/* ============================================================
   Actions Row
   ============================================================ */

.actions {
    margin-top: 24px;
    display: flex;
    gap: 10px;
}

.actions > * { flex: 1; }
.actions > form { flex: 1; margin: 0; padding: 0; }
.actions > form > .btn { width: 100%; display: block; }

/* ============================================================
   Buttons
   ============================================================ */

.btn {
    display: inline-block;
    padding: 11px 18px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    font-family: inherit;
    color: var(--accent-text);
    transition: opacity 0.15s, transform 0.1s, box-shadow 0.15s;
    letter-spacing: 0.01em;
}

.btn:active { transform: scale(0.97); }

.btn-primary  { background: var(--accent); color: var(--accent-text); }
.btn-primary:hover  { opacity: 0.88; }

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

.btn-cancel { background: var(--muted-btn); color: var(--muted-btn-text); }
.btn-cancel:hover { background: var(--muted-btn-hover); }

.btn-back { background: var(--muted-btn); color: var(--muted-btn-text); }
.btn-back:hover { background: var(--muted-btn-hover); }

.btn-create { background: var(--accent); color: var(--accent-text); }
.btn-create:hover { opacity: 0.88; }

.btn-edit { background: var(--blue); color: #fff; }
.btn-edit:hover { background: var(--blue-hover); }

.btn-delete { background: var(--danger); color: #fff; }
.btn-delete:hover { background: var(--danger-hover); }

.btn-outline {
    display: inline-block;
    padding: 10px 22px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    border: 1.5px solid var(--border);
    color: var(--text-muted);
    background: transparent;
    transition: border-color 0.15s, color 0.15s;
    font-size: 0.875rem;
    font-family: inherit;
}
.btn-outline:hover { border-color: var(--text-muted); color: var(--text); }

/* Home page dashboard nav */
.btn-nav {
    display: block;
    background: var(--blue);
    color: #fff;
    padding: 12px 16px;
    margin: 8px 0;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: opacity 0.15s;
    width: 100%;
    border: none;
    cursor: pointer;
    font-family: inherit;
    text-align: center;
    text-decoration: none;
}
.btn-nav:hover { opacity: 0.88; }
.btn-nav.logout { background: var(--danger); }

form.btn-form { margin: 0; padding: 0; }

/* Landing CTA */
.btn-cta-primary {
    display: inline-block;
    padding: 14px 32px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    background: var(--accent);
    color: var(--accent-text);
    transition: opacity 0.15s;
    letter-spacing: 0.01em;
}
.btn-cta-primary:hover { opacity: 0.88; }

.btn-cta-ghost {
    display: inline-block;
    padding: 14px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--text-muted);
    transition: color 0.15s;
}
.btn-cta-ghost:hover { color: var(--text); }

.btn-cta-outline {
    display: inline-block;
    padding: 14px 32px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    background: transparent;
    color: var(--accent);
    border: 2px solid var(--accent);
    transition: background 0.15s, color 0.15s;
}
.btn-cta-outline:hover { background: var(--accent); color: var(--accent-text); }

/* Landing nav CTA */
.btn-nav-cta {
    display: inline-block;
    background: var(--accent);
    color: var(--accent-text);
    border-radius: 7px;
    padding: 8px 18px;
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    transition: opacity 0.15s;
}
.btn-nav-cta:hover { opacity: 0.88; }

/* Dashboard ghost button */
.btn-ghost-sm {
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
    text-decoration: none;
}
.btn-ghost-sm:hover { color: var(--text); background: var(--surface-2); }

/* ============================================================
   Message Boxes
   ============================================================ */

.message-box {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-weight: 600;
    font-size: 0.875rem;
    text-align: center;
}

.message-box.error,
.error-box {
    background: color-mix(in srgb, var(--danger) 12%, transparent);
    color: var(--danger);
    border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent);
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-weight: 600;
    font-size: 0.875rem;
    text-align: center;
}

.message-box.success {
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    color: var(--accent);
    border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}

.info-box {
    background: color-mix(in srgb, var(--blue) 12%, transparent);
    color: var(--blue);
    border: 1px solid color-mix(in srgb, var(--blue) 30%, transparent);
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 0.875rem;
    text-align: center;
    font-weight: 600;
}

/* ============================================================
   Links
   ============================================================ */

.links { margin-top: 20px; text-align: center; }
.links a { color: var(--blue); text-decoration: none; font-weight: 600; font-size: 0.875rem; }
.links a:hover { text-decoration: underline; }
.links p { color: var(--text-muted); font-size: 0.875rem; }

/* ============================================================
   No Data
   ============================================================ */

.no-data {
    text-align: center;
    padding: 28px 16px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-muted);
    background: var(--surface-2);
    border: 1.5px dashed var(--border);
    border-radius: 10px;
    margin-bottom: 8px;
}

/* ============================================================
   Badges
   ============================================================ */

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.badge-global   { background: color-mix(in srgb, var(--blue) 15%, transparent); color: var(--blue); }
.badge-personal { background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); }
.badge-active   { background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent); }
.badge-inactive { background: color-mix(in srgb, var(--danger) 15%, transparent); color: var(--danger); }

/* ============================================================
   Clickable Card (list views)
   ============================================================ */

.card-item {
    all: unset;
    display: block;
    width: 100%;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    box-sizing: border-box;
    transition: border-color 0.15s, transform 0.15s, background 0.15s;
}
.card-item:hover {
    border-color: var(--accent);
    background: var(--surface);
    transform: translateY(-1px);
}
.card-item h3 { margin: 0 0 6px; color: var(--text); font-size: 0.95rem; font-weight: 600; }
.card-item p  { margin: 2px 0; color: var(--text-muted); font-size: 0.85rem; }

.card-form { margin-bottom: 8px; }

/* ============================================================
   Static Info Card (workout details exercises)
   ============================================================ */

.exercise {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 10px;
}
.exercise h3 { margin: 0 0 6px; color: var(--text); font-size: 0.95rem; font-weight: 600; }
.exercise p  { margin: 4px 0; color: var(--text-muted); font-size: 0.875rem; }

/* ============================================================
   Exercise / Workout Builder
   ============================================================ */

.exercise-list {
    margin-top: 8px;
    max-height: 260px;
    overflow-y: auto;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    background: var(--surface-2);
}
.exercise-item { margin-bottom: 14px; }
.exercise-item:last-child { margin-bottom: 0; }
.exercise-details { margin-left: 24px; margin-top: 8px; display: flex; gap: 12px; flex-wrap: wrap; }
.exercise-details label { font-weight: 500; font-size: 0.85rem; text-transform: none; letter-spacing: 0; color: var(--text-muted); }
.exercise-details input[type="number"] { width: 64px; }

/* ============================================================
   Detail Pages
   ============================================================ */

.description { text-align: center; color: var(--text-muted); margin-bottom: 20px; font-size: 0.9rem; }

.muscle-group { font-size: 0.72rem; font-weight: 700; color: var(--text-muted); margin-top: 6px; text-transform: uppercase; letter-spacing: 0.06em; }

.workout-count { margin-bottom: 14px; font-weight: 600; color: var(--text-muted); font-size: 0.875rem; }

.info {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 20px;
}
.info p { margin: 10px 0; color: var(--text); font-size: 0.9rem; }
.info p:first-child { margin-top: 0; }
.info p:last-child  { margin-bottom: 0; }

.label { font-weight: 600; color: var(--text); }

.workout-item {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 8px;
    transition: background 0.15s;
}
.workout-item:hover { background: var(--surface); }
.workout-item a { text-decoration: none; font-weight: 600; color: var(--blue); }

/* ============================================================
   Profile
   ============================================================ */

.profile-info { margin-top: 20px; }
.profile-info div {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.profile-info div:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.profile-info .label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); font-weight: 700; }
.profile-info .value { color: var(--text); font-weight: 500; font-size: 0.95rem; }

/* ============================================================
   Theme Toggle (injected by theme.js)
   ============================================================ */

.theme-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    cursor: pointer;
    font-size: 17px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    box-shadow: 0 2px 12px rgba(0,0,0,0.3);
    transition: background 0.15s, border-color 0.15s;
    font-family: inherit;
}
.theme-toggle:hover { background: var(--surface-2); }

/* ============================================================
   Landing Page
   ============================================================ */

.site-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 32px;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
    position: sticky;
    top: 0;
    z-index: 100;
}

.brand {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--accent);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.15s;
}
.nav-link:hover { color: var(--text); }

.hero {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 100px 24px 80px;
    min-height: calc(100vh - 61px);
}

.hero-content { max-width: 640px; }

.hero h1 {
    font-size: 4.5rem;
    font-weight: 800;
    color: var(--text);
    margin: 0 0 20px;
    letter-spacing: -0.055em;
    line-height: 1.0;
    text-align: center;
}

.hero-content > p {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin: 0 0 44px;
    line-height: 1.75;
}

.cta-group {
    display: flex;
    gap: 6px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.features-section {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 80px 24px;
}

.features-section-label {
    text-align: center;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 40px;
}

.features {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

.feature-card {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 28px 24px;
    flex: 1;
    min-width: 200px;
    max-width: 260px;
    text-align: left;
    transition: border-color 0.15s, transform 0.15s;
}
.feature-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.feature-icon { font-size: 1.4rem; margin-bottom: 14px; display: block; }
.feature-card h3 { margin: 0 0 8px; color: var(--text); font-size: 0.95rem; font-weight: 700; }
.feature-card p  { margin: 0; color: var(--text-muted); font-size: 0.85rem; line-height: 1.65; }

.site-footer {
    text-align: center;
    padding: 24px;
    border-top: 1px solid var(--border);
    background: var(--bg);
}
.site-footer a { color: var(--text-muted); text-decoration: none; font-size: 0.85rem; font-weight: 500; transition: color 0.15s; }
.site-footer a:hover { color: var(--text); }

/* ============================================================
   Home Dashboard
   ============================================================ */

.dashboard {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
}

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

.dashboard-header h1 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text);
    margin: 0;
    letter-spacing: -0.04em;
    text-align: left;
}

.primary-action-card {
    display: flex;
    align-items: center;
    gap: 18px;
    background: var(--accent);
    border-radius: 14px;
    padding: 22px 24px;
    text-decoration: none;
    margin-bottom: 14px;
    transition: opacity 0.15s, transform 0.1s;
}
.primary-action-card:hover { opacity: 0.9; transform: translateY(-1px); }

.primary-action-icon {
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent-text);
    opacity: 1;
    line-height: 1;
    flex-shrink: 0;
}

.primary-action-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.primary-action-text strong {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent-text);
    display: block;
}
.primary-action-text span {
    font-size: 0.85rem;
    color: var(--accent-text);
    opacity: 0.7;
}

.action-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 22px 16px;
    text-decoration: none;
    transition: border-color 0.15s, background 0.15s, transform 0.1s;
    min-height: 100px;
}
.action-card:hover { border-color: var(--accent); background: var(--surface-2); transform: translateY(-1px); }

.action-icon { font-size: 1.5rem; line-height: 1; }

.action-label { font-size: 0.85rem; font-weight: 600; color: var(--text); }

.stat-card { cursor: default; }

.stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--accent);
    letter-spacing: -0.03em;
    line-height: 1;
}

.top-list {
    align-items: flex-start;
    cursor: default;
}

.top-list ol {
    margin: 8px 0 0;
    padding-left: 18px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    width: 100%;
}

.top-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text);
    font-weight: 500;
}

.top-list .count {
    font-weight: 700;
    color: var(--accent);
    font-size: 0.8rem;
    flex-shrink: 0;
    margin-left: 8px;
}

.util-links {
    display: flex;
    justify-content: center;
    gap: 24px;
}
.util-links a { color: var(--text-muted); text-decoration: none; font-size: 0.8rem; font-weight: 500; transition: color 0.15s; }
.util-links a:hover { color: var(--text); }

/* ============================================================
   About Page
   ============================================================ */

.about-container {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 44px;
    border-radius: 14px;
    max-width: 640px;
    width: 100%;
    box-shadow: var(--shadow-card);
}
.about-container h1 {
    font-size: 1.9rem;
    margin: 0 0 6px;
    color: var(--text);
    text-align: left;
    font-weight: 800;
    letter-spacing: -0.035em;
}
.about-container h1 span { color: var(--accent); }
.about-container .tagline { color: var(--text-muted); font-size: 0.9rem; margin: 0 0 32px; display: block; }
.about-container h2 {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    margin: 28px 0 8px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.about-container p { color: var(--text-muted); line-height: 1.75; margin: 0 0 12px; font-size: 0.9rem; }

.divider { border: none; border-top: 1px solid var(--border); margin: 28px 0; }
.credit { font-size: 0.85rem; color: var(--text-muted); margin: 0; }
.credit strong { color: var(--text); }

/* ============================================================
   Focus Accessibility
   ============================================================ */

a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    border-color: var(--accent);
}

/* ============================================================
   Admin Users
   ============================================================ */

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

.page-header h1 { margin: 0; }

.page-header-sub {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.table-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow-x: auto;
    margin-bottom: 20px;
}

.data-table {
    width: 100%;
    min-width: 620px;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.data-table thead tr {
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
}

.data-table th {
    padding: 11px 16px;
    text-align: left;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.data-table td {
    padding: 12px 16px;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.data-table tbody tr:last-child td { border-bottom: none; }

.data-table tbody tr:hover { background: var(--surface-2); }

.cell-muted { color: var(--text-muted) !important; font-size: 0.8rem; }

.user-name {
    font-weight: 600;
    color: var(--text);
    margin-right: 6px;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 24px;
}

.pagination-btn {
    padding: 7px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    transition: border-color 0.15s, background 0.15s;
}

.pagination-btn:hover { border-color: var(--accent); background: var(--surface-2); }

.pagination-btn--disabled {
    color: var(--text-muted);
    cursor: default;
    pointer-events: none;
}

.pagination-pages {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pagination-page {
    min-width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    border: 1px solid transparent;
    transition: border-color 0.15s, background 0.15s;
}

.pagination-page:hover { border-color: var(--border); background: var(--surface-2); }

.pagination-page--active {
    background: var(--accent);
    color: var(--accent-text);
    border-color: var(--accent);
    cursor: default;
    pointer-events: none;
}

.pagination-ellipsis {
    min-width: 34px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ============================================================
   Feedback Widget
   ============================================================ */

.feedback-btn {
    position: fixed;
    bottom: 24px;
    left: 24px;
    background: var(--accent);
    color: var(--accent-text);
    border: none;
    border-radius: 20px;
    padding: 10px 18px;
    font-size: 0.85rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0,0,0,0.25);
    z-index: 1000;
    transition: opacity 0.15s, transform 0.1s;
}

.feedback-btn:hover { opacity: 0.9; transform: translateY(-1px); }

.feedback-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1001;
    align-items: center;
    justify-content: center;
}

.feedback-modal-overlay.active { display: flex; }

.feedback-modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    width: 100%;
    max-width: 440px;
    margin: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.feedback-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text);
}

.feedback-close {
    background: none;
    border: none;
    font-size: 1.3rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    padding: 0 2px;
    font-family: inherit;
}

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

.feedback-form {
    padding: 16px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.feedback-form textarea {
    width: 100%;
    resize: vertical;
    min-height: 110px;
    box-sizing: border-box;
}

.feedback-form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.feedback-status { font-size: 0.82rem; }
.feedback-status--success { color: var(--accent); }
.feedback-status--error   { color: var(--danger); }

/* Admin feedback table */
.row-unacked td:first-child { border-left: 3px solid var(--accent); }
.row-acked { opacity: 0.5; }

.btn-ack {
    font-size: 0.75rem;
    font-weight: 700;
    font-family: inherit;
    padding: 5px 10px;
    border-radius: 6px;
    border: 1px solid var(--accent);
    color: var(--accent);
    background: transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}

.btn-ack:hover { background: var(--accent); color: var(--accent-text); }

.btn-ack--done {
    border-color: var(--border);
    color: var(--text-muted);
}

.btn-ack--done:hover { background: var(--surface-2); color: var(--text); }

/* ============================================================
   Mobile
   ============================================================ */

@media (max-width: 480px) {
    body { padding: 12px; }
    body.page-scrollable,
    body.page-about,
    body.page-dashboard,
    body.page-admin { padding: 24px 14px; }

    .container { padding: 24px 18px; border-radius: 12px; }
    .about-container { padding: 28px 20px; }

    h1 { font-size: 1.25rem; }
    .dashboard-header h1 { font-size: 1.6rem; }

    .actions { flex-direction: column; }
    .actions > *, .actions > form { flex: none; width: 100%; }
}

@media (max-width: 640px) {
    .site-nav { padding: 14px 20px; }

    .hero { padding: 60px 20px 48px; min-height: auto; padding-top: 80px; }
    .hero h1 { font-size: 2.6rem; }

    .features-section { padding: 56px 16px; }
    .features { flex-direction: column; align-items: center; }
    .feature-card { max-width: 100%; width: 100%; }

    .cta-group { flex-direction: column; align-items: center; width: 100%; }
    .btn-cta-primary,
    .btn-cta-ghost { width: 100%; max-width: 320px; text-align: center; }

    .action-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
}

/* ============================================================
   Session Logging
   ============================================================ */

.exercise-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.exercise--completed {
    opacity: 0.55;
}

.set-row {
    display: flex;
    align-items: flex-end;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.set-row:last-of-type {
    border-bottom: none;
}

.set-number {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    min-width: 44px;
    padding-bottom: 10px;
}

.set-inputs {
    display: flex;
    gap: 12px;
    flex: 1;
    flex-wrap: wrap;
}

.set-field {
    flex: 1;
    min-width: 80px;
}

.set-field input {
    margin-top: 6px;
}
}
