/* Move Well Physiotherapy unified theme. */
:root {
    --brand: #63a71c;
    --brand-soft: #ddf4c5;
    --paper: #f5f4f2;
    --paper-alt: #eeefe9;
    --paper-strong: #ffffff;
    --ink: #111111;
    --color-headings: #363637;
    --muted: #4f514d;
    --line: #d8d9d3;
    --button-text: #f5f7f4;
    --nav-bg: rgba(255, 255, 255, 0.92);
    --shadow: rgba(17, 17, 17, 0.08);
    --color-mwp-green: var(--brand);
    --color-mwp-gray: #333333;
    --error-bg: #fde7ec;
    --error-text: #a51031;
    --error-border: #e62149;
    --success-bg: #eafbdc;
    --success-text: #3a7f16;
    --success-border: #6fdd37;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body,
body.landing-page,
body.app-page,
body.auth-page {
    margin: 0;
    min-height: 100vh;
    background: var(--paper);
    color: var(--ink);
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-weight: 400;
    line-height: 1.6;
}

body.landing-page.theme-dark,
body.app-page.theme-dark,
body.auth-page.theme-dark {
    --brand: #8bd53d;
    --brand-soft: #344226;
    --paper: #101010;
    --paper-alt: #171717;
    --paper-strong: #1a1a1a;
    --ink: #f5f5f2;
    --color-headings: #e6e6e6;
    --muted: #d6d6d6;
    --line: #343434;
    --button-text: #0a1d00;
    --nav-bg: rgba(17, 17, 17, 0.92);
    --shadow: rgba(0, 0, 0, 0.32);
    --error-bg: #4a1222;
    --error-text: #ff9ab0;
    --success-bg: #263d16;
    --success-text: #b9f58b;
}

.message.error {
    background: var(--error-bg);
    border-color: var(--error-border);
    color: var(--error-text);
}

.message.success {
    background: var(--success-bg);
    border-color: var(--success-border);
    color: var(--success-text);
}

body.landing-page *,
body.app-page *,
body.auth-page * {
    box-sizing: border-box;
}

h1,
.dashboard-heading h1,
.physiotherapist-dashboard .dashboard-heading h1,
.users-index-page h1,
.auth-card legend {
    font-family: "Bebas Neue", "Arial Narrow", sans-serif;
}

h2,
h3,
h4,
h5,
h6 {
    font-family: "Bebas Neue", "Arial Narrow", sans-serif;
    color: var(--color-headings);
}

.top-nav,
body.app-page .top-nav,
body.auth-page .top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 60;
    padding: 12px 20px 0;
}

.nav-shell,
body.app-page .nav-shell,
body.auth-page .nav-shell {
    max-width: 1200px;
    min-height: 54px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: var(--nav-bg);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 7px 12px;
    backdrop-filter: blur(12px);
    box-shadow: 0 6px 18px var(--shadow);
}

.brand-block {
    display: flex;
    align-items: center;
    color: var(--ink);
    font-weight: 700;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.brand-block .nav-link {
    font-weight: 800;
}

.brand-block .nav-link {
    padding-left: 0.65rem;
    padding-right: 0.65rem;
}

button.theme-toggle {
    width: 38px;
    height: 38px;
    line-height: 0;
}

.nav-links,
body.app-page .nav-links,
body.auth-page .nav-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex: 1;
}

.nav-link,
.nav-link:visited,
.nav-link:focus,
body.app-page .nav-link,
body.auth-page .nav-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0.48rem 0.65rem;
    border-radius: 999px;
    color: var(--ink);
    text-decoration: none;
    font-size: 0.88rem;
    line-height: 1.2;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.nav-link:hover,
.nav-link:focus,
body.app-page .nav-link:hover,
body.app-page .nav-link:focus,
body.auth-page .nav-link:hover,
body.auth-page .nav-link:focus,
.auth-card .button-outline:hover,
.auth-card .button-clear:hover {
    background: var(--brand-soft);
    color: var(--ink);
    transform: translateY(-1px);
}

.nav-icon,
.primary-btn svg,
.secondary-btn svg,
.staff-login svg,
.theme-toggle svg {
    width: 17px;
    height: 17px;
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}

.theme-toggle,
body.app-page .theme-toggle,
body.auth-page .theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--brand);
    font-size: 0;
    justify-content: center;
    line-height: 0;
    color: var(--button-text);
    cursor: pointer;
}

.theme-toggle svg {
    width: 18px;
    height: 18px;
}

.nav-action-primary,
.nav-action-primary:visited,
.nav-action-primary:focus {
    background: var(--brand);
    color: var(--button-text);
    font-weight: 700;
}

.nav-action-primary:hover,
.nav-action-primary:focus-visible {
    background: var(--ink);
    color: var(--paper-strong);
    transform: translateY(-1px);
}

body.app-page.theme-dark .nav-action-primary,
body.auth-page.theme-dark .nav-action-primary {
    color: #0a1d00;
}

body.app-page.theme-light .nav-action-primary,
body.auth-page.theme-light .nav-action-primary {
    color: #f5f7f4;
}

.nav-action-booking,
.nav-action-booking:visited,
.nav-action-booking:focus {
    background: var(--brand-soft);
    color: var(--ink);
    font-weight: 700;
}

.nav-action-booking:hover,
.nav-action-booking:focus-visible {
    background: var(--brand);
    color: var(--button-text);
    transform: translateY(-1px);
}

.nav-menu-toggle {
    display: none;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: transparent;
    color: var(--ink);
    cursor: pointer;
    font: inherit;
    font-size: 0.88rem;
    font-weight: 700;
    padding: 0.56rem 0.8rem;
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px 40px;
}

body.app-page main.main {
    max-width: 1200px;
    padding: 80px 24px 36px;
}

body.app-page main.main > .container {
    width: 100%;
    max-width: none;
    padding: 0;
}

body.app-page .content {
    background: var(--paper-strong);
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: 0 8px 24px var(--shadow);
}

body.app-page .content h1,
body.app-page .content h2,
body.app-page .content h3,
body.app-page .content h4,
body.app-page .content h5,
body.app-page .content h6,
body.app-page .content legend {
    color: var(--color-headings);
}

body.app-page .content a,
body.app-page .side-nav a,
body.app-page .content .pagination a {
    color: var(--brand);
}

body.app-page .content a:hover,
body.app-page .content a:focus,
body.app-page .side-nav a:hover,
body.app-page .side-nav a:focus,
body.app-page .content .pagination a:hover,
body.app-page .content .pagination a:focus {
    color: var(--ink);
}

body.app-page .content table {
    background: var(--paper-strong);
    color: var(--ink);
}

body.app-page .content th,
body.app-page .content td {
    border-bottom-color: var(--line);
}

body.app-page .content th {
    color: var(--ink);
}

body.app-page .content input,
body.app-page .content select,
body.app-page .content textarea {
    border-color: var(--line);
    background: var(--paper);
    color: var(--ink);
}

body.app-page.theme-dark .appointment-form input,
body.app-page.theme-dark .appointment-form select,
body.app-page.theme-dark .appointment-form textarea {
    background: var(--paper-strong);
    color: #f5f5f2;
}

body.app-page .content input::placeholder,
body.app-page .content textarea::placeholder {
    color: var(--muted);
}

body.app-page .content label {
    color: var(--muted);
}

body.app-page .content blockquote {
    border-left-color: var(--brand);
    color: var(--ink);
}

body.app-page .content hr,
body.app-page .side-nav {
    border-color: var(--line);
}

body.app-page .side-nav .heading {
    color: var(--color-headings);
}

body.app-page .content sub {
    color: var(--muted);
}

body.auth-page {
    display: flex;
    flex-direction: column;
}

body.auth-page main.main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 24px 36px;
}

body.auth-page .auth-layout-container {
    width: min(100%, 760px);
}

body.auth-page .container.login,
body.auth-page .container.register {
    width: min(100%, 760px);
    max-width: none;
}

body.auth-page .container.login .column-50,
body.auth-page .container.register .column-50 {
    width: 100%;
    margin-left: 0;
}

.auth-card,
body.auth-page .users.form.content,
.users-index-page,
.physiotherapist-panel {
    background: var(--paper-strong);
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: 0 8px 24px var(--shadow);
}

.auth-card {
    width: 100%;
    padding: 44px 52px;
}

body.auth-page .users.form.content {
    width: min(100%, 760px);
    margin: 0 auto;
    padding: 44px 52px;
}

.auth-card legend {
    margin-bottom: 24px;
    color: var(--color-headings);
    font-size: clamp(2.6rem, 7vw, 4.5rem);
    line-height: 0.92;
    letter-spacing: 0.03em;
}

.auth-card label,
.history-form-panel label {
    color: var(--muted);
    font-weight: 700;
}

.auth-card input,
.history-form-panel input,
.history-form-panel textarea {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--paper);
    color: var(--ink);
}

.auth-card button,
.auth-card .button,
.users-index-page .button {
    border: 0;
    border-radius: 999px;
    background: var(--brand);
    color: var(--button-text);
    font-weight: 700;
}

body.app-page.theme-dark .users-index-page .page-heading .button {
    color: #0a1d00;
    background: var(--brand);
}

.auth-card .button-clear {
    color: var(--button-text);
    /*background-color: var(--brand-soft);*/
}

body.app-page > footer,
body.auth-page > footer {
    width: min(100%, 1200px);
    margin: 0 auto;
    border-top: 1px solid var(--line);
    padding: 0 24px 16px;
    color: var(--muted);
}

body.app-page > footer p,
body.auth-page > footer p {
    margin: 0.7rem 0 0;
    font-size: 0.88rem;
}

.users-index-page,
.admin-index-page {
    padding: 38px;
}

.users-index-page .page-heading,
.admin-index-page .page-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 28px;
}

.users-index-page h1,
.admin-index-page h1 {
    margin: 0;
    color: var(--color-headings);
    font-size: clamp(3rem, 6vw, 5.5rem);
    line-height: 0.9;
    letter-spacing: 0.04em;
    font-weight: 400;
}

.users-index-page table,
.admin-index-page table,
.patient-table {
    margin-bottom: 0;
    background: var(--paper-strong);
    border-radius: 16px;
    overflow: hidden;
}

.users-index-page th,
.admin-index-page th,
.patient-table th {
    background: var(--brand-soft);
    color: var(--ink);
}

.users-index-page td,
.users-index-page th,
.admin-index-page td,
.admin-index-page th,
.patient-table td,
.patient-table th {
    border-bottom-color: var(--line);
}

.users-index-page .actions,
.admin-index-page .actions {
    white-space: nowrap;
}

.users-index-page .paginator,
.admin-index-page .paginator {
    margin-top: 28px;
    color: var(--muted);
}

.users-index-page .pagination a,
.admin-index-page .pagination a {
    color: var(--brand);
}

.admin-index-page .page-heading h1 {
    font-weight: 400;
}

.admin-index-page .button,
.admin-index-page .actions a,
.admin-index-page .actions button {
    border-radius: 999px;
    font-weight: 700;
}

.admin-index-page .button {
    background: var(--brand);
    border: 1px solid var(--brand);
    color: var(--button-text);
}

.admin-index-page .button:hover,
.admin-index-page .button:focus {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--paper-strong);
}

.admin-index-page td a {
    color: var(--brand);
    font-weight: 700;
}

.admin-index-page td a:hover,
.admin-index-page td a:focus {
    color: var(--ink);
}

.admin-index-page .actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.admin-index-page .actions a,
.admin-index-page .actions button {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--ink);
    font-size: 0.85rem;
    line-height: 1.2;
}

.admin-index-page .actions a:hover,
.admin-index-page .actions a:focus,
.admin-index-page .actions button:hover,
.admin-index-page .actions button:focus {
    border-color: var(--brand);
    background: var(--brand-soft);
    color: var(--ink);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.28rem 0.65rem;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.status-badge-success {
    background: var(--brand-soft);
    color: var(--brand);
}

.status-badge-pending {
    background: var(--paper-alt);
    color: var(--muted);
}

/* Landing page */
body.landing-page {
    font-size: 16px;
}

body.landing-page main {
    padding-top: 80px;
}

.hero {
    padding: 0px 0 24px;
}

.hero-inner {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 32px;
    align-items: center;
    background: var(--paper-strong);
    border: 1px solid var(--line);
    border-radius: 28px;
    padding: 52px;
    box-shadow: 0 8px 24px var(--shadow);
}

.eyebrow,
.section-heading p,
.dashboard-eyebrow {
    margin: 0 0 10px;
    color: var(--brand);
    font-size: 0.74rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-weight: 700;
}

h1 {
    margin: 0;
    color: var(--brand);
    font-size: clamp(4rem, 8vw, 8.5rem);
    line-height: 0.88;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-weight: 400;
}

.hero-copy {
    max-width: 620px;
    margin-top: 18px;
    color: var(--muted);
    font-size: 1.08rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 30px;
}

.primary-btn,
.secondary-btn,
.staff-login {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.94rem 1.35rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.primary-btn,
.primary-btn:visited,
.primary-btn:focus,
.staff-login,
.staff-login:visited,
.staff-login:focus {
    background: var(--brand);
    border: 1px solid transparent;
    color: var(--button-text);
}

.secondary-btn,
.secondary-btn:visited,
.secondary-btn:focus {
    background: transparent;
    border: 1px solid transparent;
    color: var(--ink);
}

.primary-btn:hover,
.secondary-btn:hover,
.staff-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px var(--shadow);
}

.hero-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 16px;
}

.hero-logo {
    display: block;
    width: min(100%, 220px);
    margin: 0 auto;
    height: auto;
}

.panel-card {
    width: 100%;
    background: var(--brand-soft);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 28px;
}

.label {
    display: inline-block;
    margin-bottom: 18px;
    color: var(--brand);
    font-size: 0.74rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-weight: 700;
}

.panel-card h3 {
    margin: 0;
    font-size: 2.1rem;
    line-height: 1.1;
}

.panel-card p,
.feature p {
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 1rem;
}

.metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    padding-top: 18px;
    margin-top: 18px;
    border-top: 1px solid var(--line);
}

.metric {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.metric strong {
    font-size: 1.35rem;
}

.metric span {
    color: var(--muted);
    font-size: 0.72rem;
    text-transform: uppercase;
}

.content-section {
    padding-top: 28px;
}

.content-block {
    background: var(--paper-strong);
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 52px 44px;
    box-shadow: 0 8px 24px var(--shadow);
}

.section-heading h2 {
    max-width: 600px;
    margin: 0;
    font-size: clamp(2rem, 4vw, 3.4rem);
    line-height: 1;
    font-weight: 700;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
    margin-top: 34px;
}

.feature {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 24px;
}

.number {
    color: var(--brand);
    font-family: "Bebas Neue", "Arial Narrow", sans-serif;
    font-size: 2.6rem;
    line-height: 1;
}

.feature h3 {
    margin: 14px 0 10px;
    font-size: 1.4rem;
}

.site-footer {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 24px 28px;
    font-size: 0.88rem;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-top: 1px solid var(--line);
    padding-top: 14px;
}

.footer-note {
    color: var(--muted);
    font-size: 0.82rem;
}

.history-back-link {
    margin-bottom: 20px;
}

/* Patient and physiotherapist dashboards */
.patient-dashboard {
    max-width: 1180px;
    margin: 0 auto;
    padding: 20px 0 48px;
}

.dashboard-heading {
    margin-bottom: 34px;
}

.dashboard-heading h1,
.physiotherapist-dashboard .dashboard-heading h1 {
    margin: 0;
    color: var(--color-headings);
    font-size: clamp(3rem, 7vw, 5.5rem);
    font-weight: 400;
    letter-spacing: 0.04em;
    line-height: 0.95;
    text-transform: uppercase;
}

.dashboard-heading > p:last-child {
    color: var(--muted);
    font-size: 1.1rem;
}

.dashboard-section {
    margin-bottom: 42px;
}

.appointment-list {
    display: grid;
    gap: 12px;
}

.appointment-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 18px;
    border-left: 4px solid var(--brand);
    background: var(--paper-strong);
    padding: 18px 20px;
}

.appointment-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
    margin-top: 8px;
}

.appointment-actions .dashboard-link {
    min-height: 38px;
    padding: 0.45rem 0.8rem;
    font-size: 0.9rem;
}

.dashboard-link-danger {
    border-color: #b33a3a;
    color: #b33a3a;
}

.dashboard-link-danger:hover,
.dashboard-link-danger:focus {
    background: #b33a3a;
    color: #fff;
}

.section-heading {
    border-bottom: 1px solid var(--line);
    margin-bottom: 20px;
    padding-bottom: 12px;
}

.section-heading h2 {
    margin: 0;
}

.appointment-empty,
.appointment-form,
.physiotherapist-empty {
    background: var(--paper-strong);
    border-left: 4px solid var(--brand);
    padding: 26px;
}

.appointment-empty h3 {
    margin: 0 0 6px;
}

.appointment-empty p,
.physiotherapist-empty p {
    color: var(--muted);
    margin: 0 0 20px;
}

.dashboard-button,
.dashboard-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0.65rem 1rem;
    border: 2px solid var(--brand);
    border-radius: 24px;
    color: var(--brand);
    font-weight: 700;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.dashboard-button {
    background: var(--brand);
    color: var(--button-text);
}

.dashboard-button:disabled,
.dashboard-button[disabled] {
    background: #b7d993;
    border-color: #b7d993;
    color: #1f2a18;
    opacity: 1;
    cursor: not-allowed;
}

.appointment-form .dashboard-button:disabled,
.appointment-form .dashboard-button[disabled] {
    background: var(--brand);
    border-color: var(--brand);
    color: var(--button-text);
    opacity: 0.25;
}

.dashboard-button:disabled:hover,
.dashboard-button[disabled]:hover {
    background: #b7d993;
    border-color: #b7d993;
    color: #1f2a18;
    transform: none;
}

.dashboard-button:hover,
.dashboard-link:hover,
.dashboard-button:focus,
.dashboard-link:focus {
    background: var(--brand);
    color: var(--button-text);
    transform: translateY(-1px);
}

.dashboard-link-primary,
.dashboard-button-primary {
    background: var(--brand);
    color: var(--button-text);
}

.nav-links .nav-action-booking {
    order: 98;
}

.nav-links .nav-action-primary {
    order: 99;
}

.appointment-form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.appointment-form-actions .dashboard-button,
.appointment-form-actions .dashboard-link {
    min-width: 170px;
}

.blogArticles.index.content .dashboard-link {
    margin-bottom: 18px;
}

.blogArticles.index.content h3 {
    clear: both;
}

.dashboard-links {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.appointment-booking {
    max-width: 760px;
    margin: 0 auto;
    padding: 20px 0 48px;
}

.appointment-form {
    border-radius: 16px;
}

.appointment-form fieldset {
    margin-bottom: 24px;
}

.time-slot-group > label {
    display: block;
    margin-bottom: 10px;
    font-weight: 700;
}

.time-slots {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.time-slot {
    display: block;
    margin: 0;
}

.time-slot input {
    position: absolute;
    opacity: 0;
}

.time-slot span {
    display: block;
    border: 1px solid var(--line);
    padding: 12px;
    text-align: center;
}

.time-slot input:checked + span {
    background: var(--brand);
    border-color: var(--brand);
    color: var(--button-text);
}

.time-slot input:disabled + span {
    background: var(--line);
    color: var(--muted);
    cursor: not-allowed;
    opacity: 0.6;
}

.time-slot input:focus-visible + span {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

.form-note,
.patient-count,
.patient-email {
    color: var(--muted);
}

.form-note {
    font-size: 0.9rem;
    margin: 12px 0 0;
}

.physiotherapist-dashboard {
    max-width: 1180px;
    margin: 0 auto;
}

.physiotherapist-panel {
    padding: 30px;
}

.dashboard-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--line);
    margin: -8px -8px 30px;
    padding: 0 8px 16px;
}

.dashboard-tab {
    display: inline-flex;
    gap: 8px;
    border: 0;
    background: transparent;
    border-radius: 999px;
    color: var(--muted);
    cursor: pointer;
    font: inherit;
    line-height: 1.4;
    padding: 0.65rem 1rem;
}

.dashboard-tab-active {
    background: var(--brand-soft);
    color: var(--ink);
    font-weight: 700;
}

.dashboard-tab:hover,
.dashboard-tab:focus-visible {
    background: var(--brand-soft);
    color: var(--ink);
    transform: translateY(-1px);
}

.dashboard-tab-panel[hidden] {
    display: none;
}

.panel-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.panel-heading h2 {
    margin: 0;
}

.patient-table-wrap {
    overflow-x: auto;
}

.patient-name {
    display: block;
    color: var(--brand);
    font-weight: 700;
    text-decoration: none;
}

.patient-email {
    display: block;
    font-size: 0.88rem;
    margin-top: 3px;
}

.patient-action {
    text-align: right;
    white-space: nowrap;
}

.physiotherapist-empty {
    background: var(--paper);
}

.physiotherapist-empty h3,
.physiotherapist-empty p {
    margin-top: 0;
}

.physiotherapist-empty p {
    margin-bottom: 0;
}

.patient-info-back {
    margin-bottom: 20px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--brand);
    font-weight: 700;
    text-decoration: none;
}

.patient-info-page .back-link,
.patient-info-page .dashboard-link,
.patient-info-page .dashboard-button,
.patient-info-page button {
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.patient-info-page .back-link:hover,
.patient-info-page .back-link:focus-visible {
    background: var(--brand-soft);
    color: var(--ink);
    transform: translateY(-1px);
}

.back-link::before {
    content: "";
    width: 8px;
    height: 8px;
    border-left: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
}

.patient-info-grid {
    display: grid;
    grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1.2fr);
    gap: 22px;
    margin-bottom: 22px;
}

.patient-details {
    display: grid;
    gap: 18px;
    margin: 0;
}

.patient-details div {
    border-bottom: 1px solid var(--line);
    padding-bottom: 12px;
}

.patient-details dt {
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.patient-details dd {
    margin: 0;
}

.history-list {
    display: grid;
    gap: 14px;
}

.history-entry {
    border-left: 3px solid var(--brand);
    background: var(--paper);
    padding: 16px 18px;
}

.history-entry p {
    margin: 10px 0 0;
    white-space: normal;
}

.history-entry-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
    color: var(--muted);
    font-size: 0.9rem;
}

.history-entry-meta strong {
    color: var(--ink);
}

.history-form-panel form {
    margin-bottom: 0;
}

/* Patient diary */
.diary-page {
    max-width: 1000px;
    margin: 0 auto;
    padding: 32px 0 64px;
}

.diary-section {
    margin-bottom: 42px;
}

.diary-form {
    display: grid;
    gap: 22px;
}

.required-fields-note {
    color: var(--muted);
    font-size: 0.85rem;
    margin: -4px 0 0;
}

.required-field::after {
    color: var(--required, #c62828);
    content: ' *';
    font-weight: 700;
}

.required-marker {
    color: var(--required, #c62828);
    font-weight: 700;
}

.diary-form-grid,
.diary-entry-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.diary-card {
    background: var(--paper-strong);
    border: 1px solid var(--line);
    border-radius: 6px;
    box-shadow: 0 10px 24px var(--shadow);
    padding: 22px;
    animation: diary-card-in 0.75s cubic-bezier(0.22, 1, 0.36, 1) both;
    will-change: opacity, transform;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.diary-card:hover,
.diary-card:focus-within {
    border-color: var(--brand);
    box-shadow: 0 16px 30px var(--shadow-hover, rgba(17, 17, 17, 0.12));
    transform: translateY(-3px);
}

.diary-card:nth-child(2),
.diary-entry:nth-child(2) {
    animation-delay: 0.12s;
}

.diary-card:nth-child(3),
.diary-entry:nth-child(3) {
    animation-delay: 0.24s;
}

.diary-card:nth-child(4),
.diary-entry:nth-child(4) {
    animation-delay: 0.36s;
}

.diary-card:nth-child(5),
.diary-entry:nth-child(5) {
    animation-delay: 0.48s;
}

.diary-card:nth-child(6) {
    animation-delay: 0.6s;
}

.diary-card-experience,
.diary-card-pain {
    grid-column: span 2;
}

.diary-card-heading,
.diary-entry-heading {
    align-items: center;
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.diary-card-number {
    align-items: center;
    background: var(--brand-soft);
    border-radius: 50%;
    color: var(--brand);
    display: inline-flex;
    flex: 0 0 36px;
    font-size: 0.75rem;
    font-weight: 700;
    height: 36px;
    justify-content: center;
}

.diary-card-kicker {
    color: var(--brand);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    margin: 0 0 4px;
    text-transform: uppercase;
}

.diary-card h3 {
    font-size: 1.25rem;
    margin: 0;
}

.diary-card label:not(.pain-option):not(.exercise-toggle) {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
}

.diary-card input[type="date"],
.diary-card textarea {
    background: var(--paper);
    border-color: var(--line);
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.diary-card input[type="date"]:focus,
.diary-card textarea:focus {
    background: var(--paper-strong);
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-soft);
}

.diary-card textarea {
    min-height: 104px;
    resize: vertical;
}

.pain-picker {
    border: 0;
    margin: 0;
    padding: 0;
}

.pain-picker legend {
    color: var(--muted);
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.pain-options {
    display: grid;
    grid-template-columns: repeat(11, minmax(28px, 1fr));
    gap: 6px;
}

.pain-option,
.exercise-option {
    cursor: pointer;
    display: block;
    margin: 0;
    position: relative;
}

.pain-option input,
.exercise-option input {
    height: 1px;
    opacity: 0;
    position: absolute;
    width: 1px;
}

.pain-option span,
.exercise-option span {
    align-items: center;
    background: var(--paper);
    border: 1px solid var(--line);
    color: var(--muted);
    display: flex;
    font-weight: 700;
    justify-content: center;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.pain-option span {
    border-radius: 4px;
    height: 42px;
}

.exercise-option span {
    border-radius: 5px;
    min-height: 48px;
}

.pain-option:hover span,
.pain-option input:focus-visible + span,
.exercise-option:hover span,
.exercise-option input:focus-visible + span {
    border-color: var(--brand);
    color: var(--brand);
    transform: translateY(-2px);
}

.pain-option input:checked + span,
.exercise-option input:checked + span {
    background: var(--brand);
    border-color: var(--brand);
    color: var(--button-text);
    transform: translateY(-2px);
}

.pain-option input:checked + span {
    animation: pain-choice-pop 0.45s cubic-bezier(0.22, 1.4, 0.36, 1);
}

.exercise-options {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.exercise-option input:checked + span {
    animation: exercise-choice-pop 0.4s cubic-bezier(0.22, 1.4, 0.36, 1);
}

.diary-form .dashboard-button {
    transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.diary-form .dashboard-button:hover {
    box-shadow: 0 8px 18px var(--shadow-hover, rgba(17, 17, 17, 0.12));
}

.diary-form .dashboard-button:active {
    box-shadow: 0 2px 6px var(--shadow);
    transform: translateY(2px) scale(0.98);
}

.diary-entry {
    background: var(--paper-strong);
    border: 1px solid var(--line);
    border-radius: 6px;
    box-shadow: 0 10px 24px var(--shadow);
    padding: 22px;
    animation: diary-card-in 0.75s cubic-bezier(0.22, 1, 0.36, 1) both;
    will-change: opacity, transform;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.diary-entry:hover {
    border-color: var(--brand);
    box-shadow: 0 20px 36px var(--shadow-hover, rgba(17, 17, 17, 0.16));
    transform: translateY(-6px) scale(1.01);
}

.diary-entry-heading {
    align-items: baseline;
    justify-content: space-between;
}

.diary-entry-heading h3 {
    margin: 0;
}

.diary-pain {
    align-items: baseline;
    color: var(--brand);
    display: inline-flex;
    gap: 3px;
    white-space: nowrap;
}

.diary-pain strong {
    font-size: 1.7rem;
    line-height: 1;
}

.diary-pain small {
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 700;
}

.diary-entry-meta {
    border-bottom: 1px solid var(--line);
    margin: 18px 0 16px;
    padding-bottom: 14px;
}

.diary-status {
    align-items: center;
    display: inline-flex;
    font-size: 0.85rem;
    font-weight: 700;
    gap: 7px;
}

.diary-status > span {
    background: var(--muted);
    border-radius: 50%;
    display: inline-block;
    height: 8px;
    width: 8px;
}

.diary-status.is-complete {
    color: var(--brand);
}

.diary-status.is-complete > span {
    background: var(--brand);
}

.diary-entry-experience,
.diary-entry p {
    color: var(--muted);
}

.diary-entry-experience {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    overflow: hidden;
}

.diary-entry p {
    margin: 16px 0 0;
    white-space: normal;
}

.diary-entry-details {
    border-top: 1px solid var(--line);
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 16px;
    padding-top: 14px;
}

.diary-entry-details p {
    font-size: 0.9rem;
    margin: 0;
}

.diary-entry-details strong {
    color: var(--color-headings);
}

@keyframes diary-card-in {
    from {
        opacity: 0;
        transform: translateY(36px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes pain-choice-pop {
    0% { transform: translateY(-2px) scale(0.94); }
    60% { transform: translateY(-2px) scale(1.1); }
    100% { transform: translateY(-2px) scale(1); }
}

@keyframes exercise-choice-pop {
    0% { transform: translateY(-2px) scale(0.94); }
    65% { transform: translateY(-2px) scale(1.08); }
    100% { transform: translateY(-2px) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .diary-card,
    .diary-entry,
    .pain-option input:checked + span,
    .exercise-option input:checked + span {
        animation: none;
        transition: none;
    }
}

@media (max-width: 700px) {
    .diary-form-grid,
    .diary-entry-list {
        grid-template-columns: 1fr;
    }

    .diary-card-experience,
    .diary-card-pain {
        grid-column: auto;
    }

    .pain-options {
        grid-template-columns: repeat(6, minmax(28px, 1fr));
    }

    .diary-entry-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .diary-entry-details {
        grid-template-columns: 1fr;
    }
}

.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;
}

@media (max-width: 800px) {
    .nav-shell,
    body.app-page .nav-shell,
    body.auth-page .nav-shell {
        border-radius: 24px;
        flex-wrap: wrap;
        justify-content: space-between;
    }

    .nav-links,
    body.app-page .nav-links,
    body.auth-page .nav-links {
        display: none;
        flex-basis: 100%;
        flex-direction: column;
        align-items: stretch;
        padding: 8px 0 4px;
    }

    .nav-links.nav-links-open {
        display: flex;
    }

    .nav-links .nav-link {
        justify-content: flex-start;
        width: 100%;
        border-radius: 14px;
        padding: 0.7rem 0.85rem;
    }

    .nav-menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .hero-inner {
        grid-template-columns: 1fr;
        padding: 28px 20px;
    }

    .feature-grid {
        grid-template-columns: 1fr;
    }

    .footer-inner {
        flex-direction: column;
    }

    .users-index-page,
    .admin-index-page,
    .auth-card,
    body.auth-page .users.form.content {
        padding: 28px 20px;
    }

    .users-index-page .page-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .dashboard-links {
        grid-template-columns: 1fr 1fr;
    }

    .time-slots {
        grid-template-columns: 1fr 1fr;
    }

    .patient-info-grid {
        grid-template-columns: 1fr;
    }

    .patient-action {
        text-align: left;
    }
}
