/*
 * Copyright (c) 2026 Abdul Wahid. All rights reserved.
 * Contact: hello@bookmiam.co.uk | https://bookmiam.co.uk/
 */

html:has(body.mediationcrm-app) {
    background: #f5f7fa;
}

body.mediationcrm-app {
    margin: 0;
    min-width: 320px;
    background: #f5f7fa;
    color: #111827;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
}

body.mediationcrm-app * {
    box-sizing: border-box;
}

#mediationcrm-app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #f5f7fa;
}

.mediationcrm-app-width,
.mediationcrm-app-content {
    width: min(1152px, calc(100% - 32px));
    margin-inline: auto;
}

#mediationcrm-app.mediationcrm-app-wide {
    --mediationcrm-page-width: 1152px;
}

/* The page chrome and the primary page content use the same container.
   This avoids theme and utility classes giving the body a different width. */
.mediationcrm-app-content {
    max-width: none !important;
}

.mediationcrm-app-header {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
}

.mediationcrm-app-header-inner {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.mediationcrm-app-brand {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    color: #111827;
    text-decoration: none;
}

.mediationcrm-app-logo {
    display: block;
    width: auto;
    max-width: 240px;
    height: 48px;
    object-fit: contain;
    object-position: left center;
}

.mediationcrm-app-brand-name {
    max-width: 560px;
    overflow: hidden;
    color: #111827;
    font-size: 1.125rem;
    font-weight: 750;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mediationcrm-app-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
    font-size: 0.875rem;
    font-weight: 650;
}

.mediationcrm-app-actions a,
.mediationcrm-app-footer a {
    color: var(--mediationcrm-brand);
    text-decoration: none;
}

.mediationcrm-app-actions a:hover,
.mediationcrm-app-footer a:hover {
    text-decoration: underline;
}

.mediationcrm-app-logout {
    padding: 8px 13px;
    border: 1px solid #d1d5db;
    border-color: color-mix(in srgb, var(--mediationcrm-brand) 35%, #d1d5db);
    border-radius: 8px;
}

.mediationcrm-app-main {
    width: 100%;
    flex: 1 0 auto;
}

.mediationcrm-app-main > .bmc-shell {
    min-height: auto;
    background: transparent;
}

.mediationcrm-booking-page {
    padding: 40px 0 64px;
}

.mediationcrm-booking-title {
    margin: 0 0 24px;
    color: #111827;
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    font-weight: 750;
    line-height: 1.15;
}

.mediationcrm-app-footer {
    flex: 0 0 auto;
    border-top: 1px solid #e5e7eb;
    background: #fff;
    color: #6b7280;
    font-size: 0.8125rem;
}

.mediationcrm-app-footer-inner {
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.mediationcrm-app-footer-links {
    display: flex;
    gap: 16px;
}

body.admin-bar #mediationcrm-app {
    min-height: calc(100vh - 32px);
}

@media (max-width: 782px) {
    body.admin-bar #mediationcrm-app {
        min-height: calc(100vh - 46px);
    }

    .mediationcrm-app-width,
    .mediationcrm-app-content {
        width: min(1152px, calc(100% - 24px));
    }

    .mediationcrm-app-header-inner {
        min-height: 68px;
        gap: 12px;
    }

    .mediationcrm-app-logo {
        max-width: 170px;
        height: 40px;
    }

    .mediationcrm-app-brand-name {
        max-width: 58vw;
        font-size: 1rem;
    }

    .mediationcrm-app-actions {
        gap: 8px;
    }

    .mediationcrm-booking-page {
        padding: 28px 0 44px;
    }

    .mediationcrm-app-footer-inner,
    .mediationcrm-app-footer-links {
        align-items: flex-start;
        flex-direction: column;
    }

    .mediationcrm-app-footer-inner {
        padding-block: 18px;
        gap: 8px;
    }

    .mediationcrm-app-footer-links {
        gap: 5px;
    }
}

/* Staff shortcuts stay off the compact mobile header. */
@media (max-width: 782px) {
    .mediationcrm-app-actions .mediationcrm-desktop-link { display: none; }
}
