.clients-directory { display: grid; gap: 20px; min-width: 0; }
.crm-page-clients .client-row-action-group { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 8px; }
.crm-page-clients .client-row-action-group > .row-link { width: auto; min-height: 44px; }
.crm-page-clients .client-row-action-group > .clients-details-link { display: inline-grid; place-items: center; width: 44px; min-width: 44px; height: 44px; padding: 0; }
.crm-page-clients .client-removal-form { margin: 0; flex: 0 0 auto; }
.crm-page-clients .client-removal-button { display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid #fecaca; border-radius: var(--ui-radius-sm); background: #fff5f5; color: #b91c1c; cursor: pointer; }
.crm-page-clients .client-removal-button svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.crm-page-clients .client-removal-button:hover { background: #fee2e2; }
.crm-page-clients .client-removal-button:focus-visible { outline: 2px solid var(--ui-color-primary); outline-offset: 3px; }
.crm-page-clients .client-removal-button:disabled { opacity: .55; cursor: wait; }
.crm-page-clients .client-removal-status { margin: 0; padding: 12px 16px; border: 1px solid var(--ui-color-border); background: var(--ui-color-surface-subtle); border-radius: var(--ui-radius-sm); overflow-wrap: anywhere; }
.crm-page-clients .client-removal-status:empty { display: none; }
.crm-page-clients .clients-directory .clients-list-footer { position: static; margin-top: 0; flex-wrap: wrap; }
.crm-page-clients .clients-list-footer .bookings-pagination { display: flex; flex-wrap: wrap; gap: 8px; }
.crm-page-clients .clients-list-footer .bookings-pagination a { flex: 0 0 auto; min-width: 34px; width: auto; padding-inline: 8px; }
@media (max-width: 900px), (pointer: coarse) {
    .crm-page-clients .clients-list-footer .bookings-pagination a { min-width: 44px; min-height: 44px; }
}
.crm-page-clients .clients-directory .bookings-page-header {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 1.2fr);
    align-items: center;
    gap: 20px;
}
.crm-page-clients .clients-title-copy { min-width: 0; display: grid; gap: 6px; }
.crm-page-clients .clients-title-copy h2 { margin: 0; }
.crm-page-clients .clients-heading-row { display: flex; align-items: center; justify-content: flex-start; gap: 12px; min-width: 0; }
.crm-page-clients .clients-create-button { min-height: 44px; border-radius: var(--ui-radius-sm); background: var(--ui-color-primary); box-shadow: none; }
.crm-page-clients .clients-create-button:hover { background: var(--ui-color-primary-hover); }
.crm-page-clients .clients-directory .clients-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-column: auto;
    grid-row: auto;
    margin: 0;
    gap: 12px;
}
.crm-page-clients .clients-search .bookings-search-field { grid-column: auto; }
.crm-page-clients .clients-directory .bookings-page-header .clients-search > .row-link {
    min-height: 44px;
    height: auto;
    padding: 10px 18px;
    background: var(--ui-color-primary);
    border-color: var(--ui-color-primary);
    color: #fff;
    border-radius: var(--ui-radius-sm);
    cursor: pointer;
}
.crm-page-clients .clients-directory .bookings-page-header .clients-search > .row-link:hover { background: var(--ui-color-primary-hover); }
.crm-page-clients .clients-directory-table { table-layout: fixed; }
.crm-page-clients .clients-directory-table th:nth-child(2) { width: 70px; }
.crm-page-clients .clients-directory-table th:nth-child(6) { width: 200px; }
.crm-page-clients .clients-directory-table .clients-row-actions { text-align: right; }
.crm-page-clients .clients-directory-table td { vertical-align: middle; }
.crm-page-clients .clients-directory-table td > .row-link {
    max-width: 100%;
    height: auto;
    min-height: 40px;
    padding: 8px 12px;
    white-space: normal;
    border-color: var(--ui-color-border);
    background: var(--ui-color-surface-subtle);
    color: var(--ui-color-primary);
}
.clients-name-link { color: inherit; text-decoration: none; }
.clients-name-link > span { display: block; margin-top: 4px; color: var(--ui-color-text-muted); font-size: 12px; }
.clients-name-link:hover { text-decoration: underline; }
.clients-name-link:focus-visible { outline: 2px solid var(--ui-color-primary); outline-offset: 4px; }
@media (max-width: 900px) {
    .crm-page-clients .clients-directory .bookings-page-header { grid-template-columns: minmax(0, 1fr); gap: 16px; }
    .crm-page-clients .clients-directory-table tbody tr { position: relative; }
    .crm-page-clients .clients-directory-table td:first-child { min-height: 44px; padding-right: 104px; }
    .crm-page-clients .clients-directory-table .clients-row-actions {
        position: absolute;
        top: 12px;
        right: 12px;
        display: block;
        width: auto;
        min-width: 0;
        padding: 0;
        z-index: 1;
    }
    .crm-page-clients .clients-directory-table .clients-row-actions::before { display: none; }
    .crm-page-clients .clients-directory-table .client-row-action-group { flex-wrap: nowrap; }
    .crm-page-clients .clients-directory .clients-directory-table tbody tr { grid-template-areas: none; }
    .crm-page-clients .clients-directory .clients-directory-table td {
        display: block;
        grid-area: auto;
        width: auto;
        min-width: 0;
        order: 0;
    }
    .crm-page-clients .clients-directory .clients-directory-table td:first-child { grid-column: 1 / -1; }
    .crm-page-clients .clients-directory-table td > .row-link { min-height: 44px; }
}
.crm-page-clients .client-create-dialog {
    width: min(720px, calc(100vw - 32px));
    max-width: 100%;
    max-height: min(860px, calc(100dvh - 32px));
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--ui-color-border);
    border-radius: var(--ui-radius-lg);
    background: var(--ui-color-surface);
    color: var(--ui-color-text);
    box-shadow: 0 24px 70px rgba(15, 35, 68, .24);
}
.crm-page-clients .client-create-dialog::backdrop { background: rgba(15, 35, 68, .42); backdrop-filter: blur(2px); }
.crm-page-clients .client-create-dialog > form { display: grid; gap: 18px; max-height: inherit; padding: 22px; overflow-y: auto; overscroll-behavior: contain; }
.crm-page-clients .client-create-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.crm-page-clients .client-create-dialog-head > div { min-width: 0; }
.crm-page-clients .client-create-dialog-head span { color: var(--ui-color-text-muted); font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.crm-page-clients .client-create-dialog-head h2 { margin: 3px 0 0; font-size: 24px; line-height: 1.25; }
.crm-page-clients .client-create-dialog-head .icon-only { width: 44px; height: 44px; flex: 0 0 44px; border: 1px solid var(--ui-color-border); border-radius: var(--ui-radius-sm); background: var(--ui-color-surface); color: var(--ui-color-text); }
.crm-page-clients .client-type-switch { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 5px; border: 1px solid var(--ui-color-border); border-radius: var(--ui-radius-sm); background: var(--ui-color-surface-subtle); }
.crm-page-clients .client-type-switch legend { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.crm-page-clients .client-type-switch label { position: relative; min-width: 0; cursor: pointer; }
.crm-page-clients .client-type-switch input { position: absolute; opacity: 0; pointer-events: none; }
.crm-page-clients .client-type-switch span { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 12px; border: 1px solid transparent; border-radius: 8px; color: var(--ui-color-text-muted); font-size: 14px; font-weight: 600; text-align: center; }
.crm-page-clients .client-type-switch input:checked + span { border-color: var(--ui-color-primary); background: var(--ui-color-surface); color: var(--ui-color-primary); box-shadow: 0 4px 14px rgba(33, 87, 242, .1); }
.crm-page-clients .client-type-switch input:focus-visible + span { outline: 2px solid var(--ui-color-primary); outline-offset: 2px; }
.crm-page-clients .client-create-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; min-width: 0; }
.crm-page-clients .client-create-fields[hidden] { display: none !important; }
.crm-page-clients .client-create-field { display: grid; align-content: start; gap: 6px; min-width: 0; }
.crm-page-clients .client-create-field-wide { grid-column: 1 / -1; }
.crm-page-clients .client-create-field > label { color: var(--ui-color-text-muted); font-size: 13px; font-weight: 600; }
.crm-page-clients .client-create-field > label span { color: var(--ui-color-danger, #b42318); }
.crm-page-clients .client-create-field .ui-input,
.crm-page-clients .client-create-field .ui-textarea { width: 100%; max-width: 100%; font-size: 16px; }
.crm-page-clients .client-create-field .ui-textarea { min-height: 92px; resize: vertical; }
.crm-page-clients .client-create-feedback { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.crm-page-clients .client-create-feedback > p { flex: 1 1 260px; margin: 0; color: var(--ui-color-danger, #b42318); font-size: 13px; overflow-wrap: anywhere; }
.crm-page-clients .client-create-feedback > p:empty { display: none; }
.crm-page-clients .client-create-feedback .row-link { min-height: 40px; }
.crm-page-clients [data-client-existing-link][hidden] { display: none !important; }
.crm-page-clients .client-create-actions { position: sticky; bottom: -22px; display: flex; justify-content: flex-end; gap: 10px; margin: 0 -22px -22px; padding: 16px 22px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--ui-color-border); background: var(--ui-color-surface); }
.crm-page-clients .client-create-actions .ui-button { min-height: 44px; }
.crm-page-clients .client-editor-drawer {
    width: min(640px, 100vw);
    height: 100dvh;
    max-height: 100dvh;
    margin: 0 0 0 auto;
    border-radius: 0;
}
.crm-page-clients .client-editor-drawer > form {
    grid-template-rows: auto auto auto minmax(0, 1fr);
    gap: 0;
    width: 100%;
    height: 100%;
    max-height: none;
    padding: 0;
    overflow: hidden;
}
.crm-page-clients .client-editor-drawer .client-create-dialog-head {
    padding: 16px 20px 12px;
}
.crm-page-clients .client-editor-drawer[data-client-editor-mode="create"] > form {
    grid-template-rows: auto auto minmax(0, 1fr);
}
body.booking-drawer-embedded [data-document-client-create] .client-editor-drawer {
    width: 100vw;
    max-width: 100vw;
}
.crm-page-clients .client-editor-summary {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 6px 20px 16px;
}
.crm-page-clients .client-editor-summary-avatar {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--ui-color-primary-soft, #eef4ff);
    color: var(--ui-color-primary);
    font-weight: 600;
}
.crm-page-clients .client-editor-summary-copy { display: grid; gap: 3px; min-width: 0; }
.crm-page-clients .client-editor-summary-copy strong {
    font-size: 18px;
    line-height: 1.3;
    overflow-wrap: anywhere;
}
.crm-page-clients .client-editor-summary-copy > span {
    color: var(--ui-color-text-muted);
    font-size: 13px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}
.crm-page-clients .client-editor-tabs {
    display: flex;
    min-width: 0;
    padding: 0 20px;
    overflow-x: auto;
    overflow-y: hidden;
    border-top: 1px solid var(--ui-color-border);
    border-bottom: 1px solid var(--ui-color-border);
    background: var(--ui-color-surface);
    scrollbar-width: none;
}
.crm-page-clients .client-editor-tabs::-webkit-scrollbar { display: none; }
.crm-page-clients .client-editor-tabs button {
    position: relative;
    flex: 0 0 auto;
    min-height: 44px;
    padding: 10px 12px;
    border: 0;
    background: transparent;
    color: var(--ui-color-text-muted);
    font: inherit;
    font-size: 14px;
    cursor: pointer;
}
.crm-page-clients .client-editor-tabs button[aria-selected="true"] { color: var(--ui-color-primary); font-weight: 600; }
.crm-page-clients .client-editor-tabs button[aria-selected="true"]::after {
    position: absolute;
    right: 10px;
    bottom: 0;
    left: 10px;
    height: 2px;
    border-radius: 2px 2px 0 0;
    background: var(--ui-color-primary);
    content: "";
}
.crm-page-clients .client-editor-tabs button:focus-visible { outline: 2px solid var(--ui-color-primary); outline-offset: -3px; }
.crm-page-clients .client-editor-content {
    min-height: 0;
    padding: 20px;
    overflow-y: auto;
    overscroll-behavior: contain;
}
.crm-page-clients .client-editor-panel { display: grid; gap: 18px; }
.crm-page-clients .client-editor-panel[hidden] { display: none !important; }
.crm-page-clients .client-editor-content .client-create-actions {
    bottom: -20px;
    margin: 20px -20px -20px;
    padding: 16px 20px calc(16px + env(safe-area-inset-bottom));
}
.clients-search { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; }
.clients-search label { display: grid; gap: 6px; flex: 1 1 220px; min-width: 0; }
.clients-card-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 20px; }
.clients-card-grid > * { min-width: 0; }
.clients-directory-table td { overflow-wrap: anywhere; }
.clients-stay:is(a):hover { background: #eef4ff; }
.clients-stay:is(a):focus-visible { outline: 2px solid #2460dc; outline-offset: 2px; }
.clients-stay { display: grid; gap: 6px; padding: 16px 0; border-bottom: 1px solid #dbe5f3; color: inherit; text-decoration: none; overflow-wrap: anywhere; }
.clients-pagination { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.clients-note { white-space: pre-wrap; overflow-wrap: anywhere; }
.clients-directory dd { margin: 6px 0 16px; overflow-wrap: anywhere; }
.crm-page-clients .client-profile-hero {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 20px;
    align-items: center;
    padding: 16px 20px;
    border: 1px solid var(--ui-color-border);
    border-radius: var(--ui-radius-md);
    box-shadow: none;
}
.crm-page-clients .client-profile-hero-copy { min-width: 0; }
.crm-page-clients .client-profile-number-title { margin: 0; font-size: 22px; line-height: 1.25; white-space: nowrap; }
.crm-page-clients .booking-actions { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 10px; width: 100%; min-width: 0; max-width: none; }
.crm-page-clients .client-profile-messenger-actions { display: contents; }
.crm-page-clients .booking-actions .action-button,
.crm-page-clients .booking-actions .client-removal-button { min-height: 44px; }
.crm-page-clients .booking-actions .client-removal-form { margin: 0; }
.crm-page-clients .client-profile-save-status { flex-basis: 100%; margin: 0; min-height: 0; text-align: right; font-size: 13px; color: var(--ui-color-text-muted); overflow-wrap: anywhere; }
.crm-page-clients .client-profile-save-status:empty { display: none; }
.crm-page-clients .clients-card-grid {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    align-items: start;
    gap: 20px;
}
.crm-page-clients .client-profile-card,
.crm-page-clients .client-history-card {
    padding: 20px;
    border: 1px solid var(--ui-color-border);
    border-radius: var(--ui-radius-md);
    box-shadow: none;
    min-width: 0;
    background: var(--ui-color-surface);
}
.crm-page-clients .client-profile-side-stack { display: grid; gap: 20px; min-width: 0; }
.crm-page-clients .client-profile-card-heading { padding-bottom: 14px; border-bottom: 1px solid var(--ui-color-border); }
.crm-page-clients .client-profile-card-heading h3 { margin: 0; font-size: 18px; line-height: 1.4; }
.crm-page-clients .client-profile-summary { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; margin-top: 14px; color: var(--ui-color-text-muted); font-size: 13px; line-height: 1.45; }
.crm-page-clients .client-profile-summary-type { display: inline-flex; width: fit-content; padding: 4px 9px; border-radius: var(--ui-radius-pill); background: var(--ui-color-surface-muted); color: var(--ui-color-text); font-size: 12px; font-weight: 600; }
.crm-page-clients .client-profile-summary-bookings,
.crm-page-clients .client-profile-summary-arrival { overflow-wrap: anywhere; }
.crm-page-clients .client-profile-identity { display: grid; gap: 6px; min-width: 0; margin-top: 14px; }
.crm-page-clients .client-profile-identity > span { color: var(--ui-color-text-muted); font-size: 13px; }
.crm-page-clients .client-profile-identity > strong { font-size: 16px; line-height: 1.45; overflow-wrap: anywhere; }
.crm-page-clients .client-history-heading { padding-bottom: 14px; border-bottom: 1px solid var(--ui-color-border); }
.crm-page-clients .client-profile-id,
.crm-page-clients .client-history-heading > span { color: var(--ui-color-text-muted); font-size: 13px; }
.crm-page-clients .client-contact-list > div { min-width: 0; padding: 12px 0; border-bottom: 1px solid var(--ui-color-border); }
.crm-page-clients .client-contact-list > div:nth-child(odd) { padding-right: 12px; }
.crm-page-clients .client-contact-list > div:nth-child(even) { padding-left: 12px; }
.crm-page-clients .client-contact-list > div:last-child:nth-child(odd) { grid-column: 1 / -1; padding-right: 0; }
.crm-page-clients .client-contact-list dt,
.crm-page-clients .client-stay-details dt { font-size: 12px; color: var(--ui-color-text-muted); }
.crm-page-clients .client-contact-list dd,
.crm-page-clients .client-stay-details dd { margin: 4px 0 0; line-height: 1.5; font-weight: 600; overflow-wrap: anywhere; }
.crm-page-clients .client-profile-section { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--ui-color-border); }
.crm-page-clients .client-company-section { margin-top: 0; padding-top: 0; border-top: 0; }
.crm-page-clients .client-profile-section h3,
.crm-page-clients .client-history-heading h3 { margin: 0; font-size: 18px; line-height: 1.4; }
.crm-page-clients .client-contact-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin: 14px 0 0; }
.crm-page-clients .client-help { margin: 10px 0 0; font-size: 13px; line-height: 1.5; color: var(--ui-color-text-muted); }
.crm-page-clients .client-profile-section .empty-note { margin: 0; padding: 0; text-align: left; }
.crm-page-clients .client-profile-section .clients-note { margin: 12px 0 0; line-height: 1.6; }
.crm-page-clients .client-profile-section .row-link { min-height: 44px; height: auto; padding: 10px 12px; border-radius: var(--ui-radius-sm); }
.crm-page-clients .client-history-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.crm-page-clients .client-history-heading-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; min-width: 0; }
.crm-page-clients .client-history-heading-actions > span { color: var(--ui-color-text-muted); font-size: 13px; }
.crm-page-clients .client-history-card > .clients-stay {
    margin-top: 12px;
    padding: 16px;
    gap: 14px;
    border: 1px solid var(--ui-color-border);
    border-radius: var(--ui-radius-sm);
    background: var(--ui-color-surface);
}
.crm-page-clients .client-stay-head { display: flex; justify-content: space-between; align-items: start; flex-wrap: wrap; gap: 8px; }
.crm-page-clients .client-stay-open { display: inline-flex; align-items: center; min-height: 44px; color: var(--ui-color-primary); font-size: 13px; font-weight: 600; text-decoration: none; }
.crm-page-clients .client-stay-open:hover { text-decoration: underline; }
.crm-page-clients .client-stay-open:focus-visible { outline: 2px solid var(--ui-color-primary); outline-offset: 3px; }
.crm-page-clients .client-stay-details { display: grid; grid-template-columns: minmax(0, 1fr); margin: 0; }
.crm-page-clients .client-stay-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 10px 0; border-top: 1px solid var(--ui-color-border); }
.crm-page-clients .client-stay-row > div { min-width: 0; padding: 0 10px; }
.crm-page-clients .client-stay-row > div:first-child { padding-left: 0; }
.crm-page-clients .client-stay-row > div + div { border-left: 1px solid var(--ui-color-border); }
.crm-page-clients .client-stay-row > div:last-child { padding-right: 0; }
.crm-page-clients .client-history-card > .clients-pagination { margin: 16px 0 0; }
.crm-page-clients .client-history-card > .clients-pagination:empty { display: none; }
@media (max-width: 1000px) {
    .crm-page-clients .clients-card-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
    .crm-page-clients .client-profile-card,
    .crm-page-clients .client-history-card { padding: 16px; }
}
@media (max-width: 720px) {
    .crm-page-clients .client-profile-hero { grid-template-columns: minmax(0, 1fr); padding: 16px; }
    .crm-page-clients .client-profile-number-title { font-size: 21px; }
    .crm-page-clients .booking-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); justify-content: stretch; max-width: none; }
    .crm-page-clients .booking-actions > .action-button,
    .crm-page-clients .booking-actions > .client-removal-form,
    .crm-page-clients .client-profile-messenger-actions > .action-button { width: 100%; min-width: 0; }
    .crm-page-clients .booking-actions .client-removal-button { width: 100%; }
    .crm-page-clients .client-profile-save-status { grid-column: 1 / -1; text-align: left; }
}
@media (max-width: 430px) {
    .crm-page-clients .client-history-heading { align-items: stretch; }
    .crm-page-clients .client-history-heading h3,
    .crm-page-clients .client-history-heading-actions { width: 100%; }
    .crm-page-clients .client-history-heading-actions { justify-content: space-between; }
}
@media (max-width: 760px) {
    .clients-card-grid { grid-template-columns: minmax(0, 1fr); }
    .crm-page-clients .clients-heading-row { align-items: center; }
    .crm-page-clients .clients-create-button { width: 44px; height: 44px; min-width: 44px; padding: 0; gap: 0; }
    .crm-page-clients .clients-create-button .clients-create-label { display: none; }
    .crm-page-clients .client-create-dialog:not(.client-editor-drawer) { width: calc(100vw - 20px); max-height: calc(100dvh - 20px); border-radius: var(--ui-radius-md); }
    .crm-page-clients .client-create-dialog:not(.client-editor-drawer) > form { padding: 18px; }
    .crm-page-clients .client-create-dialog:not(.client-editor-drawer) .client-create-actions { bottom: -18px; margin: 0 -18px -18px; padding-inline: 18px; }
    .crm-page-clients .client-editor-drawer {
        width: 100vw;
        max-width: 100vw;
        height: 100dvh;
        max-height: 100dvh;
        border-radius: 0;
    }
    .crm-page-clients .client-editor-drawer .client-create-dialog-head { padding-inline: 16px; }
    .crm-page-clients .client-editor-summary { padding-inline: 16px; }
    .crm-page-clients .client-editor-tabs { padding-inline: 4px; }
    .crm-page-clients .client-editor-content { padding: 16px; }
    .crm-page-clients .client-editor-content .client-create-actions { bottom: -16px; margin: 20px -16px -16px; padding-inline: 16px; }
}
.crm-page-clients .client-profile-name-field,
.crm-page-clients .client-profile-note-field { margin-top: 14px; }
.crm-page-clients .client-profile-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.crm-page-clients .client-profile-field { display: grid; gap: 6px; min-width: 0; }
.crm-page-clients .client-profile-field label { font-size: 13px; color: var(--ui-color-text-muted); }
.crm-page-clients .client-profile-field .ui-input,
.crm-page-clients .client-profile-field .ui-textarea { width: 100%; max-width: 100%; font-size: 16px; }
.crm-page-clients .client-profile-field .ui-textarea { resize: vertical; min-height: 100px; }
.crm-page-clients .client-profile-field-error { color: var(--ui-color-danger, #b42318); font-size: 13px; overflow-wrap: anywhere; }
.crm-page-clients .client-profile-field-error:empty { display: none; }
@media (max-width: 600px) {
    .crm-page-clients .client-profile-fields { grid-template-columns: minmax(0, 1fr); }
    .crm-page-clients .client-create-fields { grid-template-columns: minmax(0, 1fr); }
    .crm-page-clients .client-create-field-wide { grid-column: auto; }
    .crm-page-clients .client-create-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .crm-page-clients .clients-directory .bookings-page-header {
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }

    .crm-page-clients .clients-directory-table :is(.clients-id-cell, .clients-messengers-cell) {
        display: none !important;
    }
}

/* Same glyph as the sidebar; retain the existing heading icon surface. */
.crm-page-clients .page-title-icon-clients {
    --page-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%228%22%20r%3D%223%22%3E%3C%2Fcircle%3E%3Cpath%20d%3D%22M5%2020v-2a7%207%200%200%201%2014%200v2%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E");
}

/* Client cards opened from the directory use the established booking drawer shell. */
.crm-page-clients .client-list-drawer-summary { justify-content: space-between; }
.crm-page-clients .client-list-drawer-summary > div:last-child { margin-left: auto; text-align: right; }
.crm-page-clients .client-list-drawer-summary .calendar-booking-drawer-balance strong { color: var(--ui-color-text); font-size: 13px; }

body.client-drawer-embedded .crm-page-clients { padding: 0; margin: 0; }
body.client-drawer-embedded .clients-directory { display: block; min-height: 100%; }
body.client-drawer-embedded .crm-page-clients #client-profile-edit-dialog > form { grid-template-rows: auto minmax(0, 1fr) auto; }
body.client-drawer-embedded .crm-page-clients #client-profile-edit-dialog .client-create-dialog-head,
body.client-drawer-embedded .crm-page-clients #client-profile-edit-dialog .client-editor-summary { display: none; }
body.client-drawer-embedded .client-drawer-view { padding-top: 45px; }
body.client-drawer-embedded .client-drawer-view-tabs { position: fixed; top: 0; right: 0; left: 0; z-index: 20; }
body.client-drawer-embedded .client-drawer-view-panel[hidden] { display: none !important; }
body.client-drawer-embedded .client-drawer-view-panel > [data-client-drawer-section] { display: block; min-width: 0; }
body.client-drawer-embedded .client-profile-card,
body.client-drawer-embedded .client-history-card,
body.client-drawer-embedded #telegram-personal-account {
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}
body.client-drawer-embedded .client-profile-card-heading,
body.client-drawer-embedded .client-history-heading { padding: 0; border: 0; }
body.client-drawer-embedded .client-drawer-inline-actions { display: flex; align-items: center; gap: 7px; flex: 0 0 auto; }
body.client-drawer-embedded .client-profile-card-heading .client-removal-button { width: 34px; min-width: 34px; height: 34px; min-height: 34px; border-radius: 7px; background: #fff; }
body.client-drawer-embedded .client-profile-card-heading .client-removal-button svg { width: 16px; height: 16px; }
body.client-drawer-embedded .client-profile-summary { margin: 12px 0 0; }
body.client-drawer-embedded .client-profile-identity { grid-template-columns: minmax(0, 1fr); align-items: start; gap: 4px; margin-top: 0; padding: 13px 0; border-bottom: 1px solid var(--ui-color-border); }
body.client-drawer-embedded .client-profile-identity > strong { font-size: 14px; }
body.client-drawer-embedded .client-profile-section { margin: 0; padding: 0; border: 0; }
body.client-drawer-embedded .client-profile-card > .client-profile-section { margin-top: 22px; }
body.client-drawer-embedded .client-contact-list { margin: 0; }
body.client-drawer-embedded .client-contact-list dt,
body.client-drawer-embedded .client-contact-list dd { margin: 0; font-size: 14px; }
body.client-drawer-embedded .client-profile-section .clients-note { margin: 0; padding: 13px 0; font-size: 14px; }
body.client-drawer-embedded .client-history-card > .clients-stay { padding: 14px; border-radius: 8px; }
body.client-drawer-embedded #telegram-personal-account .telegram-panel { padding: 0; }

@media (max-width: 430px) {
    .crm-page-clients .client-list-drawer-summary > div { flex: 1 1 0; }
    .crm-page-clients .client-list-drawer-summary > div:last-child { flex: 1 1 0 !important; }
    .crm-page-clients .client-list-drawer-summary strong { overflow-wrap: anywhere; }
    body.client-drawer-embedded .client-history-heading { align-items: flex-start; }
}

/* Profile editing has one scroller and a separate, always-visible action row. */
.crm-page-clients #client-profile-edit-dialog > form {
    grid-template-rows: auto auto auto minmax(0, 1fr) auto;
}
.crm-page-clients #client-profile-edit-dialog > form > .client-create-actions {
    position: static;
    margin: 0;
    padding-inline: 20px;
    flex-wrap: wrap;
}
.crm-page-clients #client-profile-edit-dialog .client-editor-content { padding: 20px; }
.crm-page-clients #client-profile-edit-dialog .client-profile-save-status:empty { display: none; }
html.is-client-profile-editing { overflow: hidden; }
.client-list-drawer.is-client-editing { grid-template-rows: auto minmax(0, 1fr); }
.client-list-drawer.is-client-editing > .client-list-drawer-footer { display: none; }
@media (max-width: 768px) {
    .crm-page-clients #client-profile-edit-dialog .client-editor-content,
    .crm-page-clients #client-profile-edit-dialog > form > .client-create-actions { padding-inline: 16px; }
    .crm-page-clients #client-profile-edit-dialog .client-profile-save-status { grid-column: 1 / -1; }
}
