/* Root colours */
:root {
    --color-bg-page: #f7fafc;
    --color-text-body: #0f172a;
    --color-text-heading: #0b1f3b;

    --color-header-bg: #0b1f3b;      /* header + footer background */
    --color-header-text: #ffffff;    /* header + footer text */

    --color-social-bg: #ffffff;      /* social icon background */
    --color-social-text: #0b1f3b;    /* social icon text */

    --color-accent: #b6f400;
    --color-link: #1f6de8;
}


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

html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
}

/* Smooth scrolling for anchor links on the page */
html {
    scroll-behavior: smooth;
}

/* Typography */
body {
    font-family: "Open Sans", system-ui, -apple-system, BlinkMacSystemFont,
        "Segoe UI", sans-serif;
    background-color: var(--color-bg-page);
    color: var(--color-text-body);
    line-height: 1.6;
}

h1,
h2,
h3 {
    font-family: "Montserrat", system-ui, -apple-system, BlinkMacSystemFont,
        "Segoe UI", sans-serif;
    color: var(--color-text-heading);
    margin-top: 0;
}

/* Header/Nav section: default header stays solid elsewhere */
.site-header {
    background-color: var(--color-header-bg);
    color: var(--color-header-text);
    position: relative; /* keep header above hero */
    z-index: 1000;      /* ensure dropdown sits over hero */
}

.site-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-main {
    flex: 1;
}

/* Nav bar layout: full width so brand left, links right */
.main-nav {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 1rem 3rem;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    position: relative; /* anchor the dropdown to the nav */
}

.nav-brand a {
    color: var(--color-header-text);
    font-weight: 600;
    font-size: 1.25rem;
    text-decoration: none;
    margin-left: 0;
    padding-left: 0;
}

/* Nav links sit inside a wrapper so we can collapse it later */
.nav-menu {
    margin-left: auto;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 1.25rem;
    margin: 0;
    padding: 0;
}

.nav-links a {
    color: var(--color-header-text);
    text-decoration: none;
    font-size: 0.95rem;
}

.nav-links a:hover,
.nav-links a:focus {
    text-decoration: underline;
}

/* --- Nav: login dropdown --- */

.nav-item-has-submenu {
    position: relative;
}

/* Turn the Login text into a button */
.nav-link-toggle {
    background: none;
    border: none;
    color: var(--color-header-text);
    font: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0;
}

/* little arrow next to "Login" */
.nav-link-caret {
    display: none; /* hide caret */
}

/* Hidden by default */
.nav-submenu {
    position: absolute;
    left: 0;
    top: 100%;
    margin-top: 0;
    padding-top: 0.35rem;
    list-style: none;
    padding: 0.35rem 0;
    min-width: 180px;
    background-color: #0b1f3b;
    border-radius: 0.5rem;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-4px);
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 20;
}

/* Visible when parent has .is-open (toggled by JS) */
.nav-item-has-submenu.is-open .nav-submenu {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

/* Also show on hover or keyboard focus */
.nav-item-has-submenu:hover .nav-submenu,
.nav-item-has-submenu:focus-within .nav-submenu,
.nav-submenu:hover {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

/* Links inside the dropdown */
.nav-submenu a {
    display: block;
    padding: 0.4rem 0.9rem;
    font-size: 0.9rem;
    color: #ffffff;
    text-decoration: none;
    white-space: nowrap;
}

.nav-submenu a:hover,
.nav-submenu a:focus {
    background-color: rgba(255, 255, 255, 0.08);
}

/* Make logout button look like a nav link */
.site-nav-link--button {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font: inherit;
    color: inherit;
    cursor: pointer;
}

/* Burger toggle button (hidden on desktop, shown on smaller screens) */
.nav-toggle {
    display: none;               /* hidden on desktop */
    width: 44px;                 /* easy tap size */
    height: 44px;
    border: 0;
    background: transparent;
    cursor: pointer;
    margin-left: auto;           /* push toggle to the right */
    align-items: center;
    justify-content: center;
    flex-direction: column;      /* stack the 3 bars vertically */
    gap: 6px;
}

/* Each bar is one line of the burger icon */
.nav-toggle__bar {
    display: block;
    width: 26px;
    height: 2px;
    background: #ffffff;
    border-radius: 2px;
    opacity: 0.95;
}


/* Hero section */
.home-hero {
    padding: 6rem 1.5rem 4rem; /* room under overlay header */
    color: #ffffff;

    /* Dark overlay with hero image */
    background:
        linear-gradient(rgba(11, 31, 59, 0.65), rgba(11, 31, 59, 0.65)),
        url("../images/hero-image-man-ropes.jpg");
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
}

.home-hero-inner {
    max-width: 1200px;
    margin: 0 auto;
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.home-hero-text h1 {
    font-size: 2.4rem;
    margin-bottom: 0.75rem;
    color: #ffffff;
}

.hero-subtitle {
    max-width: 38rem;
    margin: 0 auto 1.8rem;
    opacity: 0.95;
}

/* Footer area */
.site-footer {
    background-color: var(--color-header-bg);
    color: var(--color-header-text);
    padding: 0.75rem 1.5rem;
    font-size: 0.85rem;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.footer-copy {
    margin: 0;
}

.footer-links,
.footer-social {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 0;
    padding: 0;
}

.footer-links a {
    color: var(--color-header-text);
    text-decoration: none;
}

/* Social icons */
.footer-social a {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: var(--color-social-bg);
    color: var(--color-social-text);
    text-decoration: none;
    font-size: 0.8rem;
}

.footer-links a:hover,
.footer-links a:focus,
.footer-social a:hover,
.footer-social a:focus {
    text-decoration: underline;
}

/* Footer (card-style layout for new footer-shell markup) */
.site-footer .footer-shell {
    max-width: 1200px;
    margin: 0 auto;
}

.site-footer .footer-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
    margin-top: 1.25rem;
}

.site-footer .footer-card {
    background: var(--color-header-bg);
    border: none;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: none;
}

.site-footer .footer-title {
    margin: 0 0 1rem;
    font-weight: 700;
    color: #ffffff;
}

.site-footer .footer-list {
    display: grid;
    gap: 0.85rem;
}

.site-footer .footer-item {
    margin: 0;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.92);
}

.site-footer .footer-item__label {
    display: block;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.65);
    margin-bottom: 0.25rem;
}

.site-footer .footer-help {
    margin: 0.25rem 0 0;
    color: rgba(255, 255, 255, 0.75);
}

.site-footer .footer-links-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.75rem;
}

.site-footer .footer-link {
    color: rgba(255, 255, 255, 0.92);
    text-decoration: none;
}

.site-footer .footer-link:hover,
.site-footer .footer-link:focus {
    text-decoration: underline;
}

/* Bottom row (copyright + socials) */
.site-footer .footer-bottom {
    margin-top: 1.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Ensure the new social links keep the icon button look */
.site-footer .footer-social__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 999px;
    background-color: var(--color-social-bg);
    color: var(--color-social-text);
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.site-footer .footer-social__link:hover,
.site-footer .footer-social__link:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(182, 244, 0, 0.25);
    text-decoration: none;
}

.site-footer .footer-social__link i {
    font-size: 1rem;
    line-height: 1;
}

.site-footer .footer-card-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    border: 0;
    margin: 0.9rem 0 1rem;
}

/* Title divider spacing for footer sections */
.site-footer .footer-card-divider--title {
    margin-top: 0.5rem;
    margin-bottom: 0.85rem;
}

.site-footer .footer-cta {
    margin-top: 0.35rem;
}

/* Tidy spacing when CTA follows quick links */
.site-footer .footer-links-list + .footer-item .footer-cta {
    margin-top: 0.6rem;
}

/* Footer card enhancements */
.site-footer .footer-card {
    background: var(--color-header-bg);
    border: none;
    box-shadow: none;
}

.site-footer .footer-title {
    font-size: 1.05rem;
    letter-spacing: 0.01em;
}

.site-footer .footer-list {
    gap: 1rem;
}

.site-footer .footer-item__row {
    display: flex;
    gap: 0.65rem;
    align-items: flex-start;
}

.site-footer .footer-icon {
    width: 18px;
    height: 18px;
    color: rgba(255, 255, 255, 0.9);
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.site-footer .footer-item__label {
    font-size: 0.82rem;
    letter-spacing: 0.08em;
}

.site-footer .footer-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.site-footer .footer-links-list li {
    line-height: 1.4;
}

.site-footer .footer-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.4rem;
}

.site-footer .footer-bottom {
    align-items: center;
}

.site-footer .footer-social__link {
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

/* Primary button */
.btn-primary,
.btn-primary:visited {
    display: inline-block;
    padding: 0.75rem 1.75rem;
    border-radius: 999px;
    background-color: var(--color-accent);
    color: #0b1f3b;
    font-family: "Montserrat", system-ui, -apple-system, BlinkMacSystemFont,
        "Segoe UI", sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    border: none;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-primary:hover,
.btn-primary:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

/* Secondary button (used for non-primary actions like "See more") */
.btn-secondary,
.btn-secondary:visited {
    display: inline-block;
    padding: 0.75rem 1.75rem;
    border-radius: 999px;
    background-color: var(--color-link);
    color: #ffffff;
    font-family: "Montserrat", system-ui, -apple-system, BlinkMacSystemFont,
        "Segoe UI", sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    border: none;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
    transition: transform 0.15s ease, box-shadow 0.15s ease,
        background-color 0.15s ease;
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
    transform: translateY(-1px);
    background-color: #1a5fc9; /* slightly darker than --color-link */
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.22);
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

/* Dashboard: ensure primary buttons use the brand blue */
.client-dashboard .btn.btn-primary {
    background: var(--color-link);
    border-color: var(--color-link);
    color: #ffffff;
}

.client-dashboard .btn.btn-primary:hover,
.client-dashboard .btn.btn-primary:focus {
    background: #155ac4;
    border-color: #155ac4;
    color: #ffffff;
}

/* Smaller button used on cards */
.btn-secondary--sm {
    padding: 0.6rem 1.6rem;
    font-size: 0.9rem;
}

/* Client body metrics: keep stacked cards separated */
.client-body-metrics-page .dashboard-card + .dashboard-card {
    margin-top: 1rem;
}

/* Workout log: Session details submit button (blue, page-scoped) */
.workout-log-form .btn-primary {
    background: #1f6de8;
    border-color: #1f6de8;
    color: #ffffff;
}

.workout-log-form .btn-primary:hover,
.workout-log-form .btn-primary:focus {
    background: #1859bf;
    border-color: #1859bf;
    color: #ffffff;
}

.workout-log-form .btn-primary:focus-visible {
    outline: 2px solid #1f6de8;
    outline-offset: 2px;
}

/* Body metrics tables: keep cells from wrapping awkwardly */
.checkins-table th,
.checkins-table td,
.key-metrics-table th,
.key-metrics-table td {
    white-space: nowrap;
}

/* Allow horizontal scroll in table wrappers */
.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Danger button for destructive owner actions */
.btn-danger,
.btn-danger:visited {
    display: inline-block;
    padding: 0.65rem 1.35rem;
    border-radius: 10px;
    background-color: #dc2626;
    color: #ffffff;
    font-weight: 600;
    text-decoration: none;
    border: none;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.2);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-danger:hover,
.btn-danger:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.25);
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

/* Message box for clearer query detail body text */
.message-box {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.85rem 1rem;
    margin-top: 0.35rem;
    overflow-wrap: anywhere;
}

/* Align save + back link on one row with spacing */
.assign-actions-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Extra spacing on back link in actions row */
.assign-back-link {
    margin-left: 0.5rem;
}

/* Message block wrapper for tighter heading spacing */
.query-message-block {
    margin-top: 1.1rem;
}

.query-message-title {
    margin: 0 0 0.35rem 0;
}

/* Page subtitle meta (client overview) */
.page-header-row {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-top: 0.5rem;
    margin-bottom: 0.75rem;
}

.page-header-row__action {
    flex: 0 0 auto;
}

.panel {
    background: var(--color-bg-card, #ffffff);
    border: 1px solid var(--color-border, #e6edf5);
    border-radius: 14px;
    padding: 0.9rem 1rem;
    box-shadow: 0 10px 24px rgba(9, 30, 66, 0.06);
}

.page-meta {
    margin: 0;
    min-width: 280px;
}

.page-meta__primary {
    margin: 0;
    font-weight: 700;
}

.page-meta__emphasis {
    font-weight: 800;
}

.page-meta__secondary {
    margin: 0.35rem 0 0;
    color: var(--color-text-muted, #6b7a90);
    font-size: 0.95rem;
}

.dashboard-page-subtitle {
    margin-top: 0.25rem;
    display: grid;
    gap: 0.25rem;
    color: var(--color-text-muted, #6b7a90);
}

.dashboard-page-subtitle * {
    color: inherit;
}

.muted-text {
    color: var(--color-text-muted, #4c5f76);
}

.page-meta__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.page-meta__action {
    flex: 0 0 auto;
}

/* Consultation action row alignment */
.consultation-actions {
    margin-top: 1.25rem; /* add breathing room above the action row */
    padding-top: 0.5rem; /* keep buttons away from the divider above */
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Trainer consultation detail: CTA button styling (scoped). */
.consultation-detail__cta {
    margin-top: 1rem;
    background-color: var(--color-secondary, var(--color-link, #1f6de8));
    border-color: var(--color-secondary, var(--color-link, #1f6de8));
    color: #ffffff;
}

.consultation-detail__cta:hover,
.consultation-detail__cta:focus,
.consultation-detail__cta:focus-visible {
    background-color: var(
        --color-secondary-hover,
        var(--color-link-hover, #1a5fc9)
    );
    border-color: var(
        --color-secondary-hover,
        var(--color-link-hover, #1a5fc9)
    );
    color: #ffffff;
}

.consultation-detail__cta:focus,
.consultation-detail__cta:focus-visible {
    outline: 2px solid rgba(31, 109, 232, 0.35);
    outline-offset: 2px;
}

/* Assign-to-trainer label spacing */
.consultation-label {
    margin-top: 0.75rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

/* Coaching section */
.home-programs {
    background-color: var(--color-bg-page);
    padding: 4rem 1.5rem 4.5rem;
    color: var(--color-text-body);
}

.home-programs-inner {
    max-width: 1320px;
    margin: 0 auto;
}

.home-programs-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.home-programs-header h2 {
    font-family: "Montserrat", system-ui, -apple-system, BlinkMacSystemFont,
        "Segoe UI", sans-serif;
    font-size: 2.1rem;
    color: var(--color-text-heading);
    margin: 0 0 0.75rem;
}

.home-programs-header p {
    max-width: 640px;
    margin: 0 auto;
}

/* Query filters: align status + assigned on one row */
.table-filter--row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    align-items: end;
    margin-bottom: 1.25rem;
}

.table-filter--row .filter-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

/* Programs grid */
.home-programs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: 1.75rem;
}

/* Program cards & background image */
.program-card {
    position: relative;
    border-radius: 0.75rem;
    overflow: hidden;
    min-height: 320px;
    color: #ffffff;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: stretch;
}

/* Inner content to rest above overlay */
.program-card-inner {
    position: relative;
    padding: 2.25rem 2rem 3rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 320px;
}

/* Create space above button for top content area */
.program-card-content {
    margin-bottom: 1.5rem;
}

/* Bottom button area */
.program-card-buttons {
    display: flex;
    justify-content: center;
}

/* Make buttons for cards slightly smaller */
.btn-primary--sm {
    padding: 0.6rem 1.6rem;
    font-size: 0.9rem;
}

/* Card typography */
.program-card h3 {
    font-family: "Montserrat", system-ui, -apple-system, BlinkMacSystemFont,
        "Segoe UI", sans-serif;
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0 0 0.75rem;
    color: #ffffff;
}

.program-card p {
    margin: 0;
    font-size: 0.96rem;
}

/* Card hover state */
.program-card:hover,
.program-card:focus-within {
    transform: translateY(-4px);
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

/* Background images for each coaching option */
.program-card--personal {
    background-image:
        linear-gradient(rgba(11, 31, 59, 0.65), rgba(11, 31, 59, 0.65)),
        url("../images/personal-training.jpg");
}

.program-card--small-group {
    background-image:
        linear-gradient(rgba(11, 31, 59, 0.65), rgba(11, 31, 59, 0.65)),
        url("../images/small-group-training.jpg");
}

.program-card--large-group {
    background-image:
        linear-gradient(rgba(11, 31, 59, 0.65), rgba(11, 31, 59, 0.65)),
        url("../images/group-training.jpg");
}

.program-card--online {
    background-image:
        linear-gradient(rgba(11, 31, 59, 0.65), rgba(11, 31, 59, 0.65)),
        url("../images/online-coaching.jpg");
}

/* Program details modal pattern */

/* Full-screen with dark overlay */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(11, 31, 59, 0.85);
    backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 40;
}

/* Modal panel */
.program-modal {
    position: fixed;
    inset: 3rem 1.25rem auto;
    max-width: 960px;
    margin: 0 auto;
    background-color: var(--color-bg-page);
    border-radius: 1rem;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.55);
    opacity: 0;
    transform: translateY(12px) scale(0.98);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 50;
}

/* Layout inside modal */
.program-modal-inner {
    display: flex;
    min-height: 320px;
}

/* Left visual panel - will add program-card classes using JS */
.program-modal-visual {
    flex: 0 0 40%;
    background-color: var(--color-header-bg);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
}

/* Reusing same gradient as the cards */
.program-modal-visual::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        140deg,
        rgba(11, 31, 59, 0.7),
        rgba(11, 31, 59, 0.18)
    );
}

/* Right content panel */
.program-modal-content {
    position: relative;
    flex: 1;
    padding: 2.25rem 2.25rem 2rem;
    display: flex;
    flex-direction: column;
}

/* Close button */
.program-modal-close {
    position: absolute;
    top: 1rem;
    right: 1.25rem;
    border: none;
    background: transparent;
    color: var(--color-text-heading);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

/* Title & copy */
.program-modal-title {
    font-family: "Montserrat", system-ui, -apple-system, BlinkMacSystemFont,
        "Segoe UI", sans-serif;
    font-size: 1.6rem;
    margin: 0 0 0.75rem;
    color: var(--color-text-heading);
}

.program-modal-intro {
    margin: 0 0 1rem;
}

.program-modal-list {
    margin: 0 0 1.75rem;
    padding-left: 1.2rem;
}

/* Buttons row */
.program-modal-buttons {
    margin-top: auto;
}

/* Visible state - will use JS to toggle the class */
.modal-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

.program-modal.is-open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* -----------------------------------------------------
   Consultation page
------------------------------------------------------ */

.consultation-page {
    background-color: var(--color-bg-page);
    padding: 3.5rem 1.5rem 4.5rem;
}

/* Keep the form centred on the page */
.consultation-inner,
.consultation-page .page-section-inner {
    max-width: 1100px;
    margin: 0 auto;
}

/* Page header */
.consultation-header,
.consultation-page .page-section-header {
    max-width: 640px;
    margin: 0 auto 2.5rem;
    text-align: left;
}

.consultation-header h1,
.consultation-page .page-section-header h1 {
    font-size: 2.1rem;
    margin: 0 0 0.5rem;
    color: var(--color-text-heading);
}

.consultation-header p,
.consultation-page .page-section-header p {
    margin: 0;
}

/* Main form container */
.consultation-form {
    background-color: #ffffff;
    border-radius: 1rem;
    padding: 2.5rem 2.25rem 1.2rem;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.15);
}

/* Sections inside the form (visual separators) */
.consultation-section + .consultation-section {
    margin-top: 3.5rem;
    padding-top: 2.75rem;
    border-top: 1px solid rgba(15, 23, 42, 0.12);
}

/* Step header: Step 1 / Contact details etc. */
.consultation-section-heading {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

/* Step pill (Step 1 / Step 2 / Step 3) */
.consultation-step-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 4.2rem;
    padding: 0.18rem 0.85rem 0.12rem;
    border-radius: 999px;
    background-color: rgba(182, 244, 0, 0.9);
    color: #0b1f3b;
    font-size: 0.8rem;
    line-height: 1;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 0.25rem; /* when stacked above the heading */
}

/* Title text next to the step pill */
.consultation-section-title {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
    margin: 0 0 1rem;
}

.consultation-section-heading h2 {
    font-family: "Montserrat", system-ui, -apple-system, BlinkMacSystemFont,
        "Segoe UI", sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-text-heading);
}

/* Grid layout for two-column sections */
.consultation-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin-top: 0.5rem;
}

.consultation-column {
    flex: 1 1 260px;
}

/* Generic form field styling */
.form-field {
    margin-bottom: 1rem;
}

.form-field label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
    color: var(--color-text-heading);
}

.form-field label span[aria-hidden="true"] {
    color: #e02d2d; /* red asterisk for required fields */
}

.field-optional {
    font-weight: 400;
    font-size: 0.8rem;
    opacity: 0.75;
}

/* Inputs, selects, textarea */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 0.55rem 0.7rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(15, 23, 42, 0.15);
    font: inherit;
    line-height: 1.4;
    background-color: #ffffff;
}

input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--color-accent);
    outline-offset: 1px;
    border-color: var(--color-accent);
}

textarea {
    resize: vertical;
    min-height: 2.5rem;
}

/* Checkbox fields */
.form-field--checkbox label {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 400;
}

.form-field--checkbox input[type="checkbox"] {
    margin-top: 0.18rem;
}

/* Submit button row */
.consultation-actions {
    margin-top: 0;
}

.consultation-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
}

/* Screen-reader-only text (used for legends etc.) */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* Site message styling */
.site-messages {
    max-width: 1100px;
    margin: 1rem auto;
    padding: 0 1.5rem;
}

.site-message {
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.site-message--success {
    background-color: #ecfdf3;
    color: #166534;
}

.site-message--error {
    background-color: #fef2f2;
    color: #b91c1c;
}

.site-message--warning {
    background-color: #fffbeb;
    color: #92400e;
}

.site-message--info {
    background-color: #eff6ff;
    color: #1d4ed8;
}

.form-error-summary {
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
    background-color: #fef2f2;
    color: #b91c1c;
    font-size: 0.9rem;
}

/* ---- Shared dashboard layout ---- */

.dashboard-layout {
    background-color: #f7fafc;
    padding: 2.5rem 1.5rem 3.5rem;
}

.dashboard-shell {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 2rem;
}

.dashboard-mobilebar {
    display: flex; /* show portal top bar on all screen sizes */
    align-items: center;
    justify-content: space-between;
    background: #0b1f3b;
    color: #ffffff;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12); /* subtler shadow */
    margin-bottom: 1rem; /* breathing room before the grid below */
    width: 100%; /* span layout width */
}

.dashboard-mobilebar__brand {
    color: #ffffff;
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
}

.dashboard-mobilebar__actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dashboard-mobilebar__logout {
    color: #ffffff;
    text-decoration: none;
    font-size: 0.95rem;
    background: transparent;
    border: 0;
    padding: 0;
    font: inherit;
    cursor: pointer;
}

.dashboard-mobilebar__logout:hover,
.dashboard-mobilebar__logout:focus {
    text-decoration: underline;
}

.dashboard-mobilebar__actions form {
    margin: 0;
}

.dashboard-mobilebar__toggle {
    background: #0b1f3b;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 0.5rem;
    padding: 0.35rem 0.6rem;
    min-width: 44px;
    min-height: 44px;
    font-size: 1.2rem;
    cursor: pointer;
    display: none; /* hide burger on large screens */
}

.dashboard-overlay {
    display: none;
}

/* Sidebar */
.dashboard-sidebar {
    background-color: #ffffff;
    border-radius: 1rem;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
    padding: 1.75rem 1.5rem;
}

.dashboard-sidebar__title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0b1f3b;
    margin: 0 0 1.5rem;
}

.dashboard-sidebar__nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.dashboard-sidebar__nav li + li {
    margin-top: 0.4rem;
}

.dashboard-sidebar__nav a {
    display: block;
    padding: 0.5rem 0.75rem;
    border-radius: 0.6rem;
    font-size: 0.95rem;
    color: #0f172a;
    text-decoration: none;
}

.dashboard-sidebar__nav a:hover {
    background-color: #edf2ff;
}

.dashboard-sidebar__nav a.is-active {
    background-color: #0b1f3b;
    color: #ffffff;
}

/* Main area */
.dashboard-main {
    background-color: #ffffff;
    border-radius: 1rem;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
    padding: 2rem 2rem 2.5rem;
}

.dashboard-main__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.dashboard-main__eyebrow {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    margin: 0 0 0.25rem;
}

.dashboard-main__title {
    font-size: 1.7rem;
    font-weight: 700;
    color: #0b1f3b;
    margin: 0;
}

.dashboard-main__content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Initial card and table styling reused across dashboards */
.dashboard-card {
    border-radius: 1rem;
    border: 1px solid #e2e8f0;
    padding: 1.25rem 1.5rem;
    background-color: #f8fafc;
}

.dashboard-card__title {
    font-size: 1rem;
    font-weight: 600;
    color: #0b1f3b;
    margin: 0 0 0.5rem;
}

.dashboard-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.dashboard-table th,
.dashboard-table td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid #e2e8f0;
}

.portal-link {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.portal-link .form-control {
    flex: 1;
    min-width: 220px;
}

.portal-link .btn-secondary {
    white-space: nowrap;
}

.dashboard-table th {
    text-align: left;
    font-weight: 600;
    color: #475569;
}

.dashboard-table tbody tr:hover {
    background-color: #f8fafc;
}

/* Overview tables: column helpers (owner + trainer dashboards) */
.overview-consultations .col-email,
.overview-consultations .col-goal,
.overview-classes .col-preferred-date {
    /* Visible by default on larger screens */
}

.overview-classes .col-coaching-option {
    /* Keep tidy on wide screens */
    white-space: nowrap;
}

/* Table scroll wrapper for small screens */
.table-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 0.75rem; /* match card rounding */
}

/* Prevent table columns from collapsing too much */
.table-scroll .dashboard-table {
    min-width: 400px; /* forces horizontal scroll on small screens */
}

/* Portal link layout (desktop-safe) */
.portal-link-wrap {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.portal-link-input {
    width: 100%;
    min-width: 220px;
}

.portal-link-copy {
    white-space: nowrap;
}

/* Coaching labels: default to full text on desktop/tablet */
.coaching-label--short {
    display: none;
}

.coaching-label--full {
    display: inline;
}

/* Page context banner (e.g. “Client: …”) */
.page-context {
    margin: 1rem 0 1.25rem;
}

.page-context__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
}

.page-context__label {
    margin: 0;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
}

.page-context__value {
    margin: 0.2rem 0 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
}

.page-context__actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.client-overview-page .metrics-chart {
    width: 100%;
    overflow: hidden;
}

.client-overview-page .metrics-chart canvas {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Page context: ensure action buttons have readable text */
.page-context__actions .btn,
.page-context__actions button,
.page-context__actions a {
    color: #ffffff;
}

.page-context__actions .btn:hover,
.page-context__actions .btn:focus,
.page-context__actions .btn:active,
.page-context__actions button:hover,
.page-context__actions button:focus,
.page-context__actions button:active,
.page-context__actions a:hover,
.page-context__actions a:focus,
.page-context__actions a:active {
    color: #ffffff;
}

/* Filters: avoid overly wide selects on large screens */
.table-filter--row select,
.table-filter--row .form-select {
    width: 100%;
    max-width: 320px;
}

.is-highlight {
    outline: 3px solid #9fe40a;
    outline-offset: 3px;
    background: #f1ffd9;
    box-shadow: 0 0 0 6px rgba(159, 228, 10, 0.18);
    transition: outline 0.3s ease, background 0.3s ease,
        box-shadow 0.3s ease;
}

/* Workout log table layout */
.workout-table {
    display: grid;
    row-gap: 0.5rem;
}

.workout-row {
    display: grid;
    grid-template-columns: 2.2fr 0.9fr 1.2fr 1.2fr;
    align-items: center;
    column-gap: 0.75rem;
    padding: 0.4rem 0;
    border-top: 1px solid rgba(15, 23, 42, 0.06);
}

.workout-row--header {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    color: rgba(15, 23, 42, 0.7);
}

.workout-cell--exercise {
    font-size: 0.9rem;
}

.workout-cell--weight {
    font-size: 0.9rem;
    white-space: nowrap;
}

.workout-cell--weight .form-control {
    width: 100%;
}

.workout-cell--target {
    font-size: 0.9rem;
    color: rgba(15, 23, 42, 0.75);
}

.workout-row input[type="text"],
.workout-row input[type="number"] {
    width: 100%;
    box-sizing: border-box;
    padding: 0.6rem 0.75rem;
    border: 1px solid #d7dce5;
    border-radius: 0.6rem;
    font: inherit;
}

.metrics-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.metrics-form .form-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.metrics-form label {
    font-weight: 600;
    font-size: 0.9rem;
    color: #0b1f3b;
}

.metrics-form input,
.metrics-form textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 0.65rem 0.75rem;
    border: 1px solid #d7dce5;
    border-radius: 0.6rem;
    font: inherit;
}

.metrics-form textarea {
    resize: vertical;
    min-height: 120px;
}

/* Modal styling */
.session-modal-backdrop {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.55);
    z-index: 1000;
}

.session-modal-backdrop.is-hidden {
    display: none;
}

.session-modal-backdrop:not(.is-hidden) {
    display: flex;
}

/* Trainer login */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eef1f6;
    padding: 2rem;
}

.auth-card {
    width: min(520px, 100%);
    background: #ffffff;
    border-radius: 1rem;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
    padding: 2rem;
    text-align: center;
}

.auth-card__title {
    margin: 0 0 0.35rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.auth-card__subtitle {
    margin: 0 0 1.5rem;
    color: #475569;
    font-size: 0.95rem;
}

.auth-errors {
    background: #fef2f2;
    color: #b91c1c;
    border-radius: 0.6rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    text-align: left;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-field {
    text-align: left;
}

.auth-field label {
    display: block;
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.35rem;
    color: #0b1f3b;
}

.auth-field input {
    width: 100%;
    border-radius: 0.6rem;
    border: 1px solid #d7dce5;
    padding: 0.65rem 0.75rem;
    font: inherit;
}

.auth-field input:focus {
    outline: 2px solid #b6f400;
    border-color: #b6f400;
    box-shadow: 0 0 0 2px rgba(182, 244, 0, 0.35);
}

.auth-field .errorlist {
    margin: 0.35rem 0 0;
    padding: 0;
    list-style: none;
    color: #b91c1c;
    font-size: 0.9rem;
}

.auth-button {
    width: 100%;
    border: none;
    border-radius: 999px;
    background: #b6f400;
    color: #0b1f3b;
    font-weight: 700;
    padding: 0.85rem;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
}

.auth-button:hover,
.auth-button:focus-visible {
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.2);
}

.auth-footer {
    margin-top: 1.25rem;
    color: #475569;
    font-size: 0.95rem;
}

.auth-footer a {
    color: #1f6de8;
}

.session-modal {
    background: #ffffff;
    border-radius: 1rem;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.35);
    width: min(640px, 100% - 2rem);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.session-modal-header,
.session-modal-footer {
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.session-modal-header {
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.session-modal-footer {
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    gap: 0.75rem;
    justify-content: flex-end;
}

.session-modal-body {
    padding: 1.25rem 1.5rem 1.5rem;
    overflow-y: auto;
}

.session-modal-close {
    border: none;
    background: none;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    color: rgba(15, 23, 42, 0.6);
}

.session-modal-close:hover {
    color: rgba(15, 23, 42, 0.9);
}

.session-modal-form .form-field {
    margin-bottom: 1rem;
}

.session-modal-form label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.35rem;
}

.session-modal-form input[type="text"],
.session-modal-form select,
.session-modal-form textarea {
    width: 100%;
    border-radius: 0.5rem;
    border: 1px solid rgba(15, 23, 42, 0.15);
    padding: 0.5rem 0.65rem;
    font: inherit;
}

.session-modal-form textarea {
    resize: vertical;
}

/* Text link style for actions */
.text-link {
    color: #5b4b8a;
    text-decoration: underline;
}

/* Prevent background scroll when modal open */
.no-scroll {
    overflow: hidden;
}

/* Recent sessions table layout tweaks */
.recent-sessions-table {
    width: 100%;
    border-collapse: collapse;
}

.recent-sessions-table th,
.recent-sessions-table td {
    vertical-align: middle;
    padding: 0.6rem 0.75rem;
}

.recent-sessions-table th {
    text-align: left;
    font-weight: 600;
    color: #475569;
    white-space: nowrap;
}

.recent-sessions-table td {
    border-bottom: 1px solid #e2e8f0;
}

.recent-sessions-table .notes-cell {
    max-width: 240px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recent-sessions-table .date-cell,
.recent-sessions-table .status-cell,
.recent-sessions-table .action-cell {
    white-space: nowrap;
}

.recent-sessions-table .action-cell {
    text-align: right;
}

.recent-sessions-table .text-link {
    color: #5b4b8a;
    text-decoration: underline;
}

.pagination-nav {
    display: flex;
    justify-content: center;
    margin: 1rem 0;
    width: 100%;
}

.pagination {
    list-style: none;
    margin: 12px auto 0;
    padding: 0;
    display: inline-flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.pagination-item {
    display: inline-flex;
}

.pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    background: #fff;
    color: #0f172a;
    text-decoration: none;
    font-weight: 600;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.pagination-link:hover,
.pagination-link:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
    text-decoration: none;
}

.pagination-item.is-active .pagination-link {
    background: #4f46e5;
    color: #fff;
    border-color: #4f46e5;
}

/* Metrics charts */
.metrics-chart {
    height: 260px;
}

/* Status badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid transparent;
}

.badge--open {
    background: #fdecec;
    border-color: #eb5757;
    color: #b42318;
}

.badge--assigned {
    background: #eaf7ef;
    border-color: #34c759;
    color: #1f7a3a;
}

.badge--classes {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

.badge--pending {
    background: #eaf3ff;
    border-color: #2f80ed;
    color: #1f5fbf;
}

.badge--closed {
    background: #fdecec;
    border-color: #eb5757;
    color: #b42318;
}

/* Client dashboard stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 0.5rem;
}

.stat-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 14px;
}

.stat-label {
    margin: 0;
    font-size: 0.9rem;
    color: #475569;
}

.stat-value {
    margin: 4px 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
}

.stat-hint {
    margin: 0;
    font-size: 0.85rem;
    color: #4c5f76;
}

.stat-delta {
    margin: 2px 0 0 0;
    font-size: 0.85rem;
    font-weight: 600;
}

.stat-delta--up {
    color: #15803d;
}

.stat-delta--down {
    color: #b91c1c;
}

.stat-delta--neutral {
    color: #475569;
}

.stat-delta--na {
    color: #4c5f76;
}

.stat-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 4px 0;
}

.stat-icon {
    width: 20px;
    height: 20px;
    display: inline-flex;
    color: #0f172a;
}

.stat-icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.stat-card--sessions .stat-icon {
    color: #2563eb;
}

.stat-card--sleep .stat-icon {
    color: #7c3aed;
}

.stat-card--weight .stat-icon {
    color: #0891b2;
}

.stat-card--bench .stat-icon {
    color: #f97316;
}

.today-workout-footer {
    margin-top: 24px;
    padding-top: 16px;
    display: flex;
    justify-content: flex-start;
    border-top: 1px solid #e2e8f0;
    padding-left: 0.25rem;
}

.quick-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 0.5rem;
}

.quick-link-card {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #ffffff;
    text-decoration: none;
    color: #0f172a;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.quick-link-card:hover,
.quick-link-card:focus-visible {
    border-color: #cbd5e1;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
}

.quick-link-icon {
    width: 22px;
    height: 22px;
    display: inline-flex;
    color: #2563eb;
}

.quick-link-icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.quick-link-label {
    margin: 0;
    font-weight: 700;
    font-size: 0.95rem;
}

.quick-link-hint {
    margin: 0;
    font-size: 0.85rem;
    color: #4c5f76;
}

.this-week-footer {
    margin-top: 24px;
    padding-top: 16px;
    display: flex;
    justify-content: flex-start;
    border-top: 1px solid #e2e8f0;
    padding-left: 0.25rem;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.85rem;
    border: 1px solid transparent;
}

.status-pill--open {
    color: #0f5132;
    background: #d1e7dd;
    border-color: #badbcc;
}

.status-pill--waiting {
    color: #664d03;
    background: #fff3cd;
    border-color: #ffecb5;
}

.status-pill--closed {
    color: #842029;
    background: #f8d7da;
    border-color: #f5c2c7;
}

.support-thread {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 16px;
}

.support-message-row {
    display: flex;
    width: 100%;
}

.support-message-row--you {
    justify-content: flex-end;
}

.support-message-row--coach {
    justify-content: flex-start;
}

.support-message {
    max-width: 560px;
    width: 100%;
}

.support-message-meta {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin: 0 0 6px 0;
}

.support-message-bubble {
    padding: 14px 16px;
    border: 1px solid var(--color-border);
    border-radius: 16px;
    background: #ffffff;
    line-height: 1.5;
}

.support-thread-status {
    margin-top: 14px;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.form-actions--spaced {
    margin-top: 16px;
}

/* Add breathing room above programme day headings */
.programme-day {
    margin-top: 1.25rem;
}

.programme-day:first-child {
    margin-top: 0;
}

.programme-day__title {
    margin-top: 0.75rem;
}

/* Why Us section styles */
.why-us {
    padding: 72px 0;
    background: #f7f9fc;
}

.why-us__inner {
    width: 100%;
}

.why-us__header {
    text-align: center;
    margin-bottom: 28px;
}

.why-us__title {
    font-size: 2.15rem;
    margin: 0 0 10px 0;
}

.why-us__subtitle {
    margin: 0;
    color: #4a5568;
    max-width: 60ch;
    margin-inline: auto;
}

.why-us__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(220px, 1fr));
    gap: 22px;
    margin-top: 28px;
    align-items: stretch;
}

/* Why Us cards: cleaner shadow + structured layout */
.why-us__card {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e6edf5;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.06);
    padding: 20px 22px 18px; /* slightly tighter to balance card weight */
    transition: transform 160ms ease, box-shadow 160ms ease,
        border-color 160ms ease;
    display: flex;
    flex-direction: column;
    min-height: 300px;
    text-align: center;
    align-items: center;
}

.why-us__card:hover {
    transform: translateY(-3px);
    border-color: rgba(31, 109, 232, 0.22);
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.09);
}

/* Visible keyboard focus for accessibility (also matches hover lift) */
.why-us__card:focus-within {
    outline: 3px solid rgba(31, 109, 232, 0.35);
    outline-offset: 4px;
    border-color: rgba(31, 109, 232, 0.28);
    transform: translateY(-2px);
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.09);
}

.why-us__card-top {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    min-height: 150px; /* keep top content aligned across cards */
    flex-direction: column;
    gap: 10px;
}

.why-us__icon {
    width: 56px;
    height: 56px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: rgba(31, 109, 232, 0.12); /* soft blue tint so icons are secondary, not CTA */
    color: var(--color-link); /* blue icon to match secondary actions */
    flex: 0 0 auto;
}

.why-us__icon i {
    font-size: 20px;
}

.why-us__card-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: #0b1a2f;
    width: 100%;
}

.why-us__card-text {
    margin: 10px auto 0;
    color: #4a5568;
    line-height: 1.65;
    font-size: 0.95rem;
    max-width: 46ch;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

.why-us__divider {
    display: none;
}

.why-us__chips {
    display: none;
}

.why-us__icon-slot {
    margin-top: auto;
    padding: 20px 0 12px;
    display: flex;
    justify-content: center;
    border-top: 1px solid rgba(15, 23, 42, 0.09); /* slightly clearer divider above icons */
}

.why-us__icon-slot .why-us__icon {
    width: 68px;
    height: 68px;
    border-radius: 999px;
    background: rgba(31, 109, 232, 0.12); /* soft blue tint */
    display: grid;
    place-items: center;
    color: var(--color-link);
}

.why-us__icon-slot .why-us__icon i {
    font-size: 24px;
}

.section-divider {
    width: min(1120px, 92vw);
    margin: 48px auto 24px auto;
    height: 1px;
    background: linear-gradient(
        to right,
        rgba(0, 0, 0, 0),
        rgba(148, 163, 184, 0.55),
        rgba(0, 0, 0, 0)
    );
}

/* Client overview: section spacing */
.client-overview-sections {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.client-overview-sections > * {
    margin: 0;
}

/* Optional light separation between stacked cards */
.client-overview-sections > * + * {
    padding-top: 0.25rem;
}

.client-overview-sections .dashboard-card {
    margin-bottom: 0;
}

/* Page actions (light spacing for back links/buttons) */
.page-actions {
    margin: 0.75rem 0 1rem;
}

.page-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

/* Tailored programme: consistent input styling (all screen sizes) */
.tailored-programme table input[type="number"],
.tailored-programme table input[type="text"],
.tailored-programme table select {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 0.6rem;
    background-clip: padding-box;
    box-shadow: none;
    outline: none;
}

.tailored-programme table input[type="number"]:focus,
.tailored-programme table input[type="text"]:focus,
.tailored-programme table select:focus {
    border-color: #1f6de8;
    box-shadow: 0 0 0 3px rgba(31, 109, 232, 0.18);
}

/* =====================================================================
   MEDIA QUERIES
   Keep ALL responsive + accessibility queries in this single section.
   Order: (1) Preferences, (2) Desktop/large, (3) Tablet, (4) Mobile.
===================================================================== */

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .why-us__card {
        transition: none;
    }

    .why-us__card:hover {
        transform: none;
    }
}

/* Desktop / large screens (>= 993px) */
@media (min-width: 993px) {
    /* Client dashboard (desktop): align portal top bar with layout edges */
    .dashboard-layout.client-dashboard {
        padding-top: 0;
    }

    .dashboard-mobilebar {
        margin-top: 0;
        margin-left: -1rem;
        margin-right: -1rem;
        width: calc(100% + 2rem);
        border-radius: 0;
        box-shadow: none;
    }
}

/* Tablet and below (<= 992px) */
@media (max-width: 992px) {
    /* Tailored programme (owner + trainer) */
    .dashboard-layout.client-dashboard.tailored-programme {
        padding: 1rem 1rem 2rem;
    }

    .tailored-programme .dashboard-card--wide {
        width: 100%;
        max-width: 100%;
    }

    /* Exercise rows area: allow horizontal scroll instead of squashing */
    .tailored-programme .dashboard-card--wide table,
    .tailored-programme .dashboard-card--wide .table,
    .tailored-programme .dashboard-card--wide .table-scroll,
    .tailored-programme .dashboard-card--wide .dashboard-table-wrapper {
        display: block;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Keep controls tappable */
    .tailored-programme input[type="text"],
    .tailored-programme input[type="number"],
    .tailored-programme select {
        min-height: 44px;
    }

    /* Workout log - Session details: allow exercise text to wrap */
    .workout-row > * {
        min-width: 0; /* allow grid items to shrink so wrapping works */
    }

    .workout-cell--exercise {
        white-space: normal;
        overflow-wrap: anywhere;
        word-break: normal;
        line-height: 1.25;
    }

    /* Workout log: Recent sessions (mobile) - hide Date column */
    .recent-sessions-table th:nth-child(2),
    .recent-sessions-table td.date-cell {
        display: none;
    }

    /* Workout log - Session details: wrap Weight (kg) header on phones */
    .workout-row--header .workout-cell--weight {
        white-space: normal;
        line-height: 1.1;
        text-align: center;
    }

    /* Workout log - Session details: hide Target and tighten grid on phones */
    .workout-row--header .workout-cell--target {
        display: none;
    }

    .workout-row[data-ex-id] .workout-cell--target {
        display: none;
    }

    .workout-row {
        grid-template-columns: 1.4fr 0.9fr 0.9fr;
    }

    /* Navbar */
    .main-nav {
        padding: 0.9rem 1.25rem;
        flex-wrap: wrap; /* allow wrap so menu drops below */
    }

    .nav-toggle {
        display: inline-flex; /* show burger and keep it on the right */
        margin-left: auto;
    }

    .nav-menu {
        width: 100%;
        margin-top: 0.75rem;
        padding: 0.75rem;
        border-radius: 14px;
        background: rgba(11, 31, 59, 0.96);
        box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
        display: none;
    }

    .nav-menu.is-open {
        display: block;
    }

    .nav-links {
        flex-direction: column;
        align-items: stretch;
        gap: 0.25rem;
    }

    .nav-links a {
        display: block;
        width: 100%;
        text-align: left;
        padding: 0.75rem 0.9rem;
        border-radius: 10px;
    }

    .nav-links a:hover,
    .nav-links a:focus {
        background: rgba(255, 255, 255, 0.06);
        outline: none;
    }

    /* Owner/Trainer overview tables */
    .overview-consultations .col-email {
        display: none; /* reduce clutter on tablets */
    }

    /* Why Us */
    .why-us__grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Client dashboard: off-canvas menu (tablet and below) */
    .dashboard-layout.client-dashboard {
        padding: 1rem 1rem 2rem; /* slightly reduced top padding to seat the top bar */
    }

    .dashboard-layout.client-dashboard .dashboard-shell {
        grid-template-columns: 1fr;
        gap: 1rem;
        min-width: 0;
    }

    /* Client dashboard: prevent horizontal overflow */
    .dashboard-layout.client-dashboard,
    .dashboard-layout.client-dashboard .dashboard-shell,
    .dashboard-layout.client-dashboard .dashboard-main,
    .dashboard-layout.client-dashboard .dashboard-main__content,
    .dashboard-layout.client-dashboard .dashboard-card,
    .dashboard-layout.client-dashboard .dashboard-card--wide {
        max-width: 100%;
        overflow-x: hidden;
        box-sizing: border-box;
    }

    .dashboard-layout.client-dashboard .dashboard-shell > * {
        min-width: 0;
    }

    /* Ensure tables scroll inside their wrapper instead of widening the page */
    .dashboard-table-wrapper,
    .table-scroll {
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
    }

    /* Programme library: shrink log buttons on tablet */
    .programme-library .btn-secondary {
        padding: 0.55rem 0.9rem;
        font-size: 0.95rem;
        min-height: 44px;
    }

    /* Workout log - Session details: allow exercise text to wrap */
    .workout-row > * {
        min-width: 0; /* allow grid items to shrink so wrapping works */
    }

    .workout-cell--exercise {
        white-space: normal;
        overflow-wrap: anywhere;
        word-break: normal;
        line-height: 1.25;
    }

    .dashboard-layout.client-dashboard .dashboard-mobilebar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        background: #0b1f3b;
        color: #ffffff;
        padding: 0.75rem 1rem;
        border-radius: 0.75rem;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    }

    .dashboard-layout.client-dashboard .dashboard-mobilebar__brand {
        color: #ffffff;
        text-decoration: none;
        font-weight: 700;
        font-size: 1rem;
    }

    .dashboard-layout.client-dashboard .dashboard-mobilebar__actions {
        display: flex;
        align-items: center;
        gap: 0.75rem;
    }

    .dashboard-layout.client-dashboard .dashboard-mobilebar__logout {
        color: #ffffff;
        text-decoration: none;
        font-size: 0.95rem;
    }

    .dashboard-layout.client-dashboard .dashboard-mobilebar__toggle {
        background: #0b1f3b;
        color: #ffffff;
        border: 1px solid rgba(255, 255, 255, 0.4);
        border-radius: 0.5rem;
        padding: 0.35rem 0.6rem;
        min-width: 44px;
        min-height: 44px;
        font-size: 1.2rem;
        cursor: pointer;
        display: inline-flex; /* show burger only when sidebar is off-canvas */
        align-items: center;
        justify-content: center;
    }

    .dashboard-layout.client-dashboard .dashboard-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 260px;
        max-width: 80%;
        transform: translateX(-100%);
        transition: transform 0.2s ease, box-shadow 0.2s ease;
        z-index: 1100;
        overflow-y: auto;
        border-radius: 0;
        background-color: #ffffff;
    }

    .dashboard-layout.client-dashboard .dashboard-main {
        width: 100%;
    }

    .dashboard-layout.client-dashboard .dashboard-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.45);
        display: none;
        z-index: 1090;
    }

    body.dashboard-menu-open .dashboard-layout.client-dashboard .dashboard-sidebar {
        transform: translateX(0);
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
    }

    body.dashboard-menu-open .dashboard-layout.client-dashboard .dashboard-overlay {
        display: block;
    }

    body.dashboard-menu-open {
        overflow: hidden;
    }

    /* Clients page: tablet and below */
    .clients-table .col-email,
    .clients-table .col-last-requested {
        display: none;
    }

    .clients-table .col-action {
        white-space: nowrap;
    }

    .clients-table th,
    .clients-table td {
        padding: 0.55rem 0.7rem;
    }

    .portal-access-table .portal-link-wrap {
        flex-wrap: wrap;
        gap: 0.6rem;
    }

    .portal-access-table .portal-link-input {
        width: 100%;
        min-width: 0; /* allow shrinking on tablet */
    }

    .portal-access-table .portal-link-copy {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    /* Queries: TABLET layout (keep as a normal table, not stacked) */
    .queries-table .col-email {
        display: none;
    }

    /* Owner queries: hide Assigned on tablet and below */
    .owner-dashboard .queries-table .col-assigned,
    .queries-page.owner-queries .queries-table .col-assigned,
    .queries-page--owner .queries-table .col-assigned {
        display: none;
    }

    .queries-table .col-action {
        white-space: nowrap;
    }

    .queries-table th,
    .queries-table td {
        padding: 0.55rem 0.7rem;
    }

    /* Ensure table stays as table on tablet (prevents “mobile stacking” here) */
    .queries-table thead {
        display: table-header-group;
    }

    .queries-table tbody tr {
        display: table-row;
    }

    .queries-table td {
        display: table-cell;
    }

    .table-scroll {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Tailored programme (tablet layout fixes) */
    .tailored-programme .site-main,
    .tailored-programme .dashboard-main,
    .tailored-programme .dashboard-main__content,
    .tailored-programme .dashboard-layout,
    .tailored-programme .dashboard-shell {
        width: 100%;
        max-width: 100%;
    }

    .tailored-programme .dashboard-layout {
        margin-left: 0;
        margin-right: 0;
    }

    .tailored-programme .dashboard-card--wide {
        width: 100%;
        max-width: 100%;
    }

    /* If any inner container is limiting width, remove it on tablet */
    .tailored-programme .dashboard-card--wide .page-section-inner,
    .tailored-programme .dashboard-card--wide .card-body,
    .tailored-programme .dashboard-card--wide .dashboard-card__body {
        max-width: 100%;
    }

    /* Tailored programme: exercise name readability (tablet) */
    .tailored-programme table {
        table-layout: auto;
    }

    .tailored-programme th:first-child,
    .tailored-programme td:first-child {
        width: 42%;
        max-width: none;
    }

    /* Allow exercise names to wrap instead of truncating */
    .tailored-programme td:first-child,
    .tailored-programme td:first-child * {
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        line-height: 1.2;
        word-break: break-word;
    }

    /* Tailored programme: ensure inputs render with full borders in stacked layout */
    .tailored-programme table {
        border-collapse: separate;
        border-spacing: 0;
    }

    .tailored-programme table tbody tr,
    .tailored-programme table td {
        overflow: visible;
    }

    /* Tailored programme: use stacked layout for tablet and below */
    .tailored-programme table {
        width: 100%;
        min-width: 0;
    }

    .tailored-programme table thead {
        display: none;
    }

    .tailored-programme table tbody tr {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            "exercise exercise"
            "sets reps"
            "weight weight";
        gap: 0.6rem 0.75rem;
        padding: 0.85rem 0;
        border-bottom: 1px solid #e2e8f0;
    }

    .tailored-programme table td {
        border: 0;
        padding: 0;
        min-width: 0;
    }

    .tailored-programme table td:nth-child(1) { grid-area: exercise; }
    .tailored-programme table td:nth-child(2) { grid-area: sets; }
    .tailored-programme table td:nth-child(3) { grid-area: reps; }
    .tailored-programme table td:nth-child(4) { grid-area: weight; }

    /* Exercise name wraps */
    .tailored-programme table td:nth-child(1),
    .tailored-programme table td:nth-child(1) * {
        white-space: normal;
        word-break: break-word;
        line-height: 1.2;
    }

    /* Show labels above each cell if data-label is present */
    .tailored-programme table td[data-label]::before {
        content: attr(data-label);
        display: block;
        font-size: 0.8rem;
        font-weight: 700;
        color: #475569;
        margin-bottom: 0.25rem;
    }

    /* Inputs fill the available width */
    .tailored-programme table input[type="number"],
    .tailored-programme table input[type="text"],
    .tailored-programme table select {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        min-height: 44px;
        box-sizing: border-box;
    }

    /* Save button full width */
    .tailored-programme .btn,
    .tailored-programme button,
    .tailored-programme input[type="submit"] {
        width: 100%;
        max-width: 100%;
    }

    /* Workout log: hide Notes column on tablet and below */
    .recent-sessions-table .col-notes {
        display: none;
    }
    /* Fallback if class is missing */
    .recent-sessions-table th:nth-child(4),
    .recent-sessions-table td:nth-child(4) {
        display: none;
    }

    /* Footer */
    .site-footer .footer-grid {
        grid-template-columns: 1fr;
    }

    .site-footer .footer-card {
        padding: 1.25rem;
    }
}

/* Mobile (<= 576px) */
@media (max-width: 576px) {
    /* Home hero: shift the background focal point right so the athlete
       stays visible on small screens (desktop remains unchanged). */
    .home-hero {
        background-position: 70% center;
    }

    /* Tailored programme: fine-tune exercise text on phones */
    .tailored-programme td:first-child,
    .tailored-programme td:first-child * {
        font-size: 0.9rem;
    }

    /* Tailored programme (owner + trainer) */
    /* Stack header content neatly */
    .tailored-programme .dashboard-card--wide .card-header,
    .tailored-programme .dashboard-card--wide header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.6rem;
    }

    /* Workout log: keep Notes hidden on phones */
    .recent-sessions-table .col-notes {
        display: none;
    }
    /* Fallback if class is missing */
    .recent-sessions-table th:nth-child(4),
    .recent-sessions-table td:nth-child(4) {
        display: none;
    }

    /* Full-width controls on mobile */
    .tailored-programme input[type="text"],
    .tailored-programme input[type="number"],
    .tailored-programme select {
        width: 100%;
        max-width: 100%;
        padding: 0.65rem 0.75rem;
    }

    /* Programme library: shrink log buttons on phones */
    .programme-library .btn-secondary {
        padding: 0.5rem 0.8rem;
        font-size: 0.9rem;
        min-height: 44px;
        width: auto;
        max-width: 100%;
    }

    /* Workout log - Session details: keep wrap on phones */
    .workout-row > * {
        min-width: 0;
    }

    .workout-cell--exercise {
        white-space: normal;
        overflow-wrap: anywhere;
        word-break: normal;
        line-height: 1.25;
    }

    /* Save button full width for mobile */
    .tailored-programme .btn,
    .tailored-programme button,
    .tailored-programme input[type="submit"] {
        width: 100%;
        max-width: 100%;
    }

    /* Navbar */
    .main-nav {
        padding: 0.85rem 1.25rem;
    }

    /* Hero */
    .home-hero h1,
    .home-hero__title,
    .hero-title {
        font-size: clamp(1.7rem, 6vw, 2.15rem);
        line-height: 1.12;
        letter-spacing: -0.02em;
        margin-bottom: 0.75rem;
    }

    .home-hero p,
    .home-hero__subtitle,
    .hero-subtitle {
        font-size: 0.95rem;
        line-height: 1.45;
        max-width: 34ch;
        margin-left: auto;
        margin-right: auto;
    }

    /* Home page section headings */
    .home-section-title {
        font-size: clamp(1.35rem, 6vw, 1.7rem);
        line-height: 1.15;
        letter-spacing: -0.01em;
        max-width: 100%;
        text-align: center;
    }

    .home-section-lead {
        line-height: 1.5;
        margin-top: 0.35rem;
    }

    /* Why Us */
    .why-us {
        padding: 48px 0;
    }

    .why-us__title {
        font-size: 1.65rem;
    }

    .why-us__grid {
        grid-template-columns: 1fr;
    }

    /* Book a consultation form */
    .consultation-page .page-section-inner,
    .consultation-page .consultation-form {
        width: 100%;
        max-width: 100%;
        margin: 0;
    }

    .consultation-form input,
    .consultation-form select,
    .consultation-form textarea,
    .consultation-form .form-control,
    .consultation-form .form-select {
        width: 100%;
        max-width: 100%;
        min-height: 44px;
        padding: 0.65rem 0.75rem;
        border: 1px solid #cbd5e1;
    }

    .consultation-form .form-field {
        margin-bottom: 0.85rem;
    }

    .consultation-form input:focus,
    .consultation-form select:focus,
    .consultation-form textarea:focus,
    .consultation-form .form-control:focus,
    .consultation-form .form-select:focus {
        outline: 2px solid #1f6de8;
        outline-offset: 1px;
    }

    /* Coaching option modals */
    .coaching-modal .modal-dialog {
        width: 100%;
        max-width: 100%;
        height: 100%;
        margin: 0;
    }

    .coaching-modal .modal-content {
        height: 100%;
        border-radius: 0;
    }

    .coaching-modal .modal-body {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        max-height: calc(100vh - 5rem);
        padding: 1rem;
    }

    .coaching-modal .modal-media,
    .coaching-modal .program-modal-visual {
        display: none;
    }

    .coaching-modal .modal-close,
    .coaching-modal .program-modal-close {
        min-width: 44px;
        min-height: 44px;
        font-size: 1.5rem;
        line-height: 1;
    }

    /* Dashboards (shared) */
    .dashboard-layout {
        padding: 1.25rem 1rem 2rem;
    }

    .dashboard-shell {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .dashboard-mobilebar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        background: #0b1f3b;
        color: #ffffff;
        padding: 0.75rem 1rem;
        border-radius: 0.75rem;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    }

    .dashboard-mobilebar__brand {
        color: #ffffff;
        text-decoration: none;
        font-weight: 700;
        font-size: 1rem;
    }

    .dashboard-mobilebar__actions {
        display: flex;
        align-items: center;
        gap: 0.75rem;
    }

    .dashboard-mobilebar__logout {
        color: #ffffff;
        text-decoration: none;
        font-size: 0.95rem;
    }

    .dashboard-mobilebar__toggle {
        background: #0b1f3b;
        color: #ffffff;
        border: 1px solid rgba(255, 255, 255, 0.4);
        border-radius: 0.5rem;
        padding: 0.35rem 0.6rem;
        min-width: 44px;
        min-height: 44px;
        font-size: 1.2rem;
        cursor: pointer;
    }

    .dashboard-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 260px;
        max-width: 80%;
        transform: translateX(-100%);
        transition: transform 0.2s ease, box-shadow 0.2s ease;
        z-index: 1100;
        overflow-y: auto;
        border-radius: 0;
    }

    .dashboard-main {
        width: 100%;
    }

    .dashboard-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.45);
        display: none;
        z-index: 1090;
    }

    body.dashboard-menu-open .dashboard-sidebar {
        transform: translateX(0);
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
    }

    body.dashboard-menu-open .dashboard-overlay {
        display: block;
    }

    body.dashboard-menu-open {
        overflow: hidden;
    }

    /* Client overview tables: tablet adjustments */
    .client-overview-page .client-overview-table th,
    .client-overview-page .client-overview-table td {
        padding: 0.55rem 0.7rem;
        font-size: 0.9rem;
        word-break: break-word;
    }

    .client-overview-page .client-overview-table .col-action {
        white-space: nowrap;
    }

    .client-overview-page .dashboard-table-wrapper {
        overflow-x: auto;
    }

    .client-overview-page .metrics-chart {
        padding: 0.25rem 0;
    }

    /* Owner/Trainer overview tables */
    .overview-consultations .col-email,
    .overview-consultations .col-goal,
    .overview-consultations .col-submitted,
    .overview-classes .col-preferred-date,
    .overview-classes .col-submitted {
        display: none;
    }

    .overview-classes .col-coaching-option {
        white-space: normal;
        line-height: 1.25;
        max-width: 12rem;
    }

    .dashboard-table th,
    .dashboard-table td {
        font-size: 0.85rem;
        padding: 0.5rem 0.6rem;
    }

    /* Filters */
    .table-filter--row {
        grid-template-columns: 1fr;
    }

    .table-filter--row select,
    .table-filter--row .form-select {
        max-width: 100%;
    }

    /* =========================================================
       Owner + Trainer overview tables (mobile layout <= 576px)
       Force consistent alignment:
       Left: name + status
       Right: action (View) above coaching label
       ========================================================= */
    .overview-consultations .dashboard-table thead,
    .overview-classes .dashboard-table thead {
        display: none;
    }

    .overview-consultations .dashboard-table tbody tr,
    .overview-classes .dashboard-table tbody tr {
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "name action"
            "status coaching";
        column-gap: 0.75rem;
        row-gap: 0.35rem;
        padding: 0.75rem 0;
        border-bottom: 1px solid #e2e8f0;
    }

    .overview-consultations .dashboard-table td,
    .overview-classes .dashboard-table td {
        border: 0;
        padding: 0;
        vertical-align: top;
    }

    /* Map existing column classes into the grid */
    .overview-consultations .col-name,
    .overview-classes .col-name {
        grid-area: name;
        font-weight: 700;
    }

    .overview-consultations .col-status,
    .overview-classes .col-status {
        grid-area: status;
        align-self: start;
        justify-self: start;
    }

    .overview-consultations .col-coaching-option,
    .overview-classes .col-coaching-option {
        grid-area: coaching;
        justify-self: end;
        align-self: start;
        white-space: normal;
        line-height: 1.25;
        max-width: 12rem;
        text-align: right;
    }

    .overview-consultations .col-action,
    .overview-classes .col-action {
        grid-area: action;
        text-align: right;
        justify-self: end;
        align-self: start;
        white-space: nowrap;
    }

    /* Optional: prevent any forced horizontal scrolling on these overview tables */
    .overview-consultations .table-scroll .dashboard-table,
    .overview-classes .table-scroll .dashboard-table {
        min-width: 0;
    }

    /* Pills / badges: smaller on mobile to prevent layout overflow */
    .badge,
    .status-pill {
        padding: 2px 8px;
        font-size: 0.75rem;
        line-height: 1.15;
        white-space: nowrap;
        border-radius: 999px;
    }

    /* Coaching labels: show short on phones */
    .coaching-label--short {
        display: inline;
    }

    .coaching-label--full {
        display: none;
    }

    /* Client overview tables: mobile stacked layout */
    .client-overview-page .client-overview-table thead {
        display: none;
    }

    .client-overview-page .client-overview-table tbody tr {
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 0.35rem 1rem;
        padding: 0.75rem 0;
        border-bottom: 1px solid #e2e8f0;
    }

    .client-overview-page .client-overview-table td {
        border: 0;
        padding: 0;
        vertical-align: top;
        grid-column: 1;
    }

    .client-overview-page .client-overview-table .col-action {
        grid-column: 2;
        justify-self: end;
        white-space: nowrap;
    }

    /* Page context banner */
    .page-context__inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-context__actions {
        width: 100%;
    }

    .page-context__actions .btn,
    .page-context__actions button,
    .page-context__actions a {
        width: 100%;
    }

    /* Clients page: mobile stacked layout */
    .clients-table thead {
        display: none;
    }

    .clients-table tbody tr {
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 0.35rem 1rem;
        padding: 0.75rem 0;
        border-bottom: 1px solid #e2e8f0;
    }

    .clients-table td {
        padding: 0;
        border: 0;
        vertical-align: top;
    }

    .clients-table .col-name {
        grid-column: 1;
        font-weight: 700;
    }

    .clients-table .col-deal,
    .clients-table .col-coaching {
        grid-column: 1;
        color: #475569;
        font-size: 0.9rem;
    }

    .clients-table .col-action {
        grid-column: 2;
        justify-self: end;
        align-self: start;
        white-space: nowrap;
    }

    /* Portal access table: mobile stacking */
    .portal-access-table thead {
        display: none;
    }

    .portal-access-table tbody tr {
        display: block;
        padding: 0.85rem 0;
        border-bottom: 1px solid #e2e8f0;
    }

    .portal-access-table td {
        display: block;
        padding: 0;
        border: 0;
        margin: 0.2rem 0;
    }

    .portal-access-table .col-name {
        font-weight: 700;
    }

    .portal-access-table .col-portal {
        margin-top: 0.1rem;
    }

    .portal-link-wrap {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .portal-link-copy {
        width: 100%;
    }

    /* Programmes: active blocks table stacked on mobile */
    .active-blocks-table thead {
        display: none;
    }

    .active-blocks-table tbody tr {
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "programme phase"
            "status next";
        column-gap: 0.75rem;
        row-gap: 0.35rem;
        padding: 0.75rem 0;
        border-bottom: 1px solid #e2e8f0;
    }

    .active-blocks-table td {
        border: 0;
        padding: 0;
        vertical-align: top;
    }

    .active-blocks-table .col-programme {
        grid-area: programme;
        word-break: break-word;
    }

    .active-blocks-table .col-phase {
        grid-area: phase;
        text-align: right;
        white-space: nowrap;
    }

    .active-blocks-table .col-status {
        grid-area: status;
    }

    .active-blocks-table .col-next-action {
        grid-area: next;
        text-align: right;
        word-break: break-word;
    }

    /* Body metrics: hide Target column on tablet */
    .key-metrics-table .col-target {
        display: none;
    }

    /* Body metrics: hide Sleep column on tablet */
    .checkins-table .col-sleep {
        display: none;
    }

    /* Page header row */
    .page-header-row {
        flex-direction: column;
        align-items: stretch;
    }

    .page-header-row__action {
        margin-top: 0.5rem;
    }

    .page-meta__row {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-meta__action {
        margin-top: 0.5rem;
    }

    /* Support inbox: hide last updated on mobile */
    .support-table .col-last-updated {
        display: none;
    }

    /* Queries: filters stack on mobile */
    .queries-page .table-filter--row {
        grid-template-columns: 1fr;
    }

    /* Queries table: MOBILE stacked layout only */
    .queries-table thead {
        display: none;
    }

    .queries-table tbody tr {
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "status name"
            "submitted action";
        column-gap: 0.75rem;
        row-gap: 0.35rem;
        padding: 0.75rem 0;
        border-bottom: 1px solid #e2e8f0;
    }

    .queries-table td {
        padding: 0;
        border: 0;
        vertical-align: top;
    }

    .queries-table .col-status {
        grid-area: status;
        justify-self: start;
    }

    .queries-table .col-name {
        grid-area: name;
        justify-self: end;
        text-align: right;
        font-weight: 700;
    }

    .queries-table .col-submitted {
        grid-area: submitted;
        justify-self: start;
        color: #475569;
        font-size: 0.9rem;
    }

    .queries-table .col-action {
        grid-area: action;
        justify-self: end;
        text-align: right;
        white-space: nowrap;
    }

    /* Prevent forced horizontal scroll on stacked layout */
    .table-scroll .queries-table {
        min-width: 0;
    }

    /* Footer */
    .site-footer .footer-bottom {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .site-footer .footer-social {
        justify-content: center;
    }

    /* Body metrics: hide Waist and Sleep columns on mobile */
    .checkins-table .col-waist,
    .checkins-table .col-sleep {
        display: none;
    }

    /* Body metrics: hide Change and Target columns on mobile */
    .key-metrics-table .col-change,
    .key-metrics-table .col-target {
        display: none;
    }

    /* Allow key metrics headers to wrap on mobile */
    .metrics-table th {
        white-space: normal;
        line-height: 1.2;
    }
}



/* Trainer Queries: keep Status label above dropdown on all screen sizes */
.queries-page--trainer .table-filter--row {
    grid-template-columns: 1fr;
    justify-items: start;
}

.queries-page--trainer .table-filter--row .filter-field {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
    width: 100%;
}

.queries-page--trainer .table-filter--row .filter-field select,
.queries-page--trainer .table-filter--row .filter-field .form-select {
    width: 100%;
    max-width: 320px;
}


/* Support actions layout */
.support-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.support-actions .btn,
.support-actions button,
.support-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}


@media (max-width: 576px) {
    /* Support actions: stack buttons on small screens */
    .support-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .support-actions .btn,
    .support-actions button,
    .support-actions a {
        width: 100%;
    }
}

