:root {
    color-scheme: light;
    --bg: #f3f2f5;
    --panel: #ffffff;
    --panel-soft: #fbf7ff;
    --line: #eadff2;
    --line-strong: #d8cfe3;
    --text: #26323a;
    --muted: #64717c;
    --brand: #4b0082;
    --brand-strong: #5f1696;
    --brand-soft: #e7ddff;
    --brand-hover: #eee8f8;
    --brand-frame: #fbf7ff;
    --brand-frame-line: #eee5f6;
    --warning: #9b6716;
    --danger: #b42318;
    --success: #247a4c;
    --shadow: 0 6px 18px rgba(44, 36, 58, 0.08);
    --shadow-strong: 0 16px 34px rgba(44, 36, 58, 0.16);
    --sidebar-collapsed: 70px;
    --sidebar-expanded: 240px;
    --topbar-height: 50px;
    --frame-width: 1450px;
}

/* Restored Report Center cards */
.report-center-group {
    display: grid;
    gap: 10px;
}

.report-center-group-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 2px;
}

.report-center-group-heading h3 {
    margin: 0;
    color: #3a2b48;
    font-size: 0.92rem;
}

.report-center-group-heading > span {
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 800;
}

.report-center-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.report-export-card {
    min-width: 0;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: 1fr auto;
    gap: 12px;
    border: 1px solid #e2d8ea;
    border-radius: 9px;
    padding: 15px;
    background: #fff;
    box-shadow: 0 8px 20px rgba(55, 30, 80, 0.05);
}

.report-export-icon {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: #eee5f6;
    color: var(--brand);
}

.report-export-icon .ui-icon {
    width: 19px;
    height: 19px;
}

.report-export-copy > span {
    color: #766582;
    font-size: 0.64rem;
    font-weight: 900;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.report-export-copy h4 {
    margin: 3px 0 0;
    color: #30223d;
    font-size: 0.88rem;
}

.report-export-copy p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 0.72rem;
    line-height: 1.45;
}

.report-export-action {
    grid-column: 1 / -1;
    justify-content: center;
    min-height: 38px;
    border-color: #d8c7e6;
    color: var(--brand);
    font-weight: 850;
}

.report-export-action .ui-icon {
    width: 16px;
    height: 16px;
}

@media (max-width: 1240px) {
    .report-center-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
    .report-center-grid { grid-template-columns: 1fr; }
}

/* Client portal v2: compact, modal-led experience */
.portal-v2 { --portal-purple: #64258a; --portal-ink: #292439; --portal-muted: #726b7e; --portal-border: #e8e1ec; }
.portal-v2 .client-portal-main { min-height: 640px; }
.portal-v2 .portal-flash-stack { margin: 16px 0; }
.portal-v2 .portal-home-hero { align-items: center; background: linear-gradient(115deg, #4b1769, #8f5ba7); border-radius: 25px; color: #fff; display: flex; gap: 28px; justify-content: space-between; overflow: hidden; padding: 38px 42px; position: relative; }
.portal-v2 .portal-home-hero::after { border: 48px solid rgba(255,255,255,.08); border-radius: 50%; content: ""; height: 220px; position: absolute; right: -65px; top: -85px; width: 220px; }
.portal-v2 .portal-home-hero > * { position: relative; z-index: 1; }
.portal-v2 .portal-home-hero span { font-size: 12px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.portal-v2 .portal-home-hero h1 { color: #fff; font-size: clamp(31px, 4vw, 46px); letter-spacing: -.04em; margin: 8px 0; }
.portal-v2 .portal-home-hero p { color: rgba(255,255,255,.82); margin: 0; }
.portal-v2 .portal-hero-button { background: #fff; border-radius: 12px; color: #572078; font-weight: 800; min-width: 130px; padding: 14px 20px; text-align: center; }
.portal-v2 .portal-summary-grid { display: grid; gap: 16px; grid-template-columns: repeat(4, minmax(0,1fr)); margin-top: 18px; }
.portal-v2 .portal-summary-card { align-items: flex-start; background: #fff; border: 1px solid var(--portal-border); border-radius: 18px; color: var(--portal-ink); display: flex; gap: 14px; min-height: 124px; padding: 20px; transition: border-color .2s, transform .2s, box-shadow .2s; }
.portal-v2 .portal-summary-card:hover { border-color: #cbb3d8; box-shadow: 0 10px 24px rgba(57,30,72,.08); transform: translateY(-2px); }
.portal-v2 .portal-summary-card i, .portal-v2 .portal-wallet-summary i, .portal-v2 .portal-action-card > i { align-items: center; background: #f1e8f6; border-radius: 12px; color: var(--portal-purple); display: flex; flex: 0 0 42px; height: 42px; justify-content: center; }
.portal-v2 .portal-summary-card div { display: grid; gap: 4px; min-width: 0; }
.portal-v2 .portal-summary-card small, .portal-v2 .portal-billing-summary small, .portal-v2 .portal-wallet-summary small { color: #867e8e; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.portal-v2 .portal-summary-card strong { font-size: 17px; }
.portal-v2 .portal-summary-card span { color: var(--portal-muted); font-size: 13px; line-height: 1.4; }

.portal-v2 .portal-book-steps { align-items: center; display: flex; gap: 0; margin: 20px 0 24px; max-width: 620px; }
.portal-v2 .portal-book-steps span { align-items: center; color: #958b9c; display: flex; font-size: 13px; font-weight: 800; gap: 8px; width: 33%; }
.portal-v2 .portal-book-steps span::before { align-items: center; background: #eee8f0; border-radius: 50%; content: attr(data-step); display: none; height: 28px; justify-content: center; width: 28px; }
.portal-v2 .portal-book-steps span:not(:last-child)::after { background: #e6deea; content: ""; height: 1px; margin: 0 12px; width: 58px; }
.portal-v2 .portal-book-steps .is-current { color: var(--portal-purple); }
.portal-v2 .portal-service-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0,1fr)); }
.portal-v2 .portal-service-card { align-items: center; appearance: none; background: #fff; border: 1px solid var(--portal-border); border-radius: 20px; color: var(--portal-ink); cursor: pointer; display: grid; font: inherit; gap: 16px; grid-template-columns: 50px 1fr auto; min-height: 156px; padding: 22px; text-align: left; transition: border-color .2s, box-shadow .2s, transform .2s; }
.portal-v2 .portal-service-card:hover { border-color: #b992ca; box-shadow: 0 12px 28px rgba(67,32,83,.09); transform: translateY(-2px); }
.portal-v2 .portal-service-icon { align-items: center; align-self: start; background: linear-gradient(145deg,#f3e8f8,#ead9f1); border-radius: 15px; color: var(--portal-purple); display: flex; height: 50px; justify-content: center; }
.portal-v2 .portal-service-copy { display: grid; gap: 6px; }
.portal-v2 .portal-service-copy strong { font-size: 19px; }
.portal-v2 .portal-service-copy small { color: var(--portal-muted); line-height: 1.45; }
.portal-v2 .portal-service-copy em { color: var(--portal-purple); font-size: 13px; font-style: normal; font-weight: 800; }
.portal-v2 .portal-service-copy mark { background: #e9f8ef; border-radius: 999px; color: #277147; font-size: 11px; font-weight: 800; justify-self: start; padding: 5px 9px; }
.portal-v2 .portal-service-arrow { color: #a89eae; }
.portal-v2 .portal-time-picker { background: #fff; border: 1px solid var(--portal-border); border-radius: 22px; padding: 24px; }
.portal-v2 .portal-time-grid { display: grid; gap: 10px; grid-template-columns: repeat(4,minmax(0,1fr)); max-height: 480px; overflow: auto; }
.portal-v2 .portal-time-card { background: #f8f5fa; border: 1px solid transparent; border-radius: 13px; color: var(--portal-ink); cursor: pointer; display: grid; gap: 4px; padding: 14px; text-align: left; }
.portal-v2 .portal-time-card:hover { background: #f1e6f6; border-color: #c7acd4; }
.portal-v2 .portal-time-card span { color: var(--portal-muted); font-size: 12px; }
.portal-v2 .portal-time-card strong { color: var(--portal-purple); }
.portal-v2 .portal-text-button { background: none; border: 0; color: var(--portal-purple); cursor: pointer; font: inherit; font-weight: 800; padding: 6px; }

.portal-v2 .portal-appointment-list, .portal-v2 .portal-wallet-list, .portal-v2 .portal-gift-list { display: grid; gap: 10px; }
.portal-v2 .portal-appointment-row { align-items: center; background: #fff; border: 1px solid var(--portal-border); border-radius: 16px; color: var(--portal-ink); cursor: pointer; display: grid; font: inherit; gap: 18px; grid-template-columns: 64px 1fr auto 20px; padding: 16px 20px; text-align: left; width: 100%; }
.portal-v2 .portal-appointment-row:hover { border-color: #b992ca; }
.portal-v2 .portal-appointment-row time { border-right: 1px solid var(--portal-border); display: grid; }
.portal-v2 .portal-appointment-row time strong { font-size: 18px; }
.portal-v2 .portal-appointment-row time span, .portal-v2 .portal-appointment-row > div span { color: var(--portal-muted); font-size: 12px; }
.portal-v2 .portal-appointment-row > div { display: grid; gap: 4px; }

.portal-v2 .portal-table-card { background: #fff; border: 1px solid var(--portal-border); border-radius: 20px; margin-bottom: 18px; overflow: hidden; }
.portal-v2 .portal-table-heading { align-items: center; border-bottom: 1px solid var(--portal-border); display: flex; justify-content: space-between; padding: 20px 24px; }
.portal-v2 .portal-table-heading h2 { font-size: 21px; margin: 4px 0 0; }
.portal-v2 .portal-table-heading > em { align-items: center; background: #efe4f5; border-radius: 50%; color: var(--portal-purple); display: flex; font-style: normal; font-weight: 800; height: 32px; justify-content: center; width: 32px; }
.portal-v2 .portal-table-wrap { overflow-x: auto; }
.portal-v2 .portal-history-scroll { max-height: 390px; overflow: auto; }
.portal-v2 .portal-data-table { border-collapse: collapse; width: 100%; }
.portal-v2 .portal-data-table th { background: #faf8fb; color: #827987; font-size: 11px; letter-spacing: .08em; padding: 12px 20px; text-align: left; text-transform: uppercase; }
.portal-v2 .portal-data-table td { border-top: 1px solid #f0ebf2; color: var(--portal-muted); padding: 15px 20px; vertical-align: middle; }
.portal-v2 .portal-data-table tbody tr:first-child td { border-top: 0; }
.portal-v2 .portal-data-table td strong, .portal-v2 .portal-data-table td small { display: block; }
.portal-v2 .portal-data-table td strong { color: var(--portal-ink); }
.portal-v2 .portal-data-table td small { font-size: 12px; margin-top: 3px; }
.portal-v2 .portal-inline-actions { align-items: center; display: flex; gap: 7px; justify-content: flex-end; }
.portal-v2 .portal-inline-actions form { margin: 0; }
.portal-v2 .portal-inline-actions .portal-primary, .portal-v2 .portal-inline-actions .portal-secondary { min-height: 38px; padding: 9px 13px; }

.portal-v2 .portal-billing-summary, .portal-v2 .portal-wallet-summary { display: grid; gap: 16px; grid-template-columns: repeat(2,minmax(0,1fr)); margin-bottom: 18px; }
.portal-v2 .portal-billing-summary > div { background: #fff; border: 1px solid var(--portal-border); border-radius: 18px; display: grid; gap: 4px; padding: 22px 24px; }
.portal-v2 .portal-billing-summary strong { color: var(--portal-ink); font-size: 25px; }
.portal-v2 .portal-billing-summary span { color: var(--portal-muted); font-size: 13px; }
.portal-v2 .portal-wallet-summary > div { align-items: center; background: linear-gradient(135deg,#fff,#faf6fc); border: 1px solid var(--portal-border); border-radius: 18px; display: flex; gap: 15px; padding: 20px 24px; }
.portal-v2 .portal-wallet-summary span { display: grid; gap: 3px; }
.portal-v2 .portal-wallet-summary strong { color: var(--portal-ink); font-size: 24px; }
.portal-v2 .portal-wallet-grid { display: grid; gap: 18px; grid-template-columns: repeat(2,minmax(0,1fr)); }
.portal-v2 .portal-wallet-grid .portal-section-card { margin: 0; }
.portal-v2 .portal-wallet-wide { grid-column: 1 / -1; }
.portal-v2 .portal-wallet-list article { background: #faf8fb; border-radius: 14px; padding: 16px; }
.portal-v2 .portal-wallet-list article > div:first-child { display: grid; gap: 3px; }
.portal-v2 .portal-wallet-list article span, .portal-v2 .portal-wallet-list article p { color: var(--portal-muted); font-size: 12px; }
.portal-v2 .portal-wallet-list article p { margin: 6px 0 0; }
.portal-v2 .portal-session-meter { background: #ebe4ee; border-radius: 99px; height: 7px; margin-top: 12px; overflow: hidden; }
.portal-v2 .portal-session-meter b { background: linear-gradient(90deg,#632489,#a36cba); display: block; height: 100%; width: var(--progress); }
.portal-v2 .portal-product-grid { display: grid; gap: 12px; grid-template-columns: repeat(2,minmax(0,1fr)); }
.portal-v2 .portal-product-grid article { background: #faf8fb; border: 1px solid #eee7f1; border-radius: 15px; display: flex; flex-direction: column; padding: 17px; }
.portal-v2 .portal-product-grid article > span { color: var(--portal-purple); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.portal-v2 .portal-product-grid h3 { margin: 7px 0 4px; }
.portal-v2 .portal-product-grid p { color: var(--portal-muted); flex: 1; font-size: 12px; line-height: 1.45; }
.portal-v2 .portal-product-grid article > strong { font-size: 20px; margin-bottom: 12px; }
.portal-v2 .portal-gift-list { grid-template-columns: repeat(3,minmax(0,1fr)); }
.portal-v2 .portal-gift-list article { align-items: center; background: linear-gradient(135deg,#4f1a6e,#8d57a7); border-radius: 15px; color: #fff; display: grid; gap: 12px; grid-template-columns: 38px 1fr auto; padding: 17px; }
.portal-v2 .portal-gift-list article div { display: grid; }
.portal-v2 .portal-gift-list span { color: rgba(255,255,255,.7); font-size: 12px; }

.portal-v2 .portal-profile-summary-grid { display: grid; gap: 18px; grid-template-columns: repeat(2,minmax(0,1fr)); margin-bottom: 18px; }
.portal-v2 .portal-profile-summary-grid .portal-section-card { margin: 0; }
.portal-v2 .portal-profile-list { display: grid; gap: 0; margin: 0; }
.portal-v2 .portal-profile-list > div { align-items: start; border-top: 1px solid #f0ebf2; display: grid; gap: 16px; grid-template-columns: 135px 1fr; padding: 12px 0; }
.portal-v2 .portal-profile-list > div:first-child { border-top: 0; }
.portal-v2 .portal-profile-list dt { color: #8a808f; font-size: 12px; font-weight: 700; }
.portal-v2 .portal-profile-list dd { color: var(--portal-ink); margin: 0; text-align: right; }
.portal-v2 .portal-action-card { align-items: center; display: grid; gap: 16px; grid-template-columns: 48px 1fr auto; }
.portal-v2 .portal-action-card h2 { font-size: 20px; margin: 4px 0; }
.portal-v2 .portal-action-card p { color: var(--portal-muted); font-size: 13px; line-height: 1.45; margin: 0; }

.portal-v2 dialog.portal-modal { border: 0; border-radius: 22px; box-shadow: 0 28px 80px rgba(30,15,38,.24); color: var(--portal-ink); max-height: min(88vh,900px); max-width: 680px; overflow: auto; padding: 28px; width: calc(100% - 32px); }
.portal-v2 dialog.portal-form-modal { max-width: 780px; }
.portal-v2 dialog.portal-modal::backdrop { backdrop-filter: blur(3px); background: rgba(39,28,44,.48); }
.portal-v2 .portal-dialog-close { position: sticky; right: 0; top: 0; z-index: 2; }
.portal-v2 .portal-dialog-close button { background: #f3edf5; border: 0; border-radius: 50%; cursor: pointer; display: flex; float: right; padding: 8px; }
.portal-v2 .portal-dialog-hero { padding: 8px 38px 18px 0; }
.portal-v2 .portal-dialog-hero h2 { font-size: 26px; margin: 6px 0; }
.portal-v2 .portal-dialog-hero p { color: var(--portal-muted); margin: 0; }
.portal-v2 .portal-book-payment { display: grid; gap: 10px; }
.portal-v2 .portal-payment-choice { align-items: center; background: #faf8fb; border: 1px solid var(--portal-border); border-radius: 14px; cursor: pointer; display: grid; gap: 12px; grid-template-columns: auto 36px 1fr auto; padding: 14px; }
.portal-v2 .portal-payment-choice.is-selected { background: #f5ecf8; border-color: #9b68b0; box-shadow: 0 0 0 2px rgba(112,45,141,.08); }
.portal-v2 .portal-payment-choice > i { color: var(--portal-purple); }
.portal-v2 .portal-payment-choice > span { display: grid; }
.portal-v2 .portal-payment-choice small { color: var(--portal-muted); }
.portal-v2 .portal-payment-choice > b { font-size: 13px; }
.portal-v2 .portal-dialog-section { background: #faf8fb; border-radius: 14px; margin: 14px 0; padding: 16px; }
.portal-v2 .portal-detail-grid { display: grid; gap: 10px; grid-template-columns: repeat(2,minmax(0,1fr)); }
.portal-v2 .portal-detail-grid > div { background: #faf8fb; border-radius: 12px; display: grid; gap: 3px; padding: 13px; }
.portal-v2 .portal-detail-grid small { color: var(--portal-muted); }

@media (max-width: 980px) {
    .portal-v2 .portal-summary-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .portal-v2 .portal-time-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
    .portal-v2 .portal-wallet-grid, .portal-v2 .portal-profile-summary-grid { grid-template-columns: 1fr; }
    .portal-v2 .portal-wallet-wide { grid-column: auto; }
    .portal-v2 .portal-gift-list { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 680px) {
    .portal-v2 .portal-home-hero { align-items: flex-start; flex-direction: column; padding: 28px 24px; }
    .portal-v2 .portal-summary-grid, .portal-v2 .portal-service-grid, .portal-v2 .portal-billing-summary, .portal-v2 .portal-wallet-summary { grid-template-columns: 1fr; }
    .portal-v2 .portal-time-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .portal-v2 .portal-book-steps b { display: none; }
    .portal-v2 .portal-appointment-row { grid-template-columns: 54px 1fr 18px; }
    .portal-v2 .portal-appointment-row .portal-status { display: none; }
    .portal-v2 .portal-product-grid, .portal-v2 .portal-gift-list { grid-template-columns: 1fr; }
    .portal-v2 .portal-action-card { align-items: start; grid-template-columns: 42px 1fr; }
    .portal-v2 .portal-action-card button { grid-column: 1 / -1; }
    .portal-v2 .portal-profile-list > div { grid-template-columns: 100px 1fr; }
    .portal-v2 .portal-data-table th, .portal-v2 .portal-data-table td { padding: 12px; white-space: nowrap; }
    .portal-v2 dialog.portal-modal { border-radius: 18px; padding: 20px; }
}

/* Reports workspace */
.reports-workspace {
    display: grid;
    gap: 14px;
    color: #2f2938;
}

.reports-titlebar,
.reports-title-actions,
.reports-filter-heading,
.reports-filter-actions,
.reports-card-header,
.reports-definition-note,
.reports-service-name,
.reports-service-values,
.reports-status-row > div:first-child,
.reports-channel-grid article > span,
.reports-compliance-list > div,
.reports-compliance-list > div > span {
    display: flex;
    align-items: center;
}

.reports-titlebar {
    justify-content: space-between;
    gap: 18px;
    min-height: 78px;
    border: 1px solid #dfd1ec;
    border-radius: 8px;
    padding: 15px 17px;
    background: linear-gradient(135deg, #ffffff 0%, #fbf9ff 58%, #f4eef9 100%);
    box-shadow: 0 10px 26px rgba(55, 30, 80, 0.08);
}

.reports-eyebrow,
.reports-card-header > div > span {
    display: block;
    color: var(--brand);
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.reports-titlebar h2 {
    margin: 2px 0 0;
    color: #2f2140;
    font-size: 1.55rem;
    line-height: 1.1;
}

.reports-titlebar p,
.reports-card-header p {
    margin: 4px 0 0;
    color: var(--muted);
}

.reports-titlebar p {
    font-size: 0.86rem;
}

.reports-title-actions {
    justify-content: flex-end;
    gap: 9px;
    flex-wrap: wrap;
}

.reports-period-chip {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1px solid #ded2e8;
    border-radius: 8px;
    padding: 0 11px;
    background: #fff;
    color: #564661;
    font-size: 0.78rem;
    font-weight: 850;
}

.reports-period-chip .ui-icon {
    width: 17px;
    height: 17px;
    color: var(--brand);
}

.reports-filter-panel {
    display: grid;
    grid-template-columns: minmax(190px, 0.85fr) minmax(0, 3fr) auto;
    gap: 13px;
    align-items: end;
    border: 1px solid #e5dced;
    border-radius: 8px;
    padding: 13px 14px;
    background: #fbfafc;
}

.reports-filter-heading {
    align-self: center;
    gap: 9px;
    min-width: 0;
}

.reports-filter-heading > span {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #eee5f6;
    color: var(--brand);
}

.reports-filter-heading strong,
.reports-filter-heading small {
    display: block;
}

.reports-filter-heading strong {
    font-size: 0.82rem;
}

.reports-filter-heading small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 0.68rem;
    line-height: 1.25;
}

.reports-filter-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(105px, 1fr));
    gap: 8px;
}

.reports-filter-grid label > span {
    display: block;
    margin: 0 0 4px 2px;
    color: #675873;
    font-size: 0.66rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.reports-filter-grid input,
.reports-filter-grid select {
    width: 100%;
    min-height: 36px;
    border: 1px solid #dcd3e4;
    border-radius: 7px;
    padding: 6px 8px;
    background: #fff;
    color: var(--text);
    font: inherit;
    font-size: 0.76rem;
}

.reports-filter-actions {
    justify-content: flex-end;
    gap: 7px;
}

.reports-filter-actions .btn {
    min-height: 36px;
    white-space: nowrap;
}

.reports-definition-note {
    gap: 8px;
    border: 1px solid #d8e8de;
    border-left: 3px solid #4a9567;
    border-radius: 7px;
    padding: 9px 12px;
    background: #f5fbf7;
    color: #456252;
    font-size: 0.75rem;
    line-height: 1.35;
}

.reports-definition-note .ui-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    color: #2d7b4c;
}

.reports-kpi-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
}

.reports-kpi {
    min-width: 0;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    border: 1px solid #e6dcef;
    border-radius: 8px;
    padding: 13px;
    background: #fff;
    box-shadow: 0 5px 14px rgba(55, 30, 80, 0.05);
}

.reports-kpi-icon {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #eee5f6;
    color: var(--brand);
}

.reports-kpi.is-primary .reports-kpi-icon {
    background: #e8e0f4;
}

.reports-kpi.is-warning .reports-kpi-icon {
    background: #fff2d7;
    color: #966214;
}

.reports-kpi.is-success .reports-kpi-icon {
    background: #e5f4ea;
    color: #28784a;
}

.reports-kpi small,
.reports-kpi strong,
.reports-kpi div > span {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.reports-kpi small {
    color: #6d5d78;
    font-size: 0.66rem;
    font-weight: 900;
    letter-spacing: 0.035em;
    text-transform: uppercase;
}

.reports-kpi strong {
    margin-top: 5px;
    color: #25323a;
    font-size: 1.28rem;
    line-height: 1;
}

.reports-kpi div > span {
    margin-top: 5px;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 750;
}

.reports-kpi .reports-trend.positive {
    color: #28784a;
}

.reports-kpi .reports-trend.negative {
    color: #a64a3f;
}

.reports-micro-metrics {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    overflow: hidden;
    border: 1px solid #e6dcef;
    border-radius: 8px;
    background: #faf8fc;
}

.reports-micro-metrics > div {
    min-width: 0;
    padding: 10px 13px;
    border-left: 1px solid #e6dcef;
}

.reports-micro-metrics > div:first-child {
    border-left: 0;
}

.reports-micro-metrics span,
.reports-micro-metrics strong {
    display: block;
}

.reports-micro-metrics span {
    color: var(--muted);
    font-size: 0.67rem;
    font-weight: 800;
}

.reports-micro-metrics strong {
    margin-top: 3px;
    color: #3d3048;
    font-size: 0.94rem;
}

.reports-grid {
    display: grid;
    gap: 14px;
}

.reports-grid-primary {
    grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.8fr);
}

.reports-grid-secondary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.reports-grid-bottom {
    grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.55fr);
}

.reports-card {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 15px;
    background: #fff;
    box-shadow: var(--shadow);
}

.reports-card-header {
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 13px;
}

.reports-card-header h3 {
    margin: 2px 0 0;
    color: #2f2140;
    font-size: 1rem;
}

.reports-card-header p {
    font-size: 0.73rem;
    line-height: 1.35;
}

.reports-card-header > a {
    flex: 0 0 auto;
    border: 1px solid #ddd2e7;
    border-radius: 7px;
    padding: 5px 8px;
    background: #fbf9fd;
    color: var(--brand);
    font-size: 0.68rem;
    font-weight: 900;
}

.reports-card-header > a:hover {
    border-color: #bda9cf;
    background: #f3edf8;
}

.reports-service-list,
.reports-status-list,
.reports-value-list,
.reports-compliance-list {
    display: grid;
    gap: 9px;
}

.reports-service-row {
    display: grid;
    grid-template-columns: minmax(150px, 0.75fr) minmax(180px, 1fr);
    gap: 5px 16px;
    padding: 8px 0;
    border-bottom: 1px solid #eee8f2;
}

.reports-service-row:last-child {
    border-bottom: 0;
}

.reports-service-name,
.reports-service-values {
    justify-content: space-between;
    gap: 10px;
}

.reports-service-name {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
}

.reports-service-name strong {
    font-size: 0.82rem;
}

.reports-service-name span,
.reports-service-values span {
    color: var(--muted);
    font-size: 0.68rem;
}

.reports-service-values {
    align-items: flex-end;
}

.reports-service-values strong {
    color: #392643;
    font-size: 0.88rem;
}

.reports-bar {
    grid-column: 1 / -1;
    height: 7px;
    overflow: hidden;
    border-radius: 999px;
    background: #eee9f2;
}

.reports-bar > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #5f1696, #9b74bc);
}

.reports-status-row {
    display: grid;
    gap: 5px;
    padding: 7px 0;
}

.reports-status-row > div:first-child {
    justify-content: space-between;
    gap: 12px;
}

.reports-status-row > div:first-child strong {
    font-size: 0.9rem;
}

.reports-bar.is-status {
    grid-column: auto;
    height: 6px;
}

.reports-status-row small {
    color: var(--muted);
    font-size: 0.66rem;
    text-align: right;
}

.reports-table-card {
    padding-bottom: 9px;
}

.reports-table {
    width: 100%;
    border-collapse: collapse;
}

.reports-table th,
.reports-table td {
    padding: 9px 10px;
    border-bottom: 1px solid #eee8f2;
    font-size: 0.76rem;
    text-align: left;
    white-space: nowrap;
}

.reports-table th {
    color: #695974;
    background: #faf8fc;
    font-size: 0.65rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.reports-table tbody tr:last-child td {
    border-bottom: 0;
}

.reports-value-list > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 9px 0;
    border-bottom: 1px solid #eee8f2;
}

.reports-value-list > div:last-child {
    border-bottom: 0;
}

.reports-value-list span,
.reports-value-list small {
    display: block;
}

.reports-value-list span {
    font-size: 0.78rem;
    font-weight: 800;
}

.reports-value-list small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 0.66rem;
    font-weight: 700;
}

.reports-value-list strong {
    color: #3d3048;
    font-size: 0.86rem;
}

.reports-health-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
}

.reports-health-grid > div {
    border: 1px solid #e9e1ee;
    border-radius: 7px;
    padding: 11px;
    background: #fbfafc;
}

.reports-health-grid strong,
.reports-health-grid span {
    display: block;
}

.reports-health-grid strong {
    color: #4a225c;
    font-size: 1.12rem;
}

.reports-health-grid span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 0.66rem;
    font-weight: 800;
}

.reports-channel-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
}

.reports-channel-grid article {
    border: 1px solid #e9e1ee;
    border-radius: 7px;
    padding: 11px;
    background: #fbfafc;
}

.reports-channel-grid article > span {
    gap: 6px;
    color: #5b4668;
    font-size: 0.7rem;
    font-weight: 900;
    text-transform: uppercase;
}

.reports-channel-grid .ui-icon {
    width: 16px;
    height: 16px;
    color: var(--brand);
}

.reports-channel-grid strong,
.reports-channel-grid small {
    display: block;
}

.reports-channel-grid strong {
    margin-top: 7px;
    font-size: 1.18rem;
}

.reports-channel-grid small {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.65rem;
    line-height: 1.35;
}

.reports-usage-line {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 9px;
}

.reports-usage-line > span {
    border-radius: 999px;
    padding: 5px 8px;
    background: #eee8f5;
    color: #624c70;
    font-size: 0.63rem;
    font-weight: 750;
}

.reports-inventory-strip {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin: -3px 0 10px;
    color: var(--muted);
    font-size: 0.69rem;
}

.reports-inventory-strip strong {
    color: #4a3057;
}

.reports-compliance-list > div {
    justify-content: space-between;
    gap: 12px;
    border: 1px solid #e8e1ed;
    border-radius: 7px;
    padding: 10px;
    background: #fbfafc;
}

.reports-compliance-list > div.needs-attention {
    border-color: #ead6ad;
    background: #fffaf0;
}

.reports-compliance-list > div > span {
    gap: 8px;
    min-width: 0;
}

.reports-compliance-list .ui-icon {
    width: 17px;
    height: 17px;
    flex: 0 0 17px;
    color: var(--brand);
}

.reports-compliance-list strong,
.reports-compliance-list small {
    display: block;
}

.reports-compliance-list strong {
    font-size: 0.75rem;
}

.reports-compliance-list small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 0.63rem;
}

.reports-compliance-list b {
    color: #4b245f;
    font-size: 1rem;
}

.reports-empty {
    min-height: 180px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 7px;
    border: 1px dashed #dcd3e4;
    border-radius: 8px;
    padding: 20px;
    background: #fbfafc;
    color: var(--muted);
    text-align: center;
}

.reports-empty.is-compact {
    min-height: 130px;
}

.reports-empty .ui-icon {
    color: #9b85aa;
}

.reports-empty strong {
    color: #564661;
    font-size: 0.82rem;
}

.reports-empty span,
.reports-inline-empty {
    color: var(--muted);
    font-size: 0.72rem;
}

@media (max-width: 1240px) {
    .reports-filter-panel {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .reports-filter-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .reports-filter-actions {
        justify-content: flex-start;
    }

    .reports-kpi-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .reports-titlebar,
    .reports-grid-primary,
    .reports-grid-secondary,
    .reports-grid-bottom {
        grid-template-columns: 1fr;
    }

    .reports-titlebar {
        display: grid;
    }

    .reports-title-actions {
        justify-content: flex-start;
    }

    .reports-micro-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .reports-micro-metrics > div:nth-child(odd) {
        border-left: 0;
    }
}

@media (max-width: 620px) {
    .reports-filter-grid,
    .reports-kpi-grid,
    .reports-health-grid,
    .reports-channel-grid,
    .reports-micro-metrics {
        grid-template-columns: 1fr;
    }

    .reports-micro-metrics > div {
        border-top: 1px solid #e6dcef;
        border-left: 0;
    }

    .reports-micro-metrics > div:first-child {
        border-top: 0;
    }

    .reports-title-actions,
    .reports-title-actions .btn,
    .reports-period-chip,
    .reports-filter-actions,
    .reports-filter-actions .btn {
        width: 100%;
    }

    .reports-title-actions .btn,
    .reports-period-chip,
    .reports-filter-actions .btn {
        justify-content: center;
    }

    .reports-service-row {
        grid-template-columns: 1fr;
    }

    .reports-service-values {
        align-items: flex-start;
        flex-direction: column;
        gap: 2px;
    }
}

/* OmOffice-aligned POS terminal */
.content:has(.pos-terminal) {
    height: calc(100vh - var(--topbar-height));
    overflow: hidden;
    padding: 12px 18px;
}

.content-frame:has(.pos-terminal) {
    height: 100%;
    min-height: 0;
    margin-bottom: 0;
}

.content-surface:has(.pos-terminal) {
    height: 100%;
    min-height: 0;
    overflow: hidden;
    padding: 14px;
}

.pos-terminal.pos-register-form {
    height: 100%;
    min-height: 0;
    margin: 0;
}

.pos-terminal .pos-register-grid {
    grid-template-columns: minmax(0, 1fr) minmax(340px, 380px);
    width: 100%;
    max-width: 100%;
    height: 100%;
    min-height: 0;
    align-items: stretch;
    gap: 14px;
    overflow: hidden;
}

.pos-terminal .pos-register-catalog {
    grid-template-rows: auto auto auto;
    width: 100%;
    max-width: 100%;
    height: 100%;
    min-height: 0;
    align-content: start;
    gap: 12px;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    padding-right: 3px;
}

.pos-terminal .pos-sale-section {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    padding: 12px;
}

.pos-section-heading,
.pos-date-controls,
.pos-cart-header,
.pos-cart-title {
    display: flex;
    align-items: center;
}

.pos-section-heading,
.pos-cart-header {
    justify-content: space-between;
    gap: 12px;
}

.pos-section-heading {
    min-width: 0;
    margin-bottom: 8px;
}

.pos-section-heading h2,
.pos-cart-header h2 {
    margin: 0;
    color: #2f2938;
    font-size: 1rem;
    line-height: 1.2;
}

.pos-section-heading p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.pos-date-controls {
    gap: 7px;
    flex-wrap: nowrap;
}

.pos-date-controls input {
    width: 132px;
    height: 36px;
    min-height: 36px;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 5px 8px;
    background: #fff;
    font: inherit;
    font-size: 0.78rem;
}

.pos-icon-btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    color: var(--brand);
    cursor: pointer;
}

.pos-icon-btn:hover {
    border-color: #bda9cf;
    background: #f8f4fb;
}

.pos-appointment-rail {
    --pos-page-columns: 4;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: 96px;
    gap: 9px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
}

.pos-appointment-rail .pos-empty-rail {
    grid-column: 1 / -1;
    min-width: 0;
}

.pos-appointment-card {
    width: 100%;
    min-width: 0;
    height: 96px;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    grid-template-rows: 24px 21px 21px;
    column-gap: 10px;
    row-gap: 2px;
    align-items: center;
    border: 1px solid #ddd6e5;
    border-radius: 8px;
    padding: 10px;
    background: #fff;
    color: #2f2938;
    text-align: left;
    cursor: pointer;
}

.pos-appointment-card:hover,
.pos-appointment-card.is-selected {
    border-color: #8dbfa0;
    box-shadow: inset 0 0 0 1px rgba(60, 133, 87, 0.14);
}

.pos-appointment-card.is-selected {
    background: #eff8f2;
}

.pos-appointment-card.is-closed {
    opacity: 0.58;
    cursor: default;
}

.pos-appointment-avatar {
    grid-column: 1;
    grid-row: 1 / span 3;
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #eee5f6;
    color: var(--brand);
}

.pos-appointment-card strong,
.pos-appointment-card > span:not(.pos-appointment-avatar),
.pos-appointment-card small {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pos-appointment-card strong {
    grid-column: 2 / span 2;
    font-size: 0.87rem;
}

.pos-appointment-card > span:not(.pos-appointment-avatar) {
    grid-column: 2 / span 2;
    color: var(--muted);
    font-size: 0.78rem;
}

.pos-appointment-card small {
    grid-column: 2;
    color: var(--muted);
    font-size: 0.72rem;
}

.pos-appointment-card b {
    grid-column: 3;
    justify-self: end;
    color: #4b245f;
    font-size: 0.8rem;
}

.pos-empty-rail {
    min-height: 96px;
    min-width: 230px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border: 1px dashed #d9d1e1;
    border-radius: 8px;
    padding: 16px;
    color: var(--muted);
    background: #faf9fb;
}

.pos-empty-rail span {
    display: block;
}

.pos-quick-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    grid-template-rows: 72px;
    gap: 9px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
}

.pos-quick-grid button {
    min-width: 0;
    min-height: 72px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 5px;
    border: 1px solid #ddd6e5;
    border-radius: 8px;
    background: #fff;
    color: #332b3b;
    cursor: pointer;
}

.pos-quick-grid button:hover {
    border-color: #bda9cf;
    background: #faf7fc;
}

.pos-quick-grid button span {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #eee5f6;
    color: var(--brand);
}

.pos-quick-grid button strong {
    font-size: 0.79rem;
}

.pos-terminal .pos-paged-shelf {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) 28px;
    align-items: stretch;
    gap: 8px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
}

.pos-terminal .pos-appointment-shelf {
    height: 96px;
}

.pos-terminal .pos-product-shelf {
    height: auto;
    min-height: 336px;
}

.pos-terminal .pos-section-page {
    width: 28px;
    min-width: 28px;
    height: 100%;
    min-height: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ddd6e5;
    border-radius: 8px;
    padding: 0;
    background: #f8f7fa;
    color: var(--brand);
    cursor: pointer;
}

.pos-terminal .pos-section-page:not(:disabled):hover,
.pos-terminal .pos-section-page:not(:disabled):focus-visible {
    border-color: #bda9cf;
    background: #f2eaf8;
    outline: none;
}

.pos-terminal .pos-section-page:disabled {
    color: #c9c1ce;
    cursor: default;
}

.pos-terminal .pos-section-page .ui-icon {
    width: 16px;
    height: 16px;
}

.pos-terminal .pos-products-section .pos-product-grid {
    --pos-page-columns: 6;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-template-rows: repeat(2, 164px);
    grid-auto-rows: 164px;
    grid-auto-flow: row;
    gap: 8px;
    width: 100%;
    max-width: 100%;
    height: auto;
    min-height: 336px;
    max-height: none;
    align-content: start;
    overflow: hidden;
}

.pos-terminal .pos-products-section {
    min-height: 451px;
    display: grid;
    grid-template-rows: auto auto auto;
}

.pos-terminal input:not([type="hidden"]):not([type="radio"]):not([type="checkbox"]),
.pos-terminal select,
.pos-terminal .btn:not(.pos-complete-sale) {
    height: 36px;
    min-height: 36px;
}

.pos-terminal .pos-product-tools {
    align-items: end;
    gap: 9px;
    margin-bottom: 9px;
}

.pos-terminal .pos-product-tools .field {
    gap: 4px;
}

.pos-terminal .pos-product-tools label {
    line-height: 1.2;
}

.pos-terminal .pos-product-tile {
    width: 100%;
    min-width: 0;
    height: 164px;
    min-height: 164px;
    max-height: 164px;
    display: grid;
    grid-template-rows: 86px minmax(30px, 1fr) 20px;
    gap: 4px;
    padding: 7px;
    overflow: hidden;
}

.pos-terminal .pos-product-tile .pos-product-media {
    width: 100%;
    height: 86px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 7px;
    background: #f7f5f2;
    color: var(--muted);
}

.pos-terminal .pos-product-tile .pos-product-media img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.pos-terminal .pos-product-tile > strong {
    min-width: 0;
    display: -webkit-box;
    overflow: hidden;
    font-size: 0.78rem;
    line-height: 1.15;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.pos-terminal .pos-product-tile .pos-product-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    min-width: 0;
    color: inherit;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
}

.pos-terminal .pos-product-tile .pos-product-footer b {
    font-size: 0.82rem;
}

.pos-terminal .pos-product-tile .pos-product-footer em {
    min-width: 0;
    overflow: hidden;
    font-size: 0.68rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pos-terminal .pos-products-section .pos-empty-rail {
    grid-column: 1 / -1;
    align-self: start;
    justify-self: stretch;
    min-width: 0;
    min-height: 96px;
}

.pos-terminal .pos-register-cart {
    position: static;
    top: auto;
    height: 100%;
    min-height: 0;
    align-content: start;
    gap: 13px;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    padding: 15px;
}

.pos-cart-title {
    gap: 10px;
    min-width: 0;
}

.pos-cart-title > span {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #eee5f6;
    color: var(--brand);
}

.pos-cart-title small {
    display: block;
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
}

.pos-cart-title h2 {
    max-width: 250px;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pos-customer-block {
    display: grid;
    gap: 6px;
}

.pos-customer-block label,
.pos-tender-section > label {
    font-size: 0.78rem;
    font-weight: 900;
}

.pos-customer-required {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-left: 3px solid #d89b3d;
    padding: 10px 11px;
    color: #72511e;
    background: #fff9e9;
    font-size: 0.77rem;
    font-weight: 800;
}

.pos-customer-required[hidden],
.pos-selected-customer[hidden] {
    display: none;
}

.pos-customer-required strong,
.pos-customer-required span,
.pos-selected-customer span,
.pos-selected-customer strong,
.pos-selected-customer small {
    display: block;
}

.pos-customer-required span {
    margin-top: 2px;
    font-weight: 700;
}

.pos-selected-customer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid #d9d1e1;
    border-radius: 8px;
    padding: 10px 11px;
    background: #faf9fb;
}

.pos-selected-customer span {
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 900;
    text-transform: uppercase;
}

.pos-selected-customer strong {
    margin-top: 2px;
    color: #2f2938;
    font-size: 0.9rem;
}

.pos-selected-customer small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 0.72rem;
}

.pos-terminal .pos-cart-lines {
    max-height: 280px;
    overflow-y: auto;
}

.pos-terminal .pos-cart-line {
    grid-template-columns: minmax(0, 1fr) auto auto;
}

.pos-terminal .pos-payment-methods {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 7px;
}

.pos-terminal .pos-payment-methods .payment-method-card {
    position: relative;
    width: 100%;
    height: 56px;
    min-height: 56px;
    display: grid;
    grid-template-columns: 22px minmax(0, auto);
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 0 10px;
    background: #fff;
    color: #332b3b;
    font-size: 0.75rem;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
}

.pos-terminal .pos-payment-methods button.payment-method-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font: inherit;
}

.pos-terminal .pos-payment-methods .payment-method-card[hidden] {
    display: none;
}

.pos-terminal .pos-payment-methods .payment-method-card input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    opacity: 0;
    pointer-events: none;
}

.pos-terminal .pos-payment-methods .payment-method-card span {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--brand);
}

.pos-terminal .pos-payment-methods .payment-method-card span .ui-icon {
    width: 20px;
    height: 20px;
}

.pos-terminal .pos-payment-methods .payment-method-card:has(input:checked),
.pos-terminal .pos-payment-methods .payment-method-card.is-active {
    border-color: #c5adef;
    background: var(--brand-soft);
    color: var(--brand);
    box-shadow: inset 0 0 0 1px rgba(75, 0, 130, 0.1);
}

.pos-terminal .pos-payment-methods .payment-method-card:focus-within {
    outline: 2px solid rgba(75, 0, 130, 0.3);
    outline-offset: 2px;
}

.pos-tender-section,
.pos-value-tenders {
    display: grid;
    gap: 10px;
    border-top: 1px solid var(--line);
    padding-top: 12px;
}

.pos-terminal .pos-sale-summary {
    gap: 6px;
}

/* OmOffice receipt column */
.pos-terminal .pos-register-cart {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 12px 12px 14px;
}

.pos-terminal .pos-cart-header {
    flex: 0 0 auto;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 8px;
}

.pos-terminal .pos-cart-title {
    flex: 1 1 auto;
    gap: 8px;
}

.pos-terminal .pos-cart-title h2 {
    max-width: 100%;
    margin: 0;
    color: #2f2938;
    font-size: 0.9rem;
    font-weight: 900;
    line-height: 1.1;
}

.pos-cart-change {
    min-height: 28px;
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border: 0;
    border-radius: 999px;
    padding: 4px 8px;
    background: #f2e8fa;
    color: var(--brand);
    cursor: pointer;
    font: inherit;
    font-size: 0.72rem;
    font-weight: 900;
}

.pos-cart-change .ui-icon {
    width: 14px;
    height: 14px;
}

.pos-cart-change:hover,
.pos-cart-change:focus-visible {
    background: #eadcf7;
    outline: none;
}

.pos-cart-change[hidden],
.pos-void-transaction[hidden],
.pos-customer-actions[hidden] {
    display: none;
}

.pos-void-transaction {
    width: 34px;
    min-width: 34px;
    max-width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    overflow: hidden;
    border: 1px solid rgba(110, 44, 172, 0.12);
    border-radius: 50%;
    padding: 0;
    background: #f4ecfb;
    color: #202232;
    cursor: pointer;
    transition: width 0.18s ease, max-width 0.18s ease, color 0.18s ease, background-color 0.18s ease;
}

.pos-void-transaction span {
    display: inline-flex;
}

.pos-void-transaction strong {
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    font-size: 0.72rem;
    white-space: nowrap;
    transition: max-width 0.18s ease, opacity 0.18s ease;
}

.pos-void-transaction:hover,
.pos-void-transaction:focus-visible {
    width: 78px;
    min-width: 78px;
    max-width: 78px;
    gap: 6px;
    border-color: rgba(185, 28, 28, 0.2);
    border-radius: 999px;
    background: #fff1f2;
    color: #b91c1c;
    outline: none;
}

.pos-void-transaction:hover strong,
.pos-void-transaction:focus-visible strong {
    max-width: 34px;
    opacity: 1;
}

.pos-terminal .pos-customer-block {
    flex: 0 0 auto;
    gap: 8px;
    margin-bottom: 7px;
    padding: 0 0 8px;
    border-bottom: 1px solid var(--line);
}

.pos-terminal .pos-register-cart.has-customer .pos-customer-block {
    display: none;
}

.pos-terminal .pos-customer-required {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 9px;
    margin: 0;
    border: 1px solid #f0c36d;
    border-radius: 8px;
    padding: 9px 10px;
    background: #fff8e8;
    box-shadow: inset 3px 0 0 #c07b00;
    color: #6f4700;
}

.pos-terminal .pos-customer-required-icon {
    width: 26px;
    height: 26px;
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    background: #ffe8ae;
    color: #7a4d08;
}

.pos-terminal .pos-customer-required-icon .ui-icon {
    width: 15px;
    height: 15px;
}

.pos-terminal .pos-customer-required strong {
    font-size: 0.86rem;
    font-weight: 900;
    line-height: 1.15;
}

.pos-terminal .pos-customer-required span:not(.pos-customer-required-icon) {
    margin-top: 2px;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1.15;
}

.pos-customer-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.pos-customer-actions .btn {
    min-height: 34px;
    padding: 5px 8px;
    font-size: 0.72rem;
}

.pos-terminal .pos-cart-table {
    flex: 1 1 auto;
    min-height: 150px;
    margin: 4px 0 7px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff;
}

.pos-terminal.has-customer .pos-cart-table,
.pos-terminal .pos-register-cart.has-customer .pos-cart-table {
    min-height: 260px;
}

.pos-terminal .pos-cart-columns {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 76px 58px 22px;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    border-bottom: 1px solid var(--line);
    padding: 7px 9px;
    background: #faf8fb;
    color: #7c7484;
    font-size: 0.62rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.pos-terminal .pos-cart-columns span:nth-child(2) {
    text-align: center;
}

.pos-terminal .pos-cart-columns span:nth-child(3) {
    text-align: right;
}

.pos-terminal .pos-cart-lines {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    display: block;
    overflow-y: auto;
    margin: 0;
    padding: 0;
}

.pos-terminal .pos-empty-cart {
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 0;
    padding: 14px;
    background: #fbf9fd;
    color: #8b8493;
    font-size: 0.8rem;
    font-style: italic;
}

.pos-terminal .pos-cart-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 76px 58px 22px;
    align-items: center;
    gap: 8px;
    min-height: 56px;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    padding: 8px 9px;
    background: #fff;
}

.pos-terminal .pos-cart-line + .pos-cart-line {
    margin-top: 0;
}

.pos-terminal .pos-cart-line:last-child {
    border-bottom: 0;
}

.pos-terminal .pos-cart-line-details {
    min-width: 0;
}

.pos-terminal .pos-cart-line strong,
.pos-terminal .pos-cart-line > b {
    color: #2f2938;
    font-size: 0.72rem;
    font-weight: 850;
}

.pos-terminal .pos-cart-line > b {
    text-align: right;
    white-space: nowrap;
}

.pos-terminal .pos-cart-line span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 0.62rem;
}

.pos-terminal .pos-cart-qty {
    width: 76px;
    grid-template-columns: 22px 32px 22px;
    border-radius: 6px;
}

.pos-terminal .pos-cart-qty-cell {
    display: flex;
    align-items: center;
    justify-content: center;
}

.pos-terminal .pos-cart-qty-cell.is-empty {
    color: #aaa2b1;
    font-size: 0.72rem;
}

.pos-terminal .pos-cart-qty button,
.pos-terminal .pos-cart-qty input,
.pos-terminal .pos-cart-qty > span {
    min-height: 22px;
    height: 22px;
    padding: 0;
    font-size: 0.7rem;
}

.pos-terminal .pos-cart-qty > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    border-left: 1px solid #eee8f4;
    border-right: 1px solid #eee8f4;
    color: #33233f;
    font-weight: 900;
}

.pos-terminal .pos-cart-qty button:disabled {
    color: #b8b1bd;
    cursor: not-allowed;
}

.pos-cart-remove {
    width: 22px;
    height: 22px;
    border: 0;
    padding: 0;
    background: transparent;
    color: #b4232a;
    cursor: pointer;
    font-size: 1.05rem;
    line-height: 1;
}

.pos-cart-remove:hover,
.pos-cart-remove:focus-visible {
    color: #8f1720;
    outline: none;
}

.pos-terminal .pos-sale-summary {
    flex: 0 0 auto;
    gap: 0;
    margin-top: 4px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    padding: 8px 0;
}

.pos-terminal .pos-sale-summary div {
    margin: 2px 0;
    color: var(--muted);
    font-size: 0.74rem;
}

.pos-terminal .pos-sale-summary .total {
    margin-top: 5px;
    padding-top: 5px;
    color: #2f2938;
    font-size: 0.98rem;
}

.pos-terminal .pos-sale-summary .total strong {
    color: #2f2938;
}

.pos-terminal .pos-tender-section {
    flex: 0 0 auto;
    gap: 6px;
    margin-top: 7px;
    border-top: 0;
    padding-top: 5px;
}

.pos-payment-label {
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 900;
}

.pos-terminal .pos-payment-methods {
    gap: 8px;
    margin-top: 0;
}

.pos-terminal .pos-payment-methods .payment-method-card {
    height: 52px;
    min-height: 52px;
    border-radius: 10px;
}

.pos-compact-payment {
    margin-top: 4px;
    border: 0;
    border-radius: 0;
    padding: 5px 0;
    background: transparent;
}

.pos-compact-payment .form-grid {
    gap: 5px;
}

.pos-compact-payment label {
    font-size: 0.64rem;
}

.pos-compact-payment input {
    min-height: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 0.74rem;
}

.pos-terminal .pos-value-tenders {
    flex: 0 0 auto;
    border-top: 0;
    padding-top: 4px;
}

.pos-terminal .pos-complete-sale {
    flex: 0 0 auto;
    min-height: 40px;
    margin-top: auto;
    border-radius: 10px;
    padding: 0 12px;
    font-size: 0.82rem;
}

.pos-modal[hidden] {
    display: none;
}

.pos-modal {
    position: fixed;
    z-index: 500;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(29, 24, 34, 0.48);
}

.pos-modal-card {
    position: relative;
    width: min(440px, 100%);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    display: grid;
    gap: 14px;
    border: 1px solid #d9d1e1;
    border-radius: 8px;
    padding: 22px;
    background: #fff;
    box-shadow: 0 22px 70px rgba(24, 15, 30, 0.24);
}

.pos-modal-card.pos-modal-wide {
    width: min(680px, 100%);
}

.pos-gift-modal-card {
    width: min(680px, 100%);
    gap: 0;
    padding: 0;
}

.pos-gift-modal-header {
    position: sticky;
    z-index: 2;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 58px;
    border-bottom: 1px solid #eadff2;
    padding: 12px 16px;
    background: linear-gradient(180deg, #fbf7ff 0%, #f1e7fb 100%);
}

.pos-gift-modal-header .pos-modal-close {
    position: static;
    flex: 0 0 32px;
    border-radius: 50%;
    background: #f2e8fa;
    color: var(--brand);
}

.pos-gift-modal-header .pos-modal-close:hover,
.pos-gift-modal-header .pos-modal-close:focus-visible {
    background: #e5d4f2;
    outline: none;
}

.pos-gift-modal-body {
    display: grid;
    gap: 16px;
    padding: 20px;
}

.pos-gift-amount-options {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.pos-gift-amount-options button {
    min-height: 42px;
    border: 1px solid #d8e0eb;
    border-radius: 8px;
    background: #fff;
    color: #2f3747;
    cursor: pointer;
    font: inherit;
    font-weight: 850;
}

.pos-gift-amount-options button:hover,
.pos-gift-amount-options button:focus-visible,
.pos-gift-amount-options button.is-active {
    border-color: #c5adef;
    background: var(--brand-soft);
    color: var(--brand);
    outline: none;
}

.pos-gift-recipient-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px;
    gap: 8px;
}

.pos-gift-recipient-add {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #d8e0eb;
    border-radius: 8px;
    background: #f7fafc;
    color: var(--brand);
    cursor: pointer;
}

.pos-gift-recipient-add:hover,
.pos-gift-recipient-add:focus-visible {
    border-color: #c5adef;
    background: var(--brand-soft);
    outline: none;
}

.pos-gift-recipient-results {
    max-height: 220px;
    display: grid;
    gap: 8px;
    overflow-y: auto;
}

.pos-gift-recipient-results > button,
.pos-gift-recipient-empty {
    width: 100%;
    display: grid;
    gap: 3px;
    border: 1px solid #d8e0eb;
    border-radius: 8px;
    padding: 10px 12px;
    background: #fff;
    color: #2f3747;
    text-align: left;
}

.pos-gift-recipient-results > button {
    cursor: pointer;
    font: inherit;
}

.pos-gift-recipient-results > button:hover,
.pos-gift-recipient-results > button:focus-visible {
    border-color: #8dbfa0;
    background: #eff8f2;
    outline: none;
}

.pos-gift-recipient-results > button.is-best-match {
    border-color: #c5adef;
    background: #faf7ff;
}

.pos-gift-recipient-results strong {
    font-weight: 900;
}

.pos-gift-recipient-results span,
.pos-gift-recipient-empty {
    color: #627080;
    font-size: 0.75rem;
}

.pos-gift-recipient-empty {
    border-style: dashed;
    font-weight: 800;
}

.pos-gift-new-recipient {
    border: 1px solid #d8e0eb;
    border-radius: 8px;
    padding: 12px;
    background: #fbfdff;
}

.pos-gift-error {
    margin: -4px 0 0;
    border-left: 3px solid var(--danger);
    padding: 7px 10px;
    background: #fff5f7;
    color: var(--danger);
    font-size: 0.78rem;
    font-weight: 850;
}

.pos-gift-done {
    width: 100%;
}

.pos-customer-modal-card {
    width: min(540px, 100%);
}

.pos-package-sale-modal-card {
    width: min(560px, 100%);
}

.pos-package-client-results {
    max-height: 230px;
}

.pos-customer-search-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.pos-customer-search-heading small {
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 800;
}

.pos-customer-results {
    max-height: 360px;
    display: grid;
    gap: 7px;
    overflow-y: auto;
}

.pos-customer-results > button {
    width: 100%;
    min-height: 58px;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    border: 1px solid #ddd6e5;
    border-radius: 8px;
    padding: 10px;
    background: #fff;
    color: #2f2938;
    text-align: left;
    cursor: pointer;
}

.pos-customer-results > button:hover,
.pos-customer-results > button:focus-visible {
    border-color: #8dbfa0;
    background: #eff8f2;
    outline: none;
}

.pos-customer-results > button.is-best-match {
    border-color: #c5adef;
    background: #faf7ff;
}

.pos-customer-results > button > span {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #eee5f6;
    color: var(--brand);
}

.pos-customer-results strong,
.pos-customer-results small {
    display: block;
}

.pos-customer-results small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 0.74rem;
}

.pos-customer-no-results {
    min-height: 92px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed #d8cfe3;
    border-radius: 8px;
    padding: 14px;
    background: #fbf9fd;
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 800;
}

.pos-modal-card h2 {
    margin: 0;
    font-size: 1.1rem;
}

.pos-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 1.4rem;
    cursor: pointer;
}

.pos-amount-options {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.pos-amount-options button {
    min-height: 42px;
    border: 1px solid #d9d1e1;
    border-radius: 6px;
    background: #fff;
    color: var(--brand);
    font-weight: 900;
    cursor: pointer;
}

.pos-package-options,
.pos-package-template-list {
    display: grid;
    gap: 8px;
}

.pos-package-option {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    border: 1px solid #d9d1e1;
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
}

.pos-package-option:has(input:checked) {
    border-color: #8dbfa0;
    background: #eff8f2;
}

.pos-package-option span,
.pos-package-option small {
    display: block;
}

.pos-package-option small {
    margin-top: 3px;
    color: var(--muted);
}

.pos-package-settings {
    margin-top: 16px;
}

.pos-package-editor {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) 100px 120px 140px;
    align-items: end;
    gap: 10px;
    margin-top: 14px;
}

.pos-package-description {
    grid-column: span 2;
}

.pos-package-template-list {
    margin-top: 16px;
}

.pos-package-template-row {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.pos-package-template-row summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 14px;
    padding: 12px;
    cursor: pointer;
}

.pos-package-template-row summary strong,
.pos-package-template-row summary small {
    display: block;
}

.pos-package-template-row summary small,
.pos-package-template-row summary em {
    margin-top: 3px;
    color: var(--muted);
    font-size: 0.78rem;
    font-style: normal;
}

.pos-package-template-row .pos-package-editor {
    border-top: 1px solid var(--line);
    margin: 0;
    padding: 12px;
}

@media (max-width: 1120px) {
    .pos-terminal .pos-register-grid {
        grid-template-columns: minmax(0, 1fr) minmax(340px, 380px);
    }

    .pos-appointment-rail,
    .pos-quick-grid {
        --pos-page-columns: 3;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .pos-terminal .pos-products-section .pos-product-grid {
        --pos-page-columns: 4;
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .pos-package-editor {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 860px) {
    .content:has(.pos-terminal) {
        height: auto;
        min-height: calc(100vh - var(--topbar-height));
        overflow: visible;
        padding: 12px;
    }

    .content-frame:has(.pos-terminal),
    .content-surface:has(.pos-terminal),
    .pos-terminal.pos-register-form,
    .pos-terminal .pos-register-grid,
    .pos-terminal .pos-register-catalog,
    .pos-terminal .pos-register-cart {
        height: auto;
        min-height: 0;
        overflow: visible;
    }

    .pos-terminal .pos-register-catalog,
    .pos-terminal .pos-products-section {
        grid-template-rows: auto;
    }

    .pos-terminal .pos-products-section .pos-product-grid {
        --pos-page-columns: 3;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        grid-template-rows: repeat(2, 164px);
        grid-auto-rows: 164px;
        gap: 8px;
        height: auto;
        min-height: 336px;
        max-height: none;
    }

    .content-frame:has(.pos-terminal) {
        margin-bottom: 20px;
    }

    .pos-terminal .pos-register-grid {
        grid-template-columns: 1fr;
    }

    .pos-terminal .pos-register-cart {
        position: static;
    }

    .pos-package-editor {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .content-surface:has(.pos-terminal) {
        padding: 8px;
    }

    .pos-terminal .pos-products-section .pos-product-grid {
        --pos-page-columns: 2;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .pos-section-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .pos-date-controls {
        flex-wrap: wrap;
    }

    .pos-appointment-rail {
        --pos-page-columns: 1;
        grid-template-columns: 1fr;
    }

    .pos-quick-grid,
    .pos-terminal .pos-payment-methods,
    .pos-package-editor {
        --pos-page-columns: 2;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .pos-terminal .pos-product-tools,
    .pos-modal-card .form-grid {
        grid-template-columns: 1fr;
    }

    .pos-gift-amount-options {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .pos-package-description {
        grid-column: auto;
    }
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, sans-serif;
    font-size: 15px;
    line-height: 1.45;
    letter-spacing: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

.app-shell {
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 20;
    width: var(--sidebar-collapsed);
    min-height: 100vh;
    background: #f7f5fa;
    color: var(--text);
    overflow-x: hidden;
    overflow-y: auto;
    white-space: nowrap;
    transition: width 0.3s cubic-bezier(0.2, 0, 0, 1);
}

.sidebar::after {
    content: "";
    position: absolute;
    top: 47px;
    right: 0;
    bottom: 0;
    width: 3px;
    background: var(--line-strong);
    pointer-events: none;
}

.sidebar:hover,
.sidebar:focus-within {
    width: var(--sidebar-expanded);
}

.sidebar-logo {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 70px;
    padding: 10px 0;
    margin-bottom: 10px;
    color: var(--brand);
}

.logo-mark {
    width: 42px;
    height: 42px;
    border: 1px solid #cdb8ef;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 0.92rem;
    font-weight: 900;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(75, 0, 130, 0.08), 0 4px 12px rgba(44, 36, 58, 0.08);
    transition: opacity 0.25s ease;
}

.logo-expanded {
    position: absolute;
    left: 20px;
    right: 16px;
    top: 50%;
    display: flex;
    align-items: center;
    gap: 10px;
    transform: translateY(-50%);
    opacity: 0;
    visibility: hidden;
    color: #2f2140;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.brand-logo {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.logo-expanded strong,
.brand-copy strong {
    display: block;
    font-size: 1.25rem;
    line-height: 1;
}

.logo-expanded .brand-wordmark {
    font-size: 1.5rem;
}

.brand-copy .brand-wordmark {
    font-size: 1.32rem;
}

.brand-wordmark {
    display: inline-flex;
    align-items: baseline;
    color: #231629;
    font-weight: 850;
    letter-spacing: 0;
}

.brand-wordmark-accent {
    color: #5d2f88;
    font-style: normal;
    font-weight: 760;
}

.logo-expanded small,
.brand-copy > span {
    display: block;
    max-width: 190px;
    margin-top: 4px;
    overflow: hidden;
    color: var(--muted);
    font-size: 0.74rem;
    text-overflow: ellipsis;
}

.sidebar:hover .logo-collapsed,
.sidebar:focus-within .logo-collapsed {
    opacity: 0;
}

.sidebar:hover .logo-expanded,
.sidebar:focus-within .logo-expanded {
    opacity: 1;
    visibility: visible;
}

.nav {
    display: grid;
    gap: 0;
    padding-bottom: 18px;
}

.sidebar-button {
    min-height: 48px;
    display: flex;
    align-items: center;
    margin: 0 8px 6px;
    padding: 0 12px;
    overflow: hidden;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    font-weight: 800;
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.sidebar-button:hover,
.sidebar-button:focus-visible {
    border-color: var(--line-strong);
    background: var(--brand-hover);
    box-shadow: 0 4px 12px rgba(44, 36, 58, 0.06);
    outline: none;
}

.sidebar-button.is-active {
    border-color: #cdb8ef;
    background: var(--brand-soft);
    box-shadow: inset 0 0 0 1px rgba(75, 0, 130, 0.08), 0 6px 14px rgba(44, 36, 58, 0.07);
}

.ui-icon {
    width: 20px;
    height: 20px;
    display: block;
    flex: 0 0 20px;
}

.nav-icon {
    min-width: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    color: var(--brand);
}

.button-text {
    display: inline-block;
    color: var(--brand);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease 0.1s, visibility 0.2s ease 0.1s;
}

.sidebar:hover .button-text,
.sidebar:focus-within .button-text {
    opacity: 1;
    visibility: visible;
}

.main {
    min-width: 0;
    margin-left: var(--sidebar-collapsed);
    padding-top: var(--topbar-height);
    transition: margin-left 0.3s cubic-bezier(0.2, 0, 0, 1);
}

.sidebar:hover ~ .main,
.sidebar:focus-within ~ .main {
    margin-left: var(--sidebar-expanded);
}

.topbar {
    position: fixed;
    top: 0;
    left: var(--sidebar-collapsed);
    right: 0;
    z-index: 15;
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: #f7f5fa;
    border-bottom: 3px solid transparent;
    border-image: linear-gradient(to right, var(--line-strong), #eee8f5, var(--line-strong)) 1 stretch;
    transition: left 0.3s cubic-bezier(0.2, 0, 0, 1);
}

.sidebar:hover ~ .main .topbar,
.sidebar:focus-within ~ .main .topbar {
    left: var(--sidebar-expanded);
}

.top-nav-list {
    flex: 0 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    overflow-x: auto;
    padding: 5px 8px;
}

.top-nav-title {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    margin-right: 4px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: #2f2140;
    font-size: 0.9rem;
    font-weight: 900;
    box-shadow: 0 2px 8px rgba(44, 24, 64, 0.05);
}

.top-nav-item {
    height: 100%;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    overflow: hidden;
    white-space: nowrap;
    padding: 0 13px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--text);
    font-weight: 800;
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease, padding 0.3s ease;
}

.top-nav-icon {
    min-width: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--brand);
}

.top-nav-icon .ui-icon {
    width: 19px;
    height: 19px;
}

.top-nav-text {
    max-width: 0;
    margin-left: 0;
    opacity: 0;
    visibility: hidden;
    color: var(--text);
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: max-width 0.3s ease, opacity 0.3s ease 0.1s, visibility 0s linear 0.3s, margin-left 0.3s ease, color 0.2s ease;
}

.top-nav-item:hover,
.top-nav-item:focus-visible {
    border-color: var(--line-strong);
    background: var(--brand-hover);
    box-shadow: 0 4px 12px rgba(44, 36, 58, 0.06);
    outline: none;
}

.top-nav-item:hover .top-nav-text,
.top-nav-item:focus-visible .top-nav-text {
    max-width: 200px;
    margin-left: 8px;
    opacity: 1;
    visibility: visible;
    transition-delay: 0s, 0.1s, 0s, 0s, 0s;
}

.top-nav-item.is-active {
    border-color: #cdb8ef;
    background: var(--brand-soft);
    padding: 0 18px;
    box-shadow: inset 0 0 0 1px rgba(75, 0, 130, 0.08), 0 5px 14px rgba(44, 36, 58, 0.07);
}

.top-nav-item.is-active .top-nav-text {
    max-width: 200px;
    margin-left: 8px;
    opacity: 1;
    visibility: visible;
    transition-delay: 0s;
}

.profile-menu {
    position: relative;
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    margin-left: auto;
    margin-right: 20px;
    cursor: pointer;
    z-index: 20;
}

.profile-trigger {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid #cdb8ef;
    border-radius: 50%;
    background: var(--brand-soft);
    color: var(--brand);
    box-shadow: inset 0 0 0 1px rgba(75, 0, 130, 0.08), 0 4px 12px rgba(44, 36, 58, 0.08);
}

.profile-trigger-initials {
    font-size: 0.78rem;
    font-weight: 900;
}

.profile-dropdown {
    position: absolute;
    top: 44px;
    right: 0;
    min-width: 260px;
    overflow: hidden;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow-strong);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.profile-menu:hover .profile-dropdown,
.profile-menu:focus-within .profile-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.profile-header {
    padding: 14px 16px;
    border-bottom: 1px solid #eee8f5;
    background: #fbfafc;
}

.profile-header .name {
    color: var(--text);
    font-size: 1rem;
    font-weight: 900;
    line-height: 1.15;
}

.profile-header .email {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.86rem;
    overflow-wrap: anywhere;
}

.profile-links {
    display: grid;
    gap: 4px;
    padding: 8px;
}

.profile-links a,
.profile-links button {
    width: 100%;
    min-height: 38px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 0 10px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    font: inherit;
    font-weight: 800;
    text-align: left;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.profile-links a:hover,
.profile-links button:hover,
.profile-links a:focus-visible,
.profile-links button:focus-visible {
    border-color: var(--line-strong);
    background: var(--brand-hover);
    color: var(--brand);
    outline: none;
}

.profile-link-icon {
    width: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--brand);
}

.profile-link-icon .ui-icon {
    width: 18px;
    height: 18px;
}

.content {
    width: 100%;
    padding: 16px 18px 34px;
}

.content:has(.calendar-workspace-clean) {
    height: calc(100vh - var(--topbar-height));
    overflow: hidden;
    padding: 0;
}

.content:has(.soap-documentation-workspace) {
    height: calc(100vh - var(--topbar-height));
    overflow: hidden;
    padding: 12px 18px;
}

.content-frame {
    width: 100%;
    max-width: var(--frame-width);
    margin: 0 auto 28px;
    padding: 5px;
    border: 1px solid var(--brand-frame-line);
    border-radius: 10px;
    background: var(--brand-frame);
}

.content-frame:has(.calendar-workspace-clean) {
    height: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.content-frame:has(.soap-documentation-workspace) {
    height: 100%;
    max-width: none;
    margin: 0;
}

.content-surface {
    min-height: calc(100vh - 88px);
    padding: 18px;
    border-radius: 6px;
    background: #fff;
}

.content-surface:has(.calendar-workspace-clean) {
    height: 100%;
    min-height: 0;
    overflow: hidden;
    padding: 0;
    border-radius: 0;
}

.content-surface:has(.soap-documentation-workspace) {
    height: 100%;
    min-height: 0;
    overflow: hidden;
    padding: 14px;
}

.content-surface:has(.soap-documentation-workspace) .page-header {
    margin-bottom: 0;
}

.page-header {
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 14px;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 3px 12px rgba(44, 24, 64, 0.05);
}

.page-header h2,
.section-title {
    margin: 0;
    color: #2f2140;
    font-size: 1.35rem;
    line-height: 1.15;
}

.page-header p,
.muted {
    color: var(--muted);
}

.page-header p {
    margin: 4px 0 0;
}

.page-header-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.grid {
    display: grid;
    gap: 14px;
}

.grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 16px;
}

.panel.plain {
    box-shadow: none;
}

.panel h3 {
    margin: 0 0 12px;
    color: #2f2140;
    font-size: 1rem;
}

.stat {
    display: grid;
    gap: 6px;
}

.stat span {
    color: var(--brand);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.stat strong {
    color: var(--text);
    font-size: 1.75rem;
    line-height: 1;
}

.progress {
    width: 100%;
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #eee8f5;
}

.progress > span {
    display: block;
    height: 100%;
    background: var(--brand);
}

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

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    text-align: left;
    padding: 10px 8px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

.badge {
    min-height: 24px;
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    background: #f3eafd;
    color: var(--brand);
    font-size: 0.74rem;
    font-weight: 900;
}

.badge.success {
    background: #e3f4eb;
    color: var(--success);
}

.badge.warning {
    background: #fff2d8;
    color: var(--warning);
}

.badge.danger {
    background: #fff5f7;
    color: var(--danger);
}

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

form {
    margin: 0;
}

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

.form-grid.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field {
    display: grid;
    gap: 6px;
}

.field.full {
    grid-column: 1 / -1;
}

.field-hint {
    color: #6a7883;
    font-size: 0.76rem;
    font-weight: 800;
    line-height: 1.35;
}

label {
    color: #3a3142;
    font-size: 0.78rem;
    font-weight: 900;
}

input,
select,
textarea {
    width: 100%;
    min-height: 38px;
    border: 1px solid #dcd4e6;
    border-radius: 8px;
    padding: 8px 10px;
    background: #fff;
    color: var(--text);
    font: inherit;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #b58bd4;
    outline: 2px solid rgba(75, 0, 130, 0.12);
}

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

.checkbox-line {
    min-height: 34px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-line input {
    width: 16px;
    min-height: 16px;
}

.btn {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid #dcd4e6;
    border-radius: 8px;
    padding: 0 12px;
    background: linear-gradient(180deg, #ffffff 0%, #faf7fd 100%);
    color: #33233f;
    box-shadow: 0 2px 8px rgba(44, 24, 64, 0.06);
    cursor: pointer;
    font: inherit;
    font-size: 0.84rem;
    font-weight: 850;
    line-height: 1;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.btn:hover,
.btn:focus-visible {
    border-color: #b58bd4;
    background: #f8f1fc;
    color: var(--brand);
    outline: none;
}

.btn.primary {
    border-color: var(--brand-strong);
    background: var(--brand-strong);
    color: #fff;
    box-shadow: 0 6px 14px rgba(75, 0, 130, 0.16);
}

.btn.primary:hover,
.btn.primary:focus-visible {
    border-color: var(--brand);
    background: var(--brand);
    color: #fff;
}

.btn.danger {
    border-color: #f3c5cf;
    background: #fff5f7;
    color: var(--danger);
}

.btn.danger:hover,
.btn.danger:focus-visible {
    border-color: #eaa4af;
    background: #ffe9ee;
    color: #981b1b;
}

.btn.small {
    min-height: 30px;
    padding: 0 9px;
    font-size: 0.76rem;
}

.btn:disabled,
.btn[aria-disabled="true"] {
    border-color: #e7dfec;
    background: #f3eef7;
    color: #978aa0;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.btn.primary:disabled,
.btn.primary[aria-disabled="true"] {
    border-color: #d8c4e8;
    background: #d8c4e8;
    color: #ffffff;
}

.flash-stack {
    display: grid;
    gap: 8px;
    margin-bottom: 14px;
}

.flash {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 12px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(44, 24, 64, 0.04);
}

.flash.success {
    border-color: #bfe5cf;
    background: #ecf9f1;
}

.flash.error {
    border-color: #f0c4c4;
    background: #fff0f0;
}

.flash.info {
    border-color: #d8cfe3;
    background: #fbf7ff;
}

.om-toast-stack {
    position: fixed;
    top: 76px;
    right: 24px;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(380px, calc(100vw - 32px));
    pointer-events: none;
}

.om-toast {
    --om-toast-accent: #6e2cac;
    position: relative;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: start;
    overflow: hidden;
    padding: 14px 14px 12px;
    border: 1px solid rgba(110, 44, 172, 0.24);
    border-left: 5px solid var(--om-toast-accent);
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(249, 244, 255, 0.98));
    color: #2f1948;
    box-shadow: 0 18px 40px rgba(47, 25, 72, 0.18);
    opacity: 0;
    pointer-events: auto;
    transform: translateX(18px);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.om-toast.show {
    opacity: 1;
    transform: translateX(0);
}

.om-toast.success,
.om-toast.good {
    --om-toast-accent: #6e2cac;
}

.om-toast.error,
.om-toast.danger {
    --om-toast-accent: #b42318;
    border-color: rgba(180, 35, 24, 0.22);
}

.om-toast.warning,
.om-toast.warn {
    --om-toast-accent: #b54708;
    border-color: rgba(181, 71, 8, 0.22);
}

.om-toast.info {
    --om-toast-accent: #5b21b6;
}

.om-toast-icon {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--om-toast-accent);
    color: #fff;
    box-shadow: 0 6px 16px rgba(110, 44, 172, 0.25);
    font-size: 0.72rem;
    font-weight: 900;
    line-height: 1;
}

.om-toast-body {
    min-width: 0;
}

.om-toast-title {
    display: block;
    margin-bottom: 2px;
    font-size: 0.94rem;
    font-weight: 800;
    line-height: 1.2;
}

.om-toast-message {
    margin: 0;
    color: #5f5170;
    font-size: 0.88rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.om-toast-close {
    min-height: 0;
    border: 0;
    padding: 2px;
    background: transparent;
    color: #6b5c78;
    cursor: pointer;
    font: inherit;
    font-size: 1rem;
    line-height: 1;
}

.om-toast-close:hover,
.om-toast-close:focus-visible {
    color: var(--brand);
    outline: none;
}

.om-toast-progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--om-toast-accent), rgba(110, 44, 172, 0.22));
    transform-origin: left center;
    animation: om-toast-progress linear forwards;
}

@keyframes om-toast-progress {
    from {
        transform: scaleX(1);
    }

    to {
        transform: scaleX(0);
    }
}

@media (max-width: 700px) {
    .om-toast-stack {
        top: 68px;
        right: 12px;
        left: 12px;
        width: auto;
    }
}

.stack {
    display: grid;
    gap: 12px;
}

.list {
    display: grid;
    gap: 10px;
}

.list-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}

.financial-command-panel {
    border: 1px solid #dfd1ec;
    border-radius: 8px;
    padding: 16px;
    background: linear-gradient(135deg, #ffffff 0%, #fbf9ff 55%, #f5f1fa 100%);
    box-shadow: 0 12px 28px rgba(55, 30, 80, 0.08);
}

.financial-command-heading,
.financial-section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.financial-command-heading span:not(.badge),
.financial-section-heading span {
    display: block;
    color: var(--brand);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.financial-command-heading h3,
.financial-section-heading h3 {
    margin: 2px 0 0;
    color: #2f2140;
    font-size: 1rem;
}

.financial-metric-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.financial-metric-grid > div {
    min-width: 0;
    border: 1px solid #e6dcef;
    border-radius: 8px;
    padding: 13px 14px;
    background: #fff;
    box-shadow: 0 5px 14px rgba(55, 30, 80, 0.05);
}

.financial-metric-grid span,
.financial-metric-grid small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.financial-metric-grid span {
    color: #6d5d78;
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.financial-metric-grid strong {
    display: block;
    margin-top: 5px;
    color: #25323a;
    font-size: 1.35rem;
    line-height: 1;
}

.financial-metric-grid small {
    margin-top: 5px;
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 800;
}

.financial-tracker-panel table strong,
.financial-ledger-panel .list-row strong {
    display: block;
}

.financial-pos-transactions-panel {
    display: grid;
    gap: 14px;
    margin-top: 16px;
}

.financial-pos-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.financial-pos-summary > div {
    border: 1px solid #e6dcef;
    border-radius: 8px;
    padding: 12px 14px;
    background: #fff;
}

.financial-pos-summary span,
.financial-pos-summary strong {
    display: block;
}

.financial-pos-summary span {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.financial-pos-summary strong {
    margin-top: 4px;
    color: #25323a;
    font-size: 1.2rem;
}

.content-surface:has(.marketing-workspace) {
    padding: 0;
    overflow: hidden;
    background:
        linear-gradient(180deg, #f8faf9 0%, #ffffff 34%, #fbfafd 100%);
}

.marketing-workspace {
    display: grid;
    gap: 16px;
    padding: 18px;
    color: #25323a;
}

.marketing-hero {
    min-height: 232px;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.72fr);
    gap: 18px;
    align-items: stretch;
    overflow: hidden;
    border: 1px solid #d9e8e1;
    border-radius: 8px;
    padding: 22px;
    background:
        linear-gradient(125deg, rgba(255, 255, 255, 0.96) 0%, rgba(246, 251, 247, 0.96) 47%, rgba(255, 248, 235, 0.94) 100%),
        linear-gradient(90deg, rgba(49, 108, 99, 0.14), rgba(95, 22, 150, 0.1));
    box-shadow: 0 18px 38px rgba(35, 45, 42, 0.09);
}

.marketing-hero-copy {
    min-width: 0;
    display: grid;
    align-content: center;
    justify-items: start;
    gap: 12px;
}

.marketing-eyebrow,
.marketing-section-kicker {
    color: #2f6f63;
    font-size: 0.72rem;
    font-weight: 950;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.marketing-hero h2 {
    max-width: 760px;
    margin: 0;
    color: #17282e;
    font-size: clamp(2rem, 4vw, 3.35rem);
    line-height: 0.98;
    letter-spacing: 0;
}

.marketing-hero p {
    max-width: 690px;
    margin: 0;
    color: #52626a;
    font-size: 1.02rem;
    font-weight: 720;
}

.marketing-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 4px;
}

.marketing-hero-panel {
    min-width: 0;
    display: grid;
    gap: 12px;
    align-content: center;
}

.marketing-hero-panel > div {
    display: grid;
    gap: 6px;
    border: 1px solid rgba(68, 115, 105, 0.18);
    border-radius: 8px;
    padding: 18px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 12px 26px rgba(32, 49, 45, 0.08);
}

.marketing-hero-panel span,
.marketing-kpi-copy span,
.marketing-mini-row span {
    color: #687985;
    font-size: 0.74rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.marketing-hero-panel strong {
    color: #18292d;
    font-size: 1.35rem;
    line-height: 1.1;
}

.marketing-hero-panel small,
.marketing-kpi-copy small {
    color: #63727b;
    font-size: 0.82rem;
    font-weight: 780;
    line-height: 1.35;
}

.marketing-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.marketing-kpi,
.marketing-card {
    border: 1px solid #e0e7e4;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 10px 24px rgba(35, 45, 42, 0.07);
}

.marketing-kpi {
    min-height: 140px;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 16px;
}

.marketing-kpi-icon,
.marketing-rule-icon,
.marketing-playbook-list span {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #e6f3ef;
    color: #1f6d5e;
}

.marketing-kpi:nth-child(2) .marketing-kpi-icon {
    background: #eef1ff;
    color: #3854a3;
}

.marketing-kpi:nth-child(3) .marketing-kpi-icon {
    background: #fff0d6;
    color: #97630f;
}

.marketing-kpi:nth-child(4) .marketing-kpi-icon {
    background: #f4ecff;
    color: #6c259b;
}

.marketing-kpi-copy {
    min-width: 0;
    display: grid;
    gap: 5px;
}

.marketing-kpi-copy strong {
    color: #17282e;
    font-size: 1.9rem;
    line-height: 1;
}

.marketing-progress {
    width: 100%;
    height: 7px;
    overflow: hidden;
    border-radius: 999px;
    background: #e8eeec;
}

.marketing-progress > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #2f7d6f, #7a4fb2);
}

.marketing-mini-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 4px;
    padding-top: 9px;
    border-top: 1px solid #eef1f0;
}

.marketing-mini-row b {
    min-width: 0;
    overflow: hidden;
    color: #29363d;
    font-size: 0.8rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.marketing-main-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
    gap: 16px;
    align-items: start;
}

.marketing-side-stack,
.marketing-insight-grid,
.marketing-rule-grid,
.marketing-list,
.marketing-playbook-list {
    display: grid;
    gap: 12px;
}

.marketing-card {
    min-width: 0;
    padding: 16px;
}

.marketing-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.marketing-card-header h3 {
    margin: 3px 0 0;
    color: #18292d;
    font-size: 1.04rem;
    line-height: 1.15;
}

.marketing-channel-pill,
.marketing-count-badge,
.marketing-filter-pills span {
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #dbe8e4;
    border-radius: 999px;
    padding: 4px 9px;
    background: #f5fbf8;
    color: #2a6259;
    font-size: 0.76rem;
    font-weight: 900;
    white-space: nowrap;
}

.marketing-form,
.marketing-form-grid {
    display: grid;
    gap: 12px;
}

.marketing-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.marketing-form-grid.single {
    grid-template-columns: 1fr;
}

.marketing-form-grid .full {
    grid-column: 1 / -1;
}

.marketing-form input,
.marketing-form select,
.marketing-form textarea {
    min-height: 42px;
    border-color: #d9e3df;
    background: #fbfdfc;
}

.marketing-form textarea {
    min-height: 116px;
}

.marketing-form.compact textarea {
    min-height: 92px;
}

.marketing-two-fields {
    display: grid;
    grid-template-columns: minmax(120px, 0.48fr) minmax(0, 0.52fr);
    gap: 10px;
}

.marketing-builder-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 2px;
    padding-top: 14px;
    border-top: 1px solid #edf1ef;
}

.marketing-builder-footer > span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #63727b;
    font-size: 0.82rem;
    font-weight: 850;
}

.marketing-playbook {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(249, 252, 250, 0.98));
}

.marketing-playbook-list > div {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 11px;
    align-items: start;
    padding: 12px;
    border: 1px solid #e4ebe8;
    border-radius: 8px;
    background: #fff;
}

.marketing-playbook-list strong,
.marketing-playbook-list small {
    display: block;
}

.marketing-playbook-list strong,
.marketing-list-row strong,
.marketing-rule-card strong,
.marketing-campaign-name strong {
    color: #24333a;
    font-weight: 950;
}

.marketing-playbook-list small,
.marketing-list-row span,
.marketing-rule-card span,
.marketing-campaign-name span {
    margin-top: 2px;
    color: #65747c;
    font-size: 0.8rem;
    font-weight: 760;
    line-height: 1.35;
}

.marketing-campaigns {
    padding-bottom: 12px;
}

.marketing-filter-pills {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 7px;
}

.marketing-table-shell {
    overflow-x: auto;
    border: 1px solid #edf1ef;
    border-radius: 8px;
}

.marketing-table {
    min-width: 780px;
}

.marketing-table th {
    background: #f7faf9;
    color: #65747c;
}

.marketing-table td {
    padding: 13px 12px;
    border-bottom-color: #edf1ef;
}

.marketing-table tbody tr:hover {
    background: #fbfdfc;
}

.marketing-campaign-name {
    display: grid;
    gap: 2px;
}

.marketing-icon-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #34454d;
    font-size: 0.84rem;
    font-weight: 900;
}

.marketing-icon-label .ui-icon {
    width: 17px;
    height: 17px;
    color: #2f7d6f;
}

.marketing-pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    border: 1px solid #dcebe6;
    border-radius: 999px;
    padding: 0 10px;
    background: #f7fcfa;
    color: #2f6f63;
    font-size: 0.78rem;
    font-weight: 900;
    white-space: nowrap;
}

.marketing-table td:last-child {
    text-align: right;
}

.marketing-table td .btn {
    white-space: nowrap;
}

.marketing-program-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.marketing-automation-table {
    min-width: 1160px;
}

.marketing-rule-builder {
    display: grid;
    gap: 14px;
}

.marketing-rule-builder-section {
    display: grid;
    gap: 10px;
    border: 1px solid #edf1ef;
    border-radius: 8px;
    padding: 12px;
    background: #fbfdfc;
}

.marketing-rule-builder-section > span {
    color: #2f6f63;
    font-size: 0.72rem;
    font-weight: 950;
    letter-spacing: 0;
    text-transform: uppercase;
}

.marketing-section-help {
    color: #65747c;
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1.45;
    margin: -3px 0 2px;
}

.marketing-safeguards-section .field small {
    color: #65747c;
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1.35;
    margin-top: 5px;
}

.marketing-rule-builder .field[hidden] {
    display: none;
}

.marketing-insight-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.marketing-insight-grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.marketing-list {
    max-height: 360px;
    overflow: auto;
}

.marketing-list-row,
.marketing-rule-card {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid #edf1ef;
    border-radius: 8px;
    padding: 11px 12px;
    background: #fff;
}

.marketing-list-row > div,
.marketing-rule-card > div:not(.marketing-rule-icon) {
    min-width: 0;
    display: grid;
}

.marketing-list-row strong,
.marketing-list-row span,
.marketing-rule-card strong,
.marketing-rule-card span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.marketing-list-row b {
    color: #2f6f63;
    white-space: nowrap;
}

.marketing-rule-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.marketing-rule-card {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) auto;
}

.marketing-rule-icon {
    background: #eef1ff;
    color: #3854a3;
}

.loyalty-ladder-list {
    display: grid;
    gap: 10px;
}

.loyalty-ladder-row {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) auto auto auto;
    align-items: center;
    gap: 12px;
    min-height: 74px;
    border: 1px solid #edf1ef;
    border-radius: 8px;
    padding: 12px;
    background: #fff;
}

.loyalty-ladder-row:hover {
    border-color: #d8e7e1;
    background: #fbfdfc;
}

.loyalty-ladder-row.is-reward {
    border-color: #eee6f5;
}

.loyalty-ladder-row.is-reward:hover {
    border-color: #ddcaed;
    background: #fdfaff;
}

.loyalty-ladder-icon {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #eef9f4;
    color: #2f6f63;
}

.loyalty-ladder-row.is-reward .loyalty-ladder-icon {
    background: #f7efff;
    color: var(--brand);
}

.loyalty-ladder-copy {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.loyalty-ladder-copy strong {
    overflow: hidden;
    color: #25343b;
    font-size: 0.93rem;
    font-weight: 950;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.loyalty-ladder-copy span {
    overflow: hidden;
    color: #65747c;
    font-size: 0.8rem;
    font-weight: 850;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.loyalty-ladder-metric {
    min-width: 82px;
    display: grid;
    justify-items: end;
    gap: 1px;
}

.loyalty-ladder-metric strong {
    color: #2f6f63;
    font-size: 1.08rem;
    font-weight: 950;
}

.loyalty-ladder-row.is-reward .loyalty-ladder-metric strong {
    color: var(--brand);
}

.loyalty-ladder-metric span {
    color: #65747c;
    font-size: 0.72rem;
    font-weight: 850;
}

.marketing-empty {
    border: 1px dashed #d8e5df;
    border-radius: 8px;
    padding: 14px;
    background: #fbfdfc;
    color: #65747c;
    font-weight: 820;
}

@media (max-width: 1150px) {
    .marketing-hero,
    .marketing-main-grid,
    .marketing-insight-grid,
    .marketing-insight-grid.two {
        grid-template-columns: 1fr;
    }

    .marketing-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

}

@media (max-width: 760px) {
    .marketing-workspace {
        padding: 12px;
        overflow-x: hidden;
    }

    .marketing-hero,
    .marketing-titlebar,
    .marketing-kpi,
    .marketing-card {
        width: 100%;
        max-width: calc(100vw - 48px);
        justify-self: center;
    }

    .marketing-hero {
        min-height: 0;
        padding: 16px;
    }

    .marketing-hero h2 {
        max-width: 12ch;
        font-size: 1.88rem;
    }

    .marketing-hero-copy {
        justify-items: stretch;
    }

    .marketing-hero p {
        max-width: 31ch;
        font-size: 0.95rem;
        overflow-wrap: anywhere;
    }

    .marketing-hero-actions,
    .marketing-builder-footer,
    .marketing-card-header {
        align-items: stretch;
        flex-direction: column;
    }

    .loyalty-ladder-row {
        grid-template-columns: 40px minmax(0, 1fr) auto;
    }

    .loyalty-ladder-icon {
        grid-row: 1 / 3;
    }

    .loyalty-ladder-copy {
        grid-column: 2;
    }

    .loyalty-ladder-metric {
        grid-column: 2;
        grid-row: 2;
        justify-items: start;
    }

    .loyalty-ladder-row .badge {
        grid-column: 3;
        grid-row: 1;
        justify-self: end;
    }

    .loyalty-ladder-row .btn {
        grid-column: 3;
        grid-row: 2;
        justify-self: end;
    }

    .marketing-hero-actions {
        width: min(100%, 320px);
    }

    .marketing-hero-actions .btn,
    .marketing-builder-footer .btn,
    .marketing-form .btn {
        width: 100%;
    }

    .marketing-kpis,
    .marketing-form-grid,
    .marketing-two-fields,
    .marketing-rule-grid,
    .marketing-program-grid {
        grid-template-columns: 1fr;
    }

    .marketing-kpi {
        min-height: 0;
    }

    .marketing-filter-pills {
        justify-content: flex-start;
    }

    .marketing-list {
        max-height: none;
    }
}

.marketing-titlebar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    align-items: start;
    padding: 18px;
    border: 1px solid #e0e7e4;
    border-radius: 8px;
    background:
        linear-gradient(120deg, rgba(255, 255, 255, 0.98), rgba(247, 252, 249, 0.98)),
        linear-gradient(90deg, rgba(47, 111, 99, 0.1), rgba(95, 22, 150, 0.08));
    box-shadow: 0 10px 24px rgba(35, 45, 42, 0.06);
}

.marketing-titlebar > * {
    min-width: 0;
}

.marketing-titlebar h2 {
    max-width: 760px;
    margin: 3px 0 0;
    color: #17282e;
    font-size: 1.62rem;
    line-height: 1.08;
}

.marketing-titlebar p {
    max-width: 760px;
    margin: 6px 0 0;
    color: #63727b;
    font-size: 0.92rem;
    font-weight: 780;
}

.marketing-workspace [id] {
    scroll-margin-top: calc(var(--topbar-height) + 16px);
}

.marketing-subnav {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
}

.marketing-subnav a {
    min-width: 0;
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #dbe8e4;
    border-radius: 8px;
    padding: 0 10px;
    background: #fff;
    color: #2a6259;
    font-size: 0.8rem;
    font-weight: 900;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.marketing-subnav a:hover,
.marketing-subnav a:focus-visible {
    border-color: #b9d8cf;
    background: #f3fbf7;
    outline: none;
}

.marketing-recommendations {
    background: linear-gradient(180deg, #ffffff, #fbfdfc);
}

.marketing-recommendation-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.marketing-recommendation {
    min-width: 0;
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    border: 1px solid #edf1ef;
    border-radius: 8px;
    padding: 12px;
    background: #fff;
}

.marketing-recommendation > span {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #e6f3ef;
    color: #1f6d5e;
}

.marketing-recommendation:nth-child(2) > span {
    background: #eef1ff;
    color: #3854a3;
}

.marketing-recommendation:nth-child(3) > span {
    background: #fff0d6;
    color: #97630f;
}

.marketing-recommendation strong,
.marketing-recommendation small {
    display: block;
    min-width: 0;
}

.marketing-recommendation strong {
    color: #24333a;
    font-weight: 950;
}

.marketing-recommendation small {
    margin-top: 3px;
    color: #65747c;
    font-size: 0.8rem;
    font-weight: 760;
    line-height: 1.35;
}

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

.marketing-edit-card {
    min-width: 0;
    display: grid;
    gap: 14px;
    border: 1px solid #edf1ef;
    border-radius: 8px;
    padding: 14px;
    background: #fff;
}

.marketing-edit-card-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.marketing-edit-card-heading strong,
.marketing-edit-card-heading span {
    display: block;
}

.marketing-edit-card-heading strong {
    color: #24333a;
    font-size: 0.98rem;
    font-weight: 950;
}

.marketing-edit-card-heading span:not(.badge) {
    margin-top: 3px;
    color: #65747c;
    font-size: 0.82rem;
    font-weight: 760;
}

.marketing-edit-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.marketing-edit-grid label {
    min-width: 0;
    display: grid;
    gap: 6px;
    color: #433650;
    font-size: 0.78rem;
    font-weight: 900;
}

.marketing-edit-grid input,
.marketing-edit-grid select,
.marketing-edit-grid textarea {
    width: 100%;
    min-width: 0;
}

.marketing-edit-grid textarea {
    min-height: 96px;
}

.marketing-edit-grid .full {
    grid-column: 1 / -1;
}

.marketing-edit-toggle {
    align-self: end;
    min-height: 42px;
    display: inline-flex !important;
    grid-auto-flow: column;
    justify-content: start;
    align-items: center;
    gap: 8px !important;
    border: 1px solid #e1e5e8;
    border-radius: 8px;
    padding: 9px 11px;
    background: #f8f9fa;
}

.marketing-edit-toggle input {
    width: 16px;
    height: 16px;
}

.marketing-edit-actions {
    display: flex;
    justify-content: flex-end;
}

.marketing-fab-ladder {
    position: fixed;
    right: 26px;
    bottom: 26px;
    z-index: 60;
    display: grid;
    justify-items: end;
    gap: 14px;
}

.floating-add-button.marketing-floating-add {
    position: static;
    right: auto;
    bottom: auto;
    z-index: auto;
}

.marketing-fab-actions {
    display: grid;
    gap: 9px;
    justify-items: end;
    opacity: 0;
    pointer-events: none;
    padding-bottom: 12px;
    transform: translateY(8px);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.marketing-fab-ladder:hover .marketing-fab-actions,
.marketing-fab-ladder:focus-within .marketing-fab-actions {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.marketing-fab-actions button {
    width: max-content;
    min-width: 0;
    max-width: none;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    border: 1px solid #e4dae9;
    border-radius: 999px;
    padding: 0 13px 0 12px;
    background: #fff;
    color: #3a2b48;
    box-shadow: 0 12px 28px rgba(44, 24, 64, 0.15);
    cursor: pointer;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 900;
    white-space: nowrap;
}

.marketing-fab-actions button span {
    min-width: max-content;
    overflow: visible;
    text-overflow: clip;
}

.marketing-fab-actions button:hover,
.marketing-fab-actions button:focus-visible {
    border-color: #cdb8ef;
    background: #fbf7ff;
    color: var(--brand);
    outline: none;
}

.marketing-fab-actions .ui-icon {
    order: -1;
    width: 16px;
    height: 16px;
    color: var(--brand);
}

.marketing-modal {
    width: min(820px, 100%);
}

.marketing-automation-modal {
    width: min(920px, 100%);
}

.marketing-automation-form {
    width: min(900px, 100%);
}

.marketing-program-modal {
    width: min(760px, 100%);
}

.marketing-program-modal-body {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 14px;
}

.marketing-program-rail {
    min-height: 168px;
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 9px;
    border: 1px solid #dbeee8;
    border-radius: 8px;
    padding: 14px;
    background: linear-gradient(180deg, #f4fcf8, #ffffff);
    color: #2f6f63;
}

.marketing-program-rail.is-reward {
    border-color: #eadbf7;
    background: linear-gradient(180deg, #fbf7ff, #ffffff);
    color: var(--brand);
}

.marketing-program-rail span {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(47, 111, 99, 0.1);
}

.marketing-program-rail.is-reward span {
    background: rgba(95, 22, 150, 0.1);
}

.marketing-program-rail strong {
    color: #25343b;
    font-size: 0.8rem;
    font-weight: 950;
    text-transform: uppercase;
}

.marketing-program-rail b {
    font-size: 1.28rem;
    font-weight: 950;
}

.marketing-program-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: start;
}

.marketing-program-fields input,
.marketing-program-fields select {
    min-height: 44px;
    height: 44px;
    padding: 0 12px;
    line-height: 1.2;
}

.marketing-modal-form textarea {
    min-height: 108px;
}

.marketing-modal-form .service-modal-actions {
    position: sticky;
    bottom: -20px;
    margin: 0 -20px -20px;
    padding: 12px 20px;
    border-top: 1px solid #eee4f5;
    background: rgba(255, 255, 255, 0.96);
}

@media (max-width: 1150px) {
    .marketing-titlebar,
    .marketing-recommendation-grid,
    .marketing-program-grid {
        grid-template-columns: 1fr;
    }

    .marketing-subnav {
        grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
    }

    .marketing-recommendation {
        grid-template-columns: 40px minmax(0, 1fr);
    }

    .marketing-recommendation .btn {
        grid-column: 1 / -1;
        justify-self: start;
    }

    .marketing-edit-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .marketing-titlebar {
        padding: 14px;
    }

    .marketing-titlebar h2 {
        max-width: 16ch;
        font-size: 1.35rem;
        overflow-wrap: anywhere;
    }

    .marketing-titlebar p {
        max-width: 32ch;
        overflow-wrap: anywhere;
    }

    .marketing-subnav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        max-width: 100%;
        gap: 6px;
    }

    .marketing-subnav a {
        min-height: 34px;
        padding: 0 6px;
        font-size: 0.72rem;
    }

    .marketing-subnav a[href="#automation"] {
        grid-column: 1 / -1;
    }

    .marketing-fab-ladder {
        right: 24px;
        bottom: 24px;
    }

    .marketing-fab-actions button {
        max-width: calc(100vw - 112px);
    }

    .marketing-program-modal-body {
        grid-template-columns: 1fr;
    }

    .marketing-program-rail {
        min-height: 0;
        grid-template-columns: auto minmax(0, 1fr) auto;
        align-items: center;
        align-content: center;
        justify-items: start;
    }

    .marketing-program-rail .ui-icon {
        margin-bottom: 0;
    }

    .marketing-program-fields {
        grid-template-columns: 1fr;
    }

    .marketing-edit-card-heading,
    .marketing-edit-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .marketing-edit-grid {
        grid-template-columns: 1fr;
    }

    .marketing-modal-backdrop {
        padding: 14px;
    }

    .marketing-modal-form .service-modal-actions {
        display: grid;
        grid-template-columns: 1fr;
    }
}

@media (max-width: 360px) {
    .marketing-subnav {
        grid-template-columns: 1fr;
    }

    .marketing-subnav a[href="#automation"] {
        grid-column: auto;
    }
}

.placeholder {
    border: 1px dashed #d8cfe3;
    border-radius: 8px;
    padding: 14px;
    background: var(--brand-frame);
    color: var(--muted);
}

.pos-terminal-grid {
    align-items: start;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
}

.pos-terminal h3,
.pos-subsection h4 {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pos-subsection {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(44, 24, 64, 0.04);
}

.pos-subsection h4 {
    margin: 0 0 12px;
    color: #2f2140;
    font-size: 0.95rem;
}

.payment-method-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.payment-method-card {
    min-height: 62px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid #dcd4e6;
    border-radius: 8px;
    padding: 10px;
    background: linear-gradient(180deg, #fff 0%, #faf7fd 100%);
    color: #33233f;
    cursor: pointer;
    font-weight: 900;
    box-shadow: 0 2px 8px rgba(44, 24, 64, 0.05);
}

.payment-method-card input {
    width: 16px;
    min-height: 16px;
}

.payment-method-card span {
    color: var(--brand);
}

.payment-method-card:has(input:checked) {
    border-color: #cdb8ef;
    background: var(--brand-soft);
    box-shadow: inset 0 0 0 1px rgba(75, 0, 130, 0.08), 0 6px 14px rgba(44, 36, 58, 0.07);
}

.pos-register-form {
    margin-top: 16px;
}

.pos-register-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.65fr);
    align-items: start;
    gap: 16px;
}

.pos-register-catalog,
.pos-register-cart,
.pos-inventory-panel {
    display: grid;
    gap: 14px;
}

.pos-register-cart {
    position: sticky;
    top: 86px;
}

.pos-panel-heading,
.pos-section-header-inline,
.pos-product-editor-actions,
.pos-product-edit-row summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.pos-panel-heading span,
.pos-section-header-inline span {
    display: block;
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.pos-panel-heading h3,
.pos-section-header-inline h4 {
    margin: 2px 0 0;
}

.pos-product-tools {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(170px, 0.35fr);
    gap: 10px;
    margin-bottom: 12px;
}

.pos-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(172px, 1fr));
    gap: 10px;
}

.pos-product-tile {
    min-height: 150px;
    display: grid;
    align-content: start;
    gap: 6px;
    border: 1px solid #dcd4e6;
    border-radius: 8px;
    padding: 12px;
    background: #fff;
    color: #2f2140;
    text-align: left;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(44, 24, 64, 0.05);
}

.pos-product-tile:hover {
    border-color: #b8d6c0;
    box-shadow: 0 8px 18px rgba(31, 80, 54, 0.09);
    transform: translateY(-1px);
}

.pos-product-tile span,
.pos-product-tile small,
.pos-product-tile em {
    color: var(--muted);
    font-size: 0.78rem;
    font-style: normal;
}

.pos-product-tile span {
    color: #20613e;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.pos-product-tile strong {
    line-height: 1.2;
}

.pos-product-tile b {
    font-size: 1.05rem;
}

.pos-product-tile.is-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.pos-cart-lines {
    display: grid;
    gap: 8px;
    min-height: 70px;
}

.pos-empty-cart {
    border: 1px dashed #d8cfe3;
    border-radius: 8px;
    padding: 14px;
    color: var(--muted);
    background: #fff;
}

.pos-cart-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
    background: #fff;
}

.pos-cart-line strong,
.pos-cart-line span {
    display: block;
}

.pos-cart-line span {
    margin-top: 2px;
    color: var(--muted);
    font-size: 0.8rem;
}

.pos-cart-qty {
    display: grid;
    grid-template-columns: 30px 52px 30px;
    border: 1px solid #dcd4e6;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.pos-cart-qty button,
.pos-cart-qty input {
    min-height: 32px;
    border: 0;
    text-align: center;
    background: #fff;
    font-weight: 900;
}

.pos-cart-qty button {
    cursor: pointer;
    color: var(--brand);
}

.pos-cart-qty input {
    border-left: 1px solid #eee8f4;
    border-right: 1px solid #eee8f4;
}

.pos-cart-details {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 12px;
    background: #fff;
}

.pos-cart-details summary {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 900;
}

.pos-cart-details .form-grid {
    margin-top: 12px;
}

.pos-payment-methods {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.pos-sale-summary {
    display: grid;
    gap: 8px;
    border-top: 1px solid var(--line);
    padding-top: 12px;
}

.pos-sale-summary div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
}

.pos-sale-summary strong {
    color: #2f2140;
}

.pos-sale-summary .total {
    color: #1f5138;
    font-size: 1.12rem;
    font-weight: 900;
}

.pos-sale-summary .total strong {
    color: #1f5138;
}

.pos-complete-sale {
    width: 100%;
    justify-content: center;
}

.pos-inventory-panel {
    margin-top: 16px;
}

.pos-product-editor {
    display: grid;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
    background: #fff;
}

.pos-product-editor.compact {
    margin-top: 12px;
}

.checkbox-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #33233f;
    font-weight: 800;
}

.checkbox-inline input {
    width: 16px;
    min-height: 16px;
}

.pos-product-list {
    display: grid;
    gap: 8px;
}

.pos-product-edit-row {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0;
    background: #fff;
}

.pos-product-edit-row summary {
    min-height: 52px;
    padding: 12px 14px;
    cursor: pointer;
}

.pos-product-edit-row summary span,
.pos-product-edit-row summary em {
    color: var(--muted);
    font-style: normal;
}

.pos-product-edit-row summary b {
    color: #1f5138;
}

.pos-inventory-stats {
    margin-top: 14px;
}

.pos-inventory-stat {
    min-height: 78px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.pos-inventory-stat > div > span,
.pos-inventory-stat > div > strong {
    display: block;
}

.pos-inventory-stat-icon {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #f1e8f8;
    color: var(--brand);
}

.pos-inventory-stat-icon.is-success {
    background: #e8f7ee;
    color: #23714a;
}

.pos-inventory-stat-icon.is-blue {
    background: #eaf1fb;
    color: #315f91;
}

.pos-inventory-stat-icon.is-warning {
    background: #fff3da;
    color: #9b6516;
}

.pos-inventory-workspace,
.pos-inventory-movements,
.pos-settings-form {
    margin-top: 16px;
}

.pos-inventory-workspace,
.pos-inventory-movements {
    padding: 0;
    overflow: hidden;
}

.pos-inventory-panel-header {
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid var(--line);
    padding: 14px 16px;
}

.pos-inventory-panel-header h3,
.pos-inventory-panel-header p {
    margin: 0;
}

.pos-inventory-panel-header h3 {
    color: #2f2938;
    font-size: 1rem;
}

.pos-inventory-panel-header p,
.pos-inventory-panel-header > strong {
    color: var(--muted);
    font-size: 0.78rem;
}

.pos-inventory-panel-header p {
    margin-top: 3px;
}

.pos-inventory-panel-header > strong {
    white-space: nowrap;
}

.pos-inventory-toolbar {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(150px, 0.22fr) minmax(170px, 0.25fr);
    align-items: end;
    gap: 10px;
    border-bottom: 1px solid var(--line);
    padding: 12px 16px;
    background: #fbfafd;
}

.pos-inventory-search {
    position: relative;
}

.pos-inventory-search > span {
    position: absolute;
    left: 11px;
    bottom: 10px;
    display: inline-flex;
    color: var(--muted);
    pointer-events: none;
}

.pos-inventory-search input {
    padding-left: 38px;
}

.pos-inventory-table-wrap {
    overflow-x: auto;
}

.pos-inventory-table {
    width: 100%;
    min-width: 1060px;
}

.pos-inventory-table th,
.pos-inventory-table td {
    padding: 10px 12px;
    vertical-align: middle;
}

.pos-inventory-table tbody tr:hover td {
    background: #fcfafd;
}

.pos-inventory-table td strong,
.pos-inventory-table td span {
    display: block;
}

.pos-inventory-table .numeric {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.pos-inventory-image,
.pos-inventory-upload-preview {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid #e4dce9;
    border-radius: 8px;
    background: #f5f1f7;
    color: var(--brand);
}

.pos-inventory-image img,
.pos-inventory-upload-preview img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.pos-inventory-product-cell {
    min-width: 260px;
}

.pos-inventory-product-cell > strong {
    color: #2f2938;
    font-size: 0.84rem;
}

.pos-inventory-product-cell > span {
    max-width: 340px;
    margin-top: 3px;
    overflow: hidden;
    color: var(--muted);
    font-size: 0.76rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pos-inventory-stock {
    width: fit-content;
    min-width: 46px;
    border-radius: 999px;
    padding: 4px 8px;
    text-align: center;
    font-size: 0.72rem;
    font-weight: 900;
}

.pos-inventory-stock.is-good {
    background: #e7f6ed;
    color: #1d6b43;
}

.pos-inventory-stock.is-low {
    background: #fff2d7;
    color: #915d0e;
}

.pos-inventory-stock.is-out {
    background: #fde7e7;
    color: #a82626;
}

.pos-inventory-actions {
    display: flex;
    gap: 6px;
    white-space: nowrap;
}

.pos-inventory-actions .btn {
    min-height: 32px;
    padding: 0 9px;
}

.pos-inventory-actions .ui-icon {
    width: 15px;
    height: 15px;
}

.pos-inventory-empty {
    padding: 38px !important;
    color: var(--muted);
    text-align: center;
}

body.has-inventory-modal {
    overflow: hidden;
}

.pos-inventory-modal {
    position: fixed;
    inset: 0;
    z-index: 1300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 22px;
    background: rgba(26, 22, 31, 0.54);
}

.pos-inventory-modal[hidden] {
    display: none;
}

.pos-inventory-modal-card {
    width: min(780px, 100%);
    max-height: min(90vh, 880px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #dccfea;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 24px 64px rgba(31, 22, 39, 0.3);
}

.pos-inventory-modal-card.is-small {
    width: min(500px, 100%);
}

.pos-inventory-modal-card > form {
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.pos-inventory-modal-header,
.pos-inventory-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
}

.pos-inventory-modal-header {
    align-items: flex-start;
    border-bottom: 1px solid #e9e1ee;
    padding: 18px 20px;
    background: linear-gradient(135deg, #fbf7fd 0%, #f5eef9 100%);
}

.pos-inventory-modal-header h2 {
    margin: 2px 0 0;
    color: #2f2938;
    font-size: 1.2rem;
}

.pos-inventory-modal-header p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.78rem;
}

.pos-inventory-modal-eyebrow {
    color: var(--brand);
    font-size: 0.65rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.pos-inventory-modal-body {
    display: grid;
    gap: 0;
    overflow-y: auto;
    padding: 0 20px;
}

.pos-inventory-modal-footer {
    justify-content: flex-end;
    border-top: 1px solid #e9e1ee;
    padding: 14px 20px;
    background: #fcfafc;
}

.pos-inventory-form-section {
    display: grid;
    gap: 14px;
    border-bottom: 1px solid #ebe5ef;
    padding: 20px 0;
}

.pos-inventory-form-section:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.pos-inventory-form-section h3 {
    margin: 0;
    color: #433a4d;
    font-size: 0.92rem;
}

.pos-inventory-section-heading {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
}

.pos-inventory-section-heading > span {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: #f1e8f8;
    color: var(--brand);
}

.pos-inventory-section-heading .ui-icon {
    width: 17px;
    height: 17px;
}

.pos-inventory-section-heading p {
    margin: 2px 0 0;
    color: var(--muted);
    font-size: 0.73rem;
}

.pos-product-editor .field > label span {
    color: var(--muted);
    font-size: 0.65rem;
    font-weight: 700;
}

.pos-product-editor .field > small {
    margin-top: 5px;
    color: var(--muted);
    font-size: 0.68rem;
    line-height: 1.35;
}

.pos-category-picker {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 42px;
    gap: 8px;
}

.pos-category-add-button {
    width: 42px;
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #cdb8dc;
    border-radius: 8px;
    background: #f7f1fa;
    color: var(--brand);
    cursor: pointer;
    transition: 0.16s ease;
}

.pos-category-add-button:hover,
.pos-category-add-button[aria-expanded="true"] {
    border-color: var(--brand);
    background: var(--brand);
    color: #fff;
}

.pos-category-manager {
    margin-top: 10px;
    overflow: hidden;
    border: 1px solid #dacde3;
    border-radius: 10px;
    background: #fcfafc;
    box-shadow: 0 10px 26px rgba(62, 34, 78, 0.09);
}

.pos-category-manager[hidden] {
    display: none;
}

.pos-category-manager-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid #e8e0ec;
    padding: 12px 14px;
    background: #f7f2fa;
}

.pos-category-manager-heading strong,
.pos-category-manager-heading span {
    display: block;
}

.pos-category-manager-heading strong {
    color: #3e3447;
    font-size: 0.78rem;
}

.pos-category-manager-heading span {
    margin-top: 2px;
    color: var(--muted);
    font-size: 0.68rem;
}

.pos-category-manager-heading button,
.pos-category-list-item > button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.pos-category-manager-heading button:hover,
.pos-category-list-item > button:hover {
    color: #a42626;
}

.pos-category-manager-heading .ui-icon,
.pos-category-list-item .ui-icon {
    width: 16px;
    height: 16px;
}

.pos-category-new-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    padding: 12px 14px;
}

.pos-category-list {
    max-height: 188px;
    overflow-y: auto;
    border-top: 1px solid #eee7f1;
}

.pos-category-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 14px;
    border-bottom: 1px solid #f0eaf3;
    background: #fff;
}

.pos-category-list-item:last-of-type {
    border-bottom: 0;
}

.pos-category-list-item strong,
.pos-category-list-item span {
    display: block;
}

.pos-category-list-item strong {
    color: #433a4d;
    font-size: 0.76rem;
}

.pos-category-list-item span {
    margin-top: 1px;
    color: var(--muted);
    font-size: 0.66rem;
}

.pos-category-list-empty,
.pos-category-feedback {
    margin: 0;
    color: var(--muted);
    font-size: 0.69rem;
}

.pos-category-list-empty {
    padding: 14px;
    text-align: center;
}

.pos-category-feedback {
    min-height: 30px;
    border-top: 1px solid #eee7f1;
    padding: 8px 14px;
}

.pos-money-input {
    position: relative;
}

.pos-money-input > span {
    position: absolute;
    z-index: 1;
    top: 50%;
    left: 12px;
    color: #655970;
    font-size: 0.8rem;
    font-weight: 800;
    transform: translateY(-50%);
    pointer-events: none;
}

.pos-money-input input {
    padding-left: 26px;
}

.pos-product-option {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    align-items: flex-start;
    gap: 9px;
    border: 1px solid #e3dae8;
    border-radius: 9px;
    padding: 11px 12px;
    background: #fbfafc;
    cursor: pointer;
}

.pos-product-option input {
    margin-top: 2px;
}

.pos-product-option strong,
.pos-product-option small {
    display: block;
}

.pos-product-option strong {
    color: #433a4d;
    font-size: 0.77rem;
}

.pos-product-option small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 0.68rem;
    line-height: 1.4;
}

.pos-inventory-checks {
    align-content: end;
    gap: 8px;
    padding-bottom: 6px;
}

.pos-inventory-upload {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    border: 1px dashed #d9cfe1;
    border-radius: 8px;
    padding: 12px;
    background: #fbfafc;
}

.pos-inventory-upload-preview {
    width: 72px;
    height: 72px;
}

.pos-inventory-upload .field small {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.7rem;
}

@media (min-width: 761px) {
    .pos-product-editor-extras .pos-inventory-upload {
        grid-template-columns: 72px minmax(0, 1fr);
    }
}

.pos-inventory-adjust-product {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid #ebe5ef;
    padding-bottom: 12px;
}

.pos-inventory-adjust-product strong,
.pos-inventory-adjust-product span {
    display: block;
}

.pos-inventory-adjust-product span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 0.78rem;
}

.pos-inventory-adjust-preview {
    border-left: 3px solid #8c63ad;
    padding: 9px 11px;
    background: #f7f2fa;
    color: #4b3e56;
    font-size: 0.8rem;
    font-weight: 800;
}

.pos-inventory-adjust-preview.is-invalid {
    border-left-color: #bc3636;
    background: #fff0f0;
    color: #9c2424;
}

.pos-settings-masthead {
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid #e6ddec;
    border-radius: 8px;
    padding: 6px 8px 6px 12px;
    background: #fff;
    box-shadow: 0 3px 12px rgba(44, 24, 64, 0.05);
}

.pos-settings-eyebrow {
    color: var(--brand);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.pos-settings-subnav {
    display: flex;
    justify-content: flex-end;
    gap: 7px;
    flex-wrap: wrap;
}

.pos-settings-subnav button {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid #ddd5e5;
    border-radius: 8px;
    padding: 0 11px;
    background: #fff;
    color: #3c3445;
    cursor: pointer;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 850;
    white-space: nowrap;
    box-shadow: 0 2px 7px rgba(44, 24, 64, 0.04);
}

.pos-settings-subnav button:hover,
.pos-settings-subnav button:focus-visible {
    border-color: #b99dcd;
    background: #faf6fc;
    color: var(--brand);
    outline: none;
}

.pos-settings-subnav button.is-active {
    border-color: #8d58b5;
    background: #f2e8f9;
    color: var(--brand);
    box-shadow: inset 0 0 0 1px rgba(110, 44, 172, 0.1);
}

.pos-settings-subnav .ui-icon {
    width: 17px;
    height: 17px;
}

.pos-settings-form {
    margin-top: 10px;
}

.pos-settings-page-section {
    margin-top: 10px;
    padding: 0;
    overflow: hidden;
}

.pos-settings-form .pos-settings-page-section {
    margin-top: 0;
}

.pos-settings-section-header {
    min-height: 82px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid var(--line);
    padding: 16px 18px;
}

.pos-settings-section-header h2,
.pos-settings-section-header p {
    margin: 0;
}

.pos-settings-section-header h2 {
    color: #2f2938;
    font-size: 1.35rem;
}

.pos-settings-section-header p {
    margin-top: 5px;
    color: var(--muted);
    font-size: 0.84rem;
}

.pos-settings-block {
    display: grid;
    gap: 16px;
    padding: 18px;
}

.pos-settings-block-heading {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: center;
    gap: 11px;
}

.pos-settings-block-heading h3,
.pos-settings-block-heading p {
    margin: 0;
}

.pos-settings-block-heading h3 {
    color: #372f40;
    font-size: 0.96rem;
}

.pos-settings-block-heading p {
    margin-top: 3px;
    color: var(--muted);
    font-size: 0.78rem;
}

.pos-settings-block-icon {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #f1e8f8;
    color: var(--brand);
}

.pos-settings-choice-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.pos-settings-choice {
    min-height: 92px;
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    align-items: start;
    gap: 10px;
    border: 1px solid #ddd6e5;
    border-radius: 8px;
    padding: 13px;
    background: #fbf9fc;
    cursor: pointer;
}

.pos-settings-choice:has(input:checked) {
    border-color: #b795ce;
    background: #f5eef9;
    box-shadow: inset 0 0 0 1px rgba(110, 44, 172, 0.08);
}

.pos-settings-choice input {
    margin-top: 2px;
}

.pos-settings-choice strong,
.pos-settings-choice small {
    display: block;
}

.pos-settings-choice strong {
    color: #362d40;
    font-size: 0.82rem;
}

.pos-settings-choice small {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.72rem;
    line-height: 1.35;
}

.pos-settings-payment-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.pos-settings-payment-method {
    min-height: 70px;
    display: grid;
    grid-template-columns: 18px 28px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    border: 1px solid #ddd6e5;
    border-radius: 8px;
    padding: 10px;
    background: #fff;
    cursor: pointer;
}

.pos-settings-payment-method:has(input:checked) {
    border-color: #b795ce;
    background: #f3e9fa;
}

.pos-settings-payment-method > span {
    display: inline-flex;
    color: var(--brand);
}

.pos-settings-payment-method strong {
    min-width: 0;
    font-size: 0.78rem;
}

.pos-settings-control-grid {
    display: grid;
    grid-template-columns: minmax(220px, 0.55fr) minmax(320px, 1fr);
    align-items: start;
    gap: 16px;
}

.pos-settings-toggle-list {
    display: grid;
    gap: 8px;
}

.pos-settings-toggle-list > label {
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border: 1px solid #e1d9e7;
    border-radius: 8px;
    padding: 9px 11px;
    background: #fbfafd;
    cursor: pointer;
}

.pos-settings-toggle-list strong,
.pos-settings-toggle-list small {
    display: block;
}

.pos-settings-toggle-list strong {
    color: #3c3445;
    font-size: 0.8rem;
}

.pos-settings-toggle-list small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 0.7rem;
}

.pos-settings-toggle-list input {
    width: 18px;
    min-width: 18px;
    min-height: 18px;
}

.pos-settings-section-actions {
    display: flex;
    justify-content: flex-end;
    border-top: 1px solid var(--line);
    padding: 12px 18px;
    background: #fbfafd;
}

.pos-package-catalog {
    margin: 18px;
    overflow: hidden;
    border: 1px solid #e3dce8;
    border-radius: 8px;
}

.pos-package-catalog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid #e3dce8;
    padding: 11px 13px;
    background: #fbfafd;
    color: #403748;
    font-size: 0.8rem;
}

.pos-package-catalog-header span {
    color: var(--muted);
}

.pos-package-table {
    width: 100%;
    min-width: 840px;
}

.pos-package-table td:first-child {
    min-width: 220px;
}

.pos-package-table td strong,
.pos-package-table td span {
    display: block;
}

.pos-package-table td span {
    max-width: 300px;
    margin-top: 3px;
    overflow: hidden;
    color: var(--muted);
    font-size: 0.74rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pos-settings-empty {
    padding: 34px !important;
    color: var(--muted);
    text-align: center;
}

body.has-pos-settings-modal {
    overflow: hidden;
}

.pos-settings-modal {
    position: fixed;
    inset: 0;
    z-index: 1300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 22px;
    background: rgba(26, 22, 31, 0.54);
}

.pos-settings-modal[hidden] {
    display: none;
}

.pos-settings-modal-card {
    width: min(650px, 100%);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #dccfea;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 24px 64px rgba(31, 22, 39, 0.3);
}

.pos-settings-modal-card > form {
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.pos-settings-modal-header,
.pos-settings-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
}

.pos-settings-modal-header {
    border-bottom: 1px solid #e9e1ee;
    background: #faf7fc;
}

.pos-settings-modal-header h2 {
    margin: 0;
    color: #2f2938;
    font-size: 1.05rem;
}

.pos-settings-modal-body {
    overflow-y: auto;
    padding: 16px;
}

.pos-settings-modal-footer {
    justify-content: flex-end;
    border-top: 1px solid #e9e1ee;
}

@media (max-width: 980px) {
    .pos-settings-masthead {
        align-items: flex-start;
        flex-direction: column;
    }

    .pos-settings-subnav {
        justify-content: flex-start;
        width: 100%;
    }

    .pos-settings-choice-grid {
        grid-template-columns: 1fr;
    }

    .pos-settings-payment-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .pos-settings-subnav {
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 3px;
    }

    .pos-settings-section-header {
        align-items: stretch;
        flex-direction: column;
    }

    .pos-settings-control-grid,
    .pos-settings-payment-grid {
        grid-template-columns: 1fr;
    }

    .pos-settings-section-actions .btn,
    .pos-settings-section-header .btn {
        width: 100%;
        justify-content: center;
    }

    .pos-settings-modal {
        align-items: flex-end;
        padding: 10px;
    }

    .pos-settings-modal-card {
        max-height: 94vh;
    }
}

.body-chart-workspace {
    display: grid;
    grid-template-columns: minmax(560px, 1.35fr) minmax(360px, 0.75fr);
    gap: 14px;
    align-items: start;
}

.body-chart-workspace.is-embedded {
    display: contents;
}

.body-chart-appointment-context {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 14px;
    padding: 12px;
}

.body-chart-appointment-context div,
.body-chart-locked-appointment {
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid #e3dce9;
    border-radius: 8px;
    background: #fbfdfe;
}

.body-chart-appointment-context span,
.body-chart-locked-appointment span,
.body-chart-locked-appointment small {
    display: block;
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 850;
}

.body-chart-appointment-context strong,
.body-chart-locked-appointment strong {
    display: block;
    margin-top: 4px;
    color: #26323a;
    font-size: 0.94rem;
    font-weight: 900;
}

.body-chart-locked-appointment small {
    margin-top: 4px;
}

.body-chart-appointment-picker {
    display: grid;
    gap: 14px;
    padding: 18px;
}

.body-chart-picker-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.body-chart-picker-heading h3 {
    margin: 0 0 4px;
}

.body-chart-picker-heading p {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 750;
}

.body-chart-appointment-list {
    display: grid;
    gap: 8px;
}

.body-chart-appointment-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 14px;
    border: 1px solid #e6dee9;
    border-radius: 8px;
    background: #fff;
    color: inherit;
    text-decoration: none;
}

.body-chart-appointment-card:hover,
.body-chart-appointment-card:focus-visible {
    border-color: #cdb8ef;
    background: #fbf7ff;
    outline: none;
}

.body-chart-appointment-card strong,
.body-chart-appointment-card span {
    display: block;
}

.body-chart-appointment-card strong {
    color: #26323a;
    font-size: 0.95rem;
}

.body-chart-appointment-card > div:first-child span {
    margin-top: 2px;
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 800;
}

.body-chart-appointment-card > div:last-child {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

.body-chart-map-panel,
.body-chart-editor-panel {
    padding: 0;
    overflow: hidden;
}

.body-chart-map-panel,
.body-chart-editor-panel,
.soap-note-panel {
    height: 100%;
}

.body-chart-map-panel {
    min-width: 0;
}

.body-chart-editor-panel {
    min-width: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    opacity: 1;
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.soap-documentation-workspace.has-body-chart:not(.body-editor-open) .body-chart-editor-panel {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateX(18px);
    border-color: transparent;
    box-shadow: none;
}

.body-chart-toolbar {
    min-height: 62px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    background: #fbfafc;
}

.body-chart-toolbar h3 {
    margin: 0 0 2px;
}

.body-chart-toolbar span {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 800;
}

.body-chart-view-switch {
    display: inline-flex;
    overflow: hidden;
    border: 1px solid #dcd4e6;
    border-radius: 8px;
    background: #fff;
}

.body-chart-view-switch button {
    min-width: 86px;
    min-height: 36px;
    border: 0;
    border-right: 1px solid #e8dfef;
    background: transparent;
    color: #3a2b48;
    cursor: pointer;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 900;
}

.body-chart-view-switch button:last-child {
    border-right: 0;
}

.body-chart-view-switch button.is-active {
    background: var(--brand);
    color: #fff;
}

.body-map-stage {
    position: relative;
    display: none;
    min-height: 720px;
    padding: 18px 138px 18px;
    background:
        linear-gradient(90deg, rgba(255, 248, 229, 0.35), rgba(255, 255, 255, 0) 22%, rgba(241, 249, 250, 0.4) 78%, rgba(245, 235, 255, 0.34)),
        #fff;
}

.body-map-stage.is-active {
    display: grid;
    place-items: center;
}

.body-chart-workspace.is-embedded .body-map-stage {
    height: calc(100% - 62px);
    min-height: 0;
    padding: 14px 92px;
}

.body-map-canvas {
    position: relative;
    width: min(440px, 100%);
    height: min(720px, calc(100vh - 260px));
    min-height: 620px;
    overflow: visible;
}

.body-chart-workspace.is-embedded .body-map-canvas {
    width: min(390px, 100%);
    height: min(100%, 620px);
    min-height: 0;
}

.body-map-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.body-zone {
    cursor: pointer;
    outline: none;
}

.body-zone path,
.body-zone ellipse,
.body-zone rect {
    fill: url(#body-fill-front);
    stroke: #d9cce5;
    stroke-width: 2;
    transition: fill 0.16s ease, stroke 0.16s ease, filter 0.16s ease;
}

[data-body-map="back"] .body-zone path,
[data-body-map="back"] .body-zone ellipse,
[data-body-map="back"] .body-zone rect {
    fill: url(#body-fill-back);
}

.body-zone text {
    fill: #5b188b;
    font-size: 11px;
    font-weight: 900;
    paint-order: stroke;
    pointer-events: none;
    stroke: rgba(255, 255, 255, 0.96);
    stroke-linejoin: round;
    stroke-width: 4px;
    text-anchor: middle;
}

.body-zone:hover path,
.body-zone:hover ellipse,
.body-zone:hover rect,
.body-zone:focus-visible path,
.body-zone:focus-visible ellipse,
.body-zone:focus-visible rect,
.body-zone.is-selected path,
.body-zone.is-selected ellipse,
.body-zone.is-selected rect {
    fill: #f4e7ff;
    stroke: #7a1bb0;
    filter: drop-shadow(0 8px 14px rgba(75, 0, 130, 0.13));
}

.body-zone[data-zone="neck"] rect,
.body-zone[data-zone="neck_back"] rect,
.body-zone[data-zone="left_shoulder"] ellipse,
.body-zone[data-zone="right_shoulder"] ellipse,
.body-zone[data-zone="left_trap"] path,
.body-zone[data-zone="right_trap"] path {
    fill: #fbf7ff;
    stroke: #d0bfde;
    stroke-width: 2;
}

.body-zone.has-annotation path,
.body-zone.has-annotation ellipse,
.body-zone.has-annotation rect {
    stroke: #7a1bb0;
    stroke-width: 2;
}

.body-zone.has-annotation text {
    fill: #45115f;
}

.body-zone[data-zone="neck"] text,
.body-zone[data-zone="neck_back"] text,
.body-zone[data-zone="left_shoulder"] text,
.body-zone[data-zone="right_shoulder"] text,
.body-zone[data-zone="left_trap"] text,
.body-zone[data-zone="right_trap"] text {
    fill: #5b188b;
    font-size: 11px;
    stroke-width: 3px;
}

.body-zone[data-zone="neck"]:hover rect,
.body-zone[data-zone="neck_back"]:hover rect,
.body-zone[data-zone="left_shoulder"]:hover ellipse,
.body-zone[data-zone="right_shoulder"]:hover ellipse,
.body-zone[data-zone="left_trap"]:hover path,
.body-zone[data-zone="right_trap"]:hover path,
.body-zone[data-zone="neck"]:focus-visible rect,
.body-zone[data-zone="neck_back"]:focus-visible rect,
.body-zone[data-zone="left_shoulder"]:focus-visible ellipse,
.body-zone[data-zone="right_shoulder"]:focus-visible ellipse,
.body-zone[data-zone="left_trap"]:focus-visible path,
.body-zone[data-zone="right_trap"]:focus-visible path,
.body-zone[data-zone="neck"].is-selected rect,
.body-zone[data-zone="neck_back"].is-selected rect,
.body-zone[data-zone="left_shoulder"].is-selected ellipse,
.body-zone[data-zone="right_shoulder"].is-selected ellipse,
.body-zone[data-zone="left_trap"].is-selected path,
.body-zone[data-zone="right_trap"].is-selected path {
    fill: #f4e7ff;
    stroke: #7a1bb0;
    stroke-width: 2;
}

.body-map-midline {
    fill: none;
    stroke: rgba(75, 0, 130, 0.13);
    stroke-dasharray: 5 7;
    stroke-width: 2;
    pointer-events: none;
}

.body-callout {
    position: absolute;
    left: var(--x);
    top: var(--y);
    z-index: 3;
    width: min(238px, 44%);
    pointer-events: auto;
    cursor: pointer;
}

.body-callout.is-right {
    transform: translate(22px, -50%);
}

.body-callout.is-left {
    transform: translate(calc(-100% - 22px), -50%);
}

.body-callout-pin {
    position: absolute;
    top: 50%;
    width: 22px;
    height: 2px;
    background: #b58bd4;
}

.body-callout.is-right .body-callout-pin {
    left: -22px;
}

.body-callout.is-left .body-callout-pin {
    right: -22px;
}

.body-callout-pin::before {
    content: "";
    position: absolute;
    top: 50%;
    width: 12px;
    height: 12px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #7a1bb0;
    box-shadow: 0 0 0 2px rgba(122, 27, 176, 0.18);
    transform: translateY(-50%);
}

.body-callout.is-right .body-callout-pin::before {
    left: -6px;
}

.body-callout.is-left .body-callout-pin::before {
    right: -6px;
}

.body-callout-card {
    padding: 10px 10px 9px;
    border: 1px solid #e2d5eb;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 12px 26px rgba(44, 24, 64, 0.12);
}

.body-callout.is-active .body-callout-card,
.body-annotation-row.is-active {
    border-color: #7a1bb0;
    box-shadow: 0 12px 28px rgba(75, 0, 130, 0.15);
}

.body-callout-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.body-callout-edit {
    width: 24px;
    height: 24px;
    display: inline-grid;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid #e2d5eb;
    border-radius: 999px;
    background: #fff;
    color: var(--brand);
    cursor: pointer;
}

.body-callout-edit svg {
    width: 13px;
    height: 13px;
}

.body-callout-card strong,
.body-callout-card span,
.body-callout-card p {
    display: block;
}

.body-callout-card strong {
    color: #26323a;
    font-size: 0.82rem;
}

.body-callout-card span {
    margin-top: 3px;
    color: #6b3a91;
    font-size: 0.72rem;
    font-weight: 900;
}

.body-callout-card p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 0.72rem;
    line-height: 1.35;
}

.body-callout-card .body-callout-treatment {
    color: #3b2d46;
    font-weight: 800;
}

.body-callout-draft .body-callout-card {
    border-color: #cdb8ef;
    background: #fbf7ff;
}

.body-chart-form {
    height: 100%;
    min-height: 0;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    align-items: stretch;
    gap: 10px;
    padding: 16px;
}

.body-chart-workspace.is-embedded .body-chart-form {
    min-height: 0;
    padding: 12px;
    overflow: hidden;
}

.body-chart-note-grid {
    min-height: 0;
    overflow: auto;
    gap: 8px;
    grid-template-rows: auto auto auto minmax(132px, 1fr) minmax(132px, 1fr);
}

.body-chart-form textarea {
    height: 100%;
    min-height: 132px;
    resize: none;
}

.body-chart-form [data-save-annotation] {
    width: 100%;
    height: 38px;
    min-height: 38px;
    max-height: 38px;
    padding: 0 14px;
}

.body-region-field,
.body-quality-field,
.body-intensity-field {
    gap: 4px;
}

.body-region-field {
    margin-bottom: -8px;
}

.body-quality-field select {
    max-width: none;
    width: 100%;
    min-height: 46px;
    padding: 9px 12px;
    font-size: 0.98rem;
    font-weight: 850;
}

.body-note-field,
.body-treatment-field {
    min-height: 0;
}

.body-chart-editor-close {
    width: 32px;
    height: 32px;
    display: inline-grid;
    place-items: center;
    border: 1px solid #dcd4e6;
    border-radius: 8px;
    background: #fff;
    color: var(--brand);
    cursor: pointer;
}

.body-chart-editor-close svg {
    width: 17px;
    height: 17px;
}

.body-region-readout {
    min-height: 20px;
    display: block;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #26323a;
    font-size: 0.92rem;
    font-weight: 900;
    line-height: 1.25;
}

.body-intensity-value {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    margin-left: 4px;
    padding: 2px 7px;
    border-radius: 999px;
    background: #f3eafd;
    color: var(--brand);
    font-size: 0.72rem;
}

.body-intensity-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 7px;
}

.body-intensity-choice {
    min-width: 0;
    position: relative;
}

.body-intensity-choice input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.body-intensity-choice span {
    min-height: 36px;
    display: grid;
    place-items: center;
    border: 1px solid #e0d6e8;
    border-radius: 8px;
    background: #fff;
    color: #3a2b48;
    font-size: 0.86rem;
    font-weight: 900;
    cursor: pointer;
    transition: border-color 0.14s ease, background-color 0.14s ease, color 0.14s ease, box-shadow 0.14s ease;
}

.body-intensity-choice input:checked + span {
    border-color: #7a1bb0;
    background: #f4e7ff;
    color: #4b0082;
    box-shadow: inset 0 0 0 1px rgba(122, 27, 176, 0.12);
}

.body-intensity-choice input:focus-visible + span,
.body-intensity-choice:hover span {
    border-color: #b98cdc;
    background: #fbf7ff;
}

.body-chart-recent {
    display: grid;
    gap: 8px;
    padding: 0 16px 16px;
}

.body-chart-recent h3 {
    margin-top: 4px;
}

.body-annotation-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 10px;
    border: 1px solid #edf1f5;
    border-radius: 8px;
    background: #fbfdfe;
    cursor: pointer;
}

.body-annotation-row strong,
.body-annotation-row span,
.body-annotation-row small {
    display: block;
}

.body-annotation-row-actions {
    display: grid;
    justify-items: end;
    gap: 6px;
    flex: 0 0 auto;
}

.body-annotation-row strong {
    color: #26323a;
    font-size: 0.84rem;
}

.body-annotation-row span,
.body-annotation-row small,
.body-annotation-row time {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 800;
}

.body-annotation-row small {
    margin-top: 4px;
    max-width: 260px;
    line-height: 1.35;
}

.calendar-toolbar a,
.calendar-date-row,
.panel h3 {
    display: flex;
    align-items: center;
    gap: 8px;
}

.calendar-workspace {
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.calendar-workspace-clean {
    height: 100%;
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    border-width: 0 0 1px;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
}

.calendar-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    padding: 14px;
    border-bottom: 1px solid #d8dee7;
    background: #fbfafc;
}

.calendar-toolbar-title {
    min-width: 160px;
    display: grid;
    justify-items: end;
    gap: 2px;
}

.calendar-title {
    color: #2f2140;
    font-size: 1.08rem;
}

.calendar-toolbar-title span {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
}

.calendar-view-switch {
    display: inline-flex;
    overflow: hidden;
    border: 1px solid #cbd7df;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(44, 24, 64, 0.06);
}

.calendar-view-option {
    min-height: 36px;
    padding: 8px 12px;
    border-right: 1px solid #cbd7df;
    color: #263238;
    font-weight: 800;
}

.calendar-view-option:last-child {
    border-right: 0;
}

.calendar-view-option.is-active {
    background: var(--brand);
    color: #fff;
}

.calendar-nav {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.calendar-icon-btn,
.calendar-today-btn,
.calendar-reschedule-toggle {
    min-height: 36px;
    border: 1px solid #cbd7df;
    border-radius: 8px;
    background: #fff;
    color: #263238;
    font-weight: 800;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.calendar-icon-btn {
    width: 38px;
    justify-content: center;
}

.calendar-today-btn,
.calendar-reschedule-toggle {
    padding: 8px 12px;
}

.calendar-reschedule-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.calendar-icon-btn:hover,
.calendar-today-btn:hover,
.calendar-reschedule-toggle:hover,
.calendar-view-option:hover {
    border-color: #d7bee9;
    background: #f8f4fc;
    color: var(--brand);
}

.modal-close-button {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    min-height: 40px;
    border-color: #cfdde5;
    border-radius: 8px;
    background: #fff;
    color: #26323a;
    box-shadow: 0 8px 20px rgba(32, 42, 48, 0.06);
}

.modal-close-button svg {
    width: 21px;
    height: 21px;
}

.calendar-reschedule-toggle.is-active {
    border-color: var(--brand);
    background: #f0e7fb;
    color: var(--brand);
    box-shadow: inset 0 0 0 1px rgba(75, 0, 130, 0.12), 0 0 0 3px rgba(75, 0, 130, 0.08);
}

.calendar-view-option.is-active:hover {
    background: var(--brand);
    border-color: transparent;
    color: #fff;
}

.calendar-shell {
    min-height: calc(100vh - var(--topbar-height) - 65px);
    background: #fff;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    border-bottom: 1px solid #edf1f5;
    background: #f8fafc;
}

.calendar-weekdays span {
    min-width: 0;
    padding: 10px 12px;
    color: #52636d;
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-grid-week {
    min-height: calc(100vh - var(--topbar-height) - 108px);
}

.calendar-day {
    min-width: 0;
    min-height: 154px;
    padding: 8px;
    border-right: 1px solid #edf1f5;
    border-bottom: 1px solid #edf1f5;
    background: #fff;
    cursor: default;
}

.calendar-grid-month .calendar-day {
    cursor: pointer;
}

.calendar-grid-week .calendar-day {
    min-height: calc(100vh - var(--topbar-height) - 108px);
}

.calendar-day:nth-child(7n) {
    border-right: 0;
}

.calendar-day.is-outside-month {
    background: #fbfbfc;
    color: #8c98a1;
}

.calendar-day.is-today {
    box-shadow: inset 0 0 0 2px rgba(75, 0, 130, 0.16);
}

.calendar-date-row {
    min-height: 25px;
    justify-content: space-between;
    gap: 6px;
    margin-bottom: 6px;
    color: inherit;
}

.calendar-date-row strong {
    min-width: 0;
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 900;
    text-transform: uppercase;
}

.calendar-date-number {
    display: inline-grid;
    place-items: center;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    color: #374750;
    font-weight: 900;
}

.calendar-day.is-today .calendar-date-number {
    background: var(--brand);
    color: #fff;
}

.calendar-date-badge {
    max-width: 100%;
    padding: 3px 6px;
    border: 1px solid #cdb8ef;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 0.68rem;
    font-weight: 900;
}

.calendar-events {
    display: grid;
    gap: 6px;
}

.calendar-event {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 3px;
    padding: 7px 8px;
    border: 1px solid #e2b463;
    border-radius: 5px;
    background: #fff7e6;
    color: #5f410f;
    font-size: 0.76rem;
    line-height: 1.2;
}

.calendar-event:hover {
    box-shadow: 0 4px 12px rgba(38, 50, 56, 0.08);
}

.calendar-workspace-clean.is-reschedule-mode .calendar-event {
    cursor: grab;
    box-shadow: 0 0 0 2px rgba(75, 0, 130, 0.08);
}

.calendar-workspace-clean.is-reschedule-mode .calendar-event[data-can-reschedule="0"] {
    cursor: not-allowed;
    opacity: 0.72;
    box-shadow: inset 0 0 0 1px rgba(100, 113, 124, 0.18);
}

.calendar-workspace-clean.is-reschedule-mode .calendar-event:active,
.calendar-event.is-dragging {
    cursor: grabbing;
}

.calendar-drag-image {
    position: fixed !important;
    top: -10000px !important;
    left: -10000px !important;
    z-index: -1 !important;
    pointer-events: none !important;
}

.calendar-pointer-drag-image {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    z-index: 9999 !important;
    pointer-events: none !important;
    opacity: 0.92;
    transform: translate(-10000px, -10000px);
    box-shadow: 0 18px 40px rgba(38, 50, 56, 0.2), 0 0 0 2px rgba(75, 0, 130, 0.16) !important;
}

.calendar-drop-warning {
    position: fixed;
    z-index: 10000;
    max-width: min(260px, calc(100vw - 24px));
    padding: 8px 10px;
    border: 1px solid rgba(180, 35, 24, 0.68);
    border-radius: 7px;
    background: rgba(255, 247, 245, 0.98);
    box-shadow: 0 14px 30px rgba(133, 39, 39, 0.22);
    color: #852727;
    font-size: 0.78rem;
    font-weight: 900;
    line-height: 1.2;
    text-align: center;
    pointer-events: none;
}

.calendar-drop-warning[hidden] {
    display: none;
}

.calendar-workspace-clean.is-reschedule-mode [data-calendar-drop-target] {
    outline: 1px dashed rgba(75, 0, 130, 0.22);
    outline-offset: -4px;
}

[data-calendar-drop-target]::after {
    content: "";
    position: absolute;
    inset: 3px;
    z-index: 1;
    border-radius: 5px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
}

[data-calendar-drop-target]::before {
    content: attr(data-drop-message);
    position: absolute;
    top: 6px;
    left: 8px;
    right: 8px;
    z-index: 8;
    min-height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px 8px;
    border: 1px solid rgba(180, 35, 24, 0.62);
    border-radius: 6px;
    background: rgba(255, 247, 245, 0.98);
    box-shadow: 0 8px 18px rgba(133, 39, 39, 0.18);
    color: #852727;
    font-size: 0.72rem;
    font-weight: 900;
    line-height: 1.15;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-2px);
    transition: opacity 0.12s ease, transform 0.12s ease;
}

.calendar-workspace-clean.is-reschedule-dragging [data-calendar-drop-target] {
    cursor: copy;
}

.calendar-workspace-clean.is-reschedule-dragging [data-calendar-drop-target].is-drop-allowed {
    outline-color: rgba(36, 122, 76, 0.22);
}

.calendar-workspace-clean.is-reschedule-dragging [data-calendar-drop-target].is-drop-unavailable {
    cursor: no-drop;
    outline-color: rgba(180, 35, 24, 0.6);
    box-shadow: inset 0 0 0 1px rgba(180, 35, 24, 0.14);
}

.calendar-workspace-clean.is-reschedule-dragging [data-calendar-drop-target].is-drop-same-place {
    cursor: default;
    outline-color: rgba(100, 113, 124, 0.3);
}

[data-calendar-drop-target].is-drop-hover {
    background: #f1e9fb !important;
    box-shadow: inset 0 0 0 2px rgba(75, 0, 130, 0.32);
}

[data-calendar-drop-target].is-drop-allowed.is-drop-hover,
[data-calendar-drop-target].is-drop-range {
    background: #eef9f0 !important;
    box-shadow: inset 0 0 0 2px rgba(36, 122, 76, 0.3);
}

[data-calendar-drop-target].is-drop-same-place.is-drop-hover {
    background: #f4f6f8 !important;
    box-shadow: inset 0 0 0 2px rgba(100, 113, 124, 0.28);
}

[data-calendar-drop-target].is-drop-range::after {
    opacity: 1;
    background: rgba(36, 122, 76, 0.08);
    box-shadow: inset 0 0 0 1px rgba(36, 122, 76, 0.18);
}

[data-calendar-drop-target].is-drop-conflict-range,
[data-calendar-drop-target].is-drop-unavailable.is-drop-hover,
[data-calendar-drop-target].is-drop-rejected {
    background: #ffe8e8 !important;
    box-shadow: inset 0 0 0 2px rgba(180, 35, 24, 0.66);
}

[data-calendar-drop-target].is-drop-conflict-range::after,
[data-calendar-drop-target].is-drop-unavailable.is-drop-hover::after,
[data-calendar-drop-target].is-drop-rejected::after {
    opacity: 1;
    background:
        repeating-linear-gradient(
            -45deg,
            rgba(180, 35, 24, 0.18) 0,
            rgba(180, 35, 24, 0.18) 7px,
            rgba(255, 255, 255, 0.46) 7px,
            rgba(255, 255, 255, 0.46) 14px
        );
    box-shadow: inset 0 0 0 1px rgba(180, 35, 24, 0.34);
}

[data-calendar-drop-target].is-drop-unavailable.is-drop-hover::before,
[data-calendar-drop-target].is-drop-rejected::before {
    opacity: 1;
    transform: translateY(0);
}

.calendar-event-time {
    grid-column: 1 / -1;
    min-width: 0;
    color: inherit;
    font-size: 0.68rem;
    font-weight: 850;
    opacity: 0.82;
    white-space: nowrap;
}

.calendar-event strong,
.calendar-event small {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendar-event strong.calendar-event-client {
    grid-column: 1 / -1;
    display: -webkit-box;
    color: inherit;
    font-size: 0.84rem;
    font-weight: 950;
    line-height: 1.12;
    overflow-wrap: anywhere;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.calendar-event small {
    grid-column: 1 / -1;
    align-self: center;
    color: inherit;
    font-size: 0.68rem;
    opacity: 0.78;
}

.calendar-event .calendar-payment-pill {
    grid-column: 1 / -1;
}

.calendar-event.is-compact {
    gap: 1px;
    padding: 4px 6px;
}

.calendar-event.is-compact strong.calendar-event-client {
    display: block;
    overflow: hidden;
    font-size: 0.72rem;
    line-height: 1.05;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendar-event.is-compact .calendar-event-time {
    overflow: hidden;
    font-size: 0.61rem;
    line-height: 1.05;
    text-overflow: ellipsis;
}

.calendar-event.is-compact small,
.calendar-event.is-compact .calendar-payment-pill {
    display: none;
}

.calendar-event.status-confirmed,
.calendar-event.status-completed {
    border-color: #8cc79b;
    background: #eef9f0;
    color: #24562d;
}

.calendar-event.status-cancelled {
    border-color: #dfb8a8;
    background: #fff2eb;
    color: #7a3f25;
}

.calendar-event.status-no-show,
.calendar-event.status-no_show {
    border-color: #d99999;
    background: #fff0f0;
    color: #852727;
}

.calendar-event.has-service-color {
    border-color: var(--calendar-event-border);
    background: var(--calendar-event-bg);
    opacity: 1;
    color: var(--calendar-event-text);
}

.calendar-event.is-drag-invalid,
.calendar-event.has-service-color.is-drag-invalid {
    border-color: #b42318 !important;
    background: #fff0f0 !important;
    box-shadow: 0 8px 22px rgba(133, 39, 39, 0.2), 0 0 0 2px rgba(180, 35, 24, 0.44) !important;
    color: #852727 !important;
}

.calendar-week-cell .calendar-event,
.calendar-time-events .calendar-event {
    padding: 6px 7px;
    font-size: 0.7rem;
}

.calendar-week-cell .calendar-event strong.calendar-event-client {
    font-size: 0.78rem;
}

.calendar-week-board {
    min-height: 0;
    height: 100%;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
    background: #fff;
}

.calendar-week-header {
    position: sticky;
    top: 0;
    z-index: 3;
    display: grid;
    grid-template-columns: 74px repeat(7, minmax(0, 1fr));
    border-bottom: 2px solid #d8dee7;
    background: #fff;
}

.calendar-week-time-corner,
.calendar-week-day-heading {
    min-height: 52px;
    display: grid;
    align-content: center;
    padding: 8px 10px;
    border-right: 1px solid #d8dee7;
}

.calendar-week-time-corner {
    color: #64717c;
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.calendar-week-day-heading {
    justify-items: center;
    gap: 2px;
    color: #26323a;
}

.calendar-week-day-heading strong {
    font-size: 0.82rem;
    font-weight: 900;
}

.calendar-week-day-heading span {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
}

.calendar-week-day-heading.is-today {
    background: var(--brand-soft);
    color: var(--brand);
}

.calendar-week-body {
    position: relative;
    min-height: 0;
    display: grid;
    grid-template-rows: repeat(var(--calendar-hour-count), minmax(0, 1fr));
    overflow: hidden;
}

.calendar-current-time-line {
    position: absolute;
    right: 0;
    z-index: 9;
    height: 2px;
    background: #df2b26;
    box-shadow: 0 0 0 1px rgba(223, 43, 38, 0.08);
    transform: translateY(-1px);
    pointer-events: none;
}

.calendar-current-time-line[hidden] {
    display: none;
}

.calendar-current-time-line span {
    position: absolute;
    top: 50%;
    left: -5px;
    width: 11px;
    height: 11px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #df2b26;
    box-shadow: 0 2px 6px rgba(130, 27, 24, 0.28);
    transform: translateY(-50%);
}

.calendar-week-body .calendar-current-time-line {
    left: 74px;
}

.calendar-week-row {
    display: grid;
    grid-template-columns: 74px repeat(7, minmax(0, 1fr));
    min-height: 0;
}

.calendar-week-row.period-morning .calendar-week-time-label,
.calendar-week-row.period-morning .calendar-week-cell {
    background: #fffefa;
}

.calendar-week-row.period-daytime .calendar-week-time-label,
.calendar-week-row.period-daytime .calendar-week-cell {
    background: #f8fdff;
}

.calendar-week-row.period-dusk .calendar-week-time-label,
.calendar-week-row.period-dusk .calendar-week-cell {
    background: #fefcff;
}

.calendar-week-row:nth-child(even).period-morning .calendar-week-time-label,
.calendar-week-row:nth-child(even).period-morning .calendar-week-cell {
    background: #fcfbf4;
}

.calendar-week-row:nth-child(even).period-daytime .calendar-week-time-label,
.calendar-week-row:nth-child(even).period-daytime .calendar-week-cell {
    background: #f3f8fa;
}

.calendar-week-row:nth-child(even).period-dusk .calendar-week-time-label,
.calendar-week-row:nth-child(even).period-dusk .calendar-week-cell {
    background: #faf7fc;
}

.calendar-week-time-label,
.calendar-week-cell {
    min-width: 0;
    border-right: 1px solid #d8dee7;
    border-bottom: 1px solid #edf1f5;
}

.calendar-week-time-label {
    padding: 9px 8px;
    color: #26323a;
    font-size: 0.8rem;
    font-weight: 850;
}

.calendar-week-row.is-sub-slot .calendar-week-time-label {
    color: #7a8790;
    font-size: 0.68rem;
    font-weight: 800;
}

.calendar-week-row.is-sub-slot .calendar-week-time-label,
.calendar-week-row.is-sub-slot .calendar-week-cell {
    border-bottom-style: dashed;
}

.calendar-week-cell {
    position: relative;
    overflow: visible;
    display: grid;
    align-content: start;
    gap: 4px;
    padding: 4px 6px;
}

.calendar-week-cell.is-today {
    box-shadow: inset 2px 0 0 rgba(75, 0, 130, 0.15), inset -2px 0 0 rgba(75, 0, 130, 0.15);
}

.calendar-day-board {
    min-height: 0;
    height: 100%;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
    background: #fff;
}

.calendar-day-board-header {
    position: sticky;
    top: 0;
    z-index: 2;
    display: grid;
    grid-template-columns: 86px minmax(0, 1fr);
    border-bottom: 1px solid #edf1f5;
    background: #f8fafc;
}

.calendar-day-board-header span,
.calendar-day-board-header strong {
    min-height: 48px;
    display: flex;
    align-items: center;
    padding: 0 12px;
    color: #52636d;
    font-size: 0.78rem;
    font-weight: 900;
}

.calendar-day-board-header span {
    border-right: 1px solid #edf1f5;
    text-transform: uppercase;
}

.calendar-day-body {
    position: relative;
    min-height: 0;
    display: grid;
    grid-template-rows: repeat(var(--calendar-hour-count), minmax(0, 1fr));
    overflow: hidden;
}

.calendar-day-body .calendar-current-time-line {
    left: 86px;
}

.calendar-time-row {
    display: grid;
    grid-template-columns: 86px minmax(0, 1fr);
    min-height: 0;
    border-bottom: 1px solid #edf1f5;
}

.calendar-time-row.period-morning .calendar-time-label,
.calendar-time-row.period-morning .calendar-time-events {
    background: #fffefa;
}

.calendar-time-row.period-daytime .calendar-time-label,
.calendar-time-row.period-daytime .calendar-time-events {
    background: #f8fdff;
}

.calendar-time-row.period-dusk .calendar-time-label,
.calendar-time-row.period-dusk .calendar-time-events {
    background: #fefcff;
}

.calendar-time-row:nth-child(even).period-morning .calendar-time-label,
.calendar-time-row:nth-child(even).period-morning .calendar-time-events {
    background: #fcfbf4;
}

.calendar-time-row:nth-child(even).period-daytime .calendar-time-label,
.calendar-time-row:nth-child(even).period-daytime .calendar-time-events {
    background: #f3f8fa;
}

.calendar-time-row:nth-child(even).period-dusk .calendar-time-label,
.calendar-time-row:nth-child(even).period-dusk .calendar-time-events {
    background: #faf7fc;
}

.calendar-time-label {
    padding: 7px 10px;
    border-right: 1px solid #edf1f5;
    color: #64717c;
    font-size: 0.78rem;
    font-weight: 900;
}

.calendar-time-row.is-sub-slot .calendar-time-label {
    color: #7a8790;
    font-size: 0.68rem;
    font-weight: 800;
}

.calendar-time-row.is-sub-slot {
    border-bottom-style: dashed;
}

.calendar-time-events {
    position: relative;
    min-width: 0;
    overflow: visible;
    display: grid;
    align-content: start;
    gap: 4px;
    padding: 4px 6px;
}

.calendar-event-wide {
    max-width: 720px;
}

.calendar-week-cell .calendar-event,
.calendar-time-events .calendar-event {
    position: absolute;
    inset: 4px 6px auto 6px;
    z-index: 4;
    min-height: calc(var(--calendar-event-height, 100%) - 8px);
    height: calc(var(--calendar-event-height, 100%) - 8px);
    align-content: start;
}

.calendar-time-events .calendar-event-wide {
    right: auto;
    width: min(720px, calc(100% - 12px));
}

.reschedule-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(22, 16, 31, 0.35);
}

.reschedule-modal-backdrop[hidden] {
    display: none;
}

.reschedule-modal {
    position: relative;
    width: min(520px, 100%);
    border: 1px solid #d8cfe3;
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow-strong);
}

.reschedule-modal form {
    display: grid;
    gap: 20px;
    padding: 22px;
}

.reschedule-modal-header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 16px;
    padding-right: 54px;
}

.reschedule-modal-header span {
    color: var(--brand);
    font-size: 0.76rem;
    font-weight: 900;
    text-transform: uppercase;
}

.reschedule-modal-header h2 {
    margin: 2px 0 0;
    color: #2f2140;
    font-size: 1.1rem;
}

.reschedule-summary {
    display: grid;
    margin: 0;
    border: 1px solid #edf1f5;
    border-radius: 8px;
    overflow: hidden;
}

.reschedule-summary div {
    display: grid;
    grid-template-columns: 94px minmax(0, 1fr);
    gap: 10px;
    padding: 9px 12px;
    border-bottom: 1px solid #edf1f5;
    background: #fff;
}

.reschedule-summary div:last-child {
    border-bottom: 0;
}

.reschedule-summary dt {
    color: #26323a;
    font-size: 0.78rem;
    font-weight: 900;
}

.reschedule-summary dd {
    min-width: 0;
    margin: 0;
    color: #26323a;
    font-weight: 850;
}

.reschedule-time-stack {
    display: grid;
    gap: 7px;
}

.reschedule-time-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.reschedule-time-caption {
    min-width: 32px;
    color: #26323a;
    font-size: 0.78rem;
    font-weight: 900;
}

.reschedule-time-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.reschedule-time-pill {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    padding: 4px 8px;
    border: 1px solid #e3d8eb;
    border-radius: 999px;
    background: #fbf8fe;
    color: #26323a;
    font-size: 0.82rem;
    font-weight: 900;
    line-height: 1;
}

.reschedule-new-time .reschedule-time-pill {
    border-color: #d7bee9;
    background: #f7f0fc;
    color: #2f2140;
}

.reschedule-old-time .reschedule-time-caption,
.reschedule-old-time .reschedule-time-pill {
    color: #7a8790;
    font-size: 0.7rem;
}

.reschedule-old-time .reschedule-time-pill {
    border-color: #e4e9ee;
    background: #fafbfc;
    min-height: 21px;
    padding: 3px 7px;
    font-weight: 800;
}

.reschedule-notification {
    display: grid;
    gap: 10px;
}

.reschedule-notification h3 {
    margin: 0;
    color: #2f2140;
    font-size: 0.94rem;
}

.reschedule-notification-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.reschedule-notification-actions .btn {
    min-width: 92px;
}

.reschedule-cancel-wide {
    width: 100%;
}

.appointment-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 62;
    display: grid;
    place-items: center;
    padding: 22px;
    background: rgba(22, 16, 31, 0.35);
}

.appointment-modal-backdrop[hidden] {
    display: none;
}

.appointment-modal {
    position: relative;
    width: min(860px, 100%);
    max-height: min(840px, calc(100vh - 44px));
    overflow: auto;
    display: grid;
    gap: 10px;
    padding: 18px;
    border: 1px solid #d8cfe3;
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow-strong);
}

.appointment-create-modal {
    width: min(760px, 100%);
}

.appointment-create-form {
    display: grid;
    gap: 14px;
}

.appointment-create-form[hidden],
.calendar-create-chooser[hidden] {
    display: none;
}

.calendar-create-chooser {
    display: grid;
    gap: 16px;
}

.calendar-create-type-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.calendar-create-type {
    min-height: 138px;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-content: center;
    gap: 5px 12px;
    padding: 18px;
    border: 1px solid #ddd1e8;
    border-radius: 12px;
    background: #fff;
    color: #30233d;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.16s ease, background-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.calendar-create-type > span {
    grid-row: 1 / 3;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    align-self: center;
    border-radius: 50%;
    background: #f2e8ff;
    color: var(--brand);
}

.calendar-create-type .ui-icon {
    width: 21px;
    height: 21px;
}

.calendar-create-type strong {
    align-self: end;
    font-size: 16px;
}

.calendar-create-type small {
    align-self: start;
    color: #756a7f;
    line-height: 1.35;
}

.calendar-create-type:hover,
.calendar-create-type:focus-visible {
    border-color: #ad7ad5;
    background: #fcf9ff;
    box-shadow: 0 9px 24px rgba(75, 0, 130, 0.1);
    transform: translateY(-1px);
    outline: none;
}

.calendar-create-inline-help {
    margin: 5px 0 0;
    color: #756a7f;
    font-size: 12px;
}

.calendar-create-inline-help a {
    color: var(--brand);
    font-weight: 800;
}

.calendar-series-summary {
    grid-column: 1 / -1;
    padding: 12px 14px;
    border: 1px solid #dac8ea;
    border-radius: 9px;
    background: #faf6ff;
    color: #4f3d61;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.45;
}

.calendar-group-create-form select {
    width: 100%;
    height: 46px;
    min-height: 46px;
    padding-block: 0;
}

.calendar-group-field-label {
    display: block;
    margin-bottom: 6px;
    color: #403447;
    font-size: 0.82rem;
    font-weight: 900;
}

.calendar-offering-picker {
    display: grid;
}

.calendar-offering-type-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.calendar-offering-type-options[hidden] {
    display: none;
}

.calendar-offering-card,
.calendar-offering-empty-card {
    --offering-card-accent: #6b159e;
    position: relative;
    min-width: 0;
    min-height: 88px;
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    align-content: center;
    gap: 9px;
    overflow: hidden;
    border: 1px solid #e2d5eb;
    border-radius: 9px;
    padding: 11px 12px 11px 15px;
    background: #fff;
    color: #2f2140;
    box-shadow: 0 2px 8px rgba(44, 24, 64, 0.04);
    cursor: pointer;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.calendar-offering-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: var(--offering-card-accent);
}

.calendar-offering-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.calendar-offering-card-icon {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    align-self: start;
    border: 1px solid #dac8ec;
    border-radius: 8px;
    background: #f7effc;
    color: var(--brand);
}

.calendar-offering-card-icon .ui-icon {
    width: 17px;
    height: 17px;
}

.calendar-offering-card-copy {
    min-width: 0;
    display: grid;
    align-content: center;
    gap: 4px;
}

.calendar-offering-card-copy strong,
.calendar-offering-card-copy small,
.calendar-offering-card-copy em {
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
}

.calendar-offering-card-copy strong {
    color: #2f2140;
    font-size: 0.86rem;
    font-weight: 950;
    line-height: 1.2;
}

.calendar-offering-card-copy small {
    color: #6d5d78;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1.3;
}

.calendar-offering-card-copy em {
    color: #8a4b18;
    font-size: 0.7rem;
    font-style: normal;
    font-weight: 900;
}

.calendar-offering-card:hover,
.calendar-offering-card:focus-within,
.calendar-offering-empty-card:hover,
.calendar-offering-empty-card:focus-visible {
    border-color: #c7a8e3;
    background: #fbf7ff;
    box-shadow: 0 0 0 3px rgba(75, 0, 130, 0.08);
    outline: none;
}

.calendar-offering-card:has(input:checked) {
    border-color: #6b159e;
    background: #fbf7ff;
    box-shadow: inset 0 0 0 2px rgba(107, 21, 158, 0.86), 0 8px 18px rgba(75, 0, 130, 0.12);
}

.calendar-offering-card.is-unavailable {
    border-style: dashed;
    background: #faf9fb;
    box-shadow: none;
    cursor: not-allowed;
    opacity: 0.72;
}

.calendar-offering-empty-card {
    width: min(100%, 190px);
    min-height: 58px;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 8px;
    border-style: dashed;
    padding: 8px 10px;
    background: #fcf9ff;
}

.calendar-offering-empty-card .calendar-offering-card-icon {
    width: 28px;
    height: 28px;
    border-color: #caa9e2;
    background: #f2e8ff;
}

.calendar-offering-empty-card .calendar-offering-card-copy {
    gap: 2px;
}

.calendar-offering-empty-card .calendar-offering-card-copy strong {
    font-size: 0.78rem;
}

.calendar-offering-empty-card .calendar-offering-card-copy small {
    font-size: 0.68rem;
}

.offering-schedule-note {
    margin: 10px 0 0;
    padding: 10px 12px;
    border-radius: 8px;
    background: #f8f3fd;
}

@media (max-width: 620px) {
    .calendar-create-type-grid {
        grid-template-columns: 1fr;
    }

    .calendar-create-type {
        min-height: 104px;
    }

    .calendar-offering-type-options {
        grid-template-columns: 1fr;
    }
}

.appointment-create-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.appointment-create-grid .field.full {
    grid-column: 1 / -1;
}

.client-picker {
    position: relative;
    display: grid;
    gap: 8px;
}

.client-picker-control {
    min-height: 42px;
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr) 32px;
    align-items: center;
    gap: 8px;
    border: 1px solid #d8cfe3;
    border-radius: 8px;
    padding: 0 8px 0 11px;
    background: #fff;
    color: #5b5164;
    box-shadow: 0 1px 2px rgba(44, 24, 64, 0.04);
}

.client-picker-control:focus-within {
    border-color: #b88add;
    box-shadow: 0 0 0 3px rgba(75, 0, 130, 0.1);
}

.client-picker-control input {
    width: 100%;
    min-height: 38px;
    border: 0;
    padding: 0;
    background: transparent;
    color: #2f2140;
    font: inherit;
    font-weight: 850;
    outline: none;
}

.client-picker.is-selected .client-picker-control {
    display: none;
}

.client-picker-clear {
    width: 30px;
    min-height: 30px;
    display: inline-grid;
    place-items: center;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #6f6278;
    cursor: pointer;
}

.client-picker-clear:hover,
.client-picker-clear:focus-visible {
    background: #f7effc;
    color: var(--brand);
    outline: none;
}

.client-picker-selected,
.client-picker-results {
    border: 1px solid #e4d8ec;
    border-radius: 8px;
    background: #fff;
}

.client-picker-selected {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    background: #fbf7ff;
}

.client-picker-selected-card {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.client-picker-change {
    min-height: 32px;
    border: 1px solid #dac8ec;
    border-radius: 7px;
    padding: 0 11px;
    background: #fff;
    color: #4a215f;
    font-size: 0.78rem;
    font-weight: 950;
    cursor: pointer;
}

.client-picker-change:hover,
.client-picker-change:focus-visible {
    border-color: #b98bda;
    background: #f7effc;
    outline: none;
}

.client-picker-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 20;
    max-height: min(340px, 48vh);
    overflow: auto;
    box-shadow: 0 18px 42px rgba(43, 29, 56, 0.18);
}

.client-picker-results[hidden],
.client-picker-selected[hidden] {
    display: none;
}

.client-picker-option {
    width: 100%;
    display: grid;
    gap: 6px;
    border: 0;
    padding: 10px 12px;
    background: #fff;
    color: #2f2140;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.client-picker-option:hover,
.client-picker-option:focus-visible,
.client-picker-option.is-active {
    background: #f7f0fc;
    outline: none;
}

.client-picker-separator {
    display: block;
    height: 1px;
    background: #efe7f4;
}

.client-picker-empty {
    padding: 12px;
    color: #6b5e74;
    font-size: 0.86rem;
    font-weight: 850;
}

.client-picker-row {
    min-width: 0;
}

.client-picker-row-main {
    display: grid;
    grid-template-columns: minmax(150px, 0.8fr) minmax(0, 1.2fr);
    gap: 10px;
    align-items: baseline;
}

.client-picker-row-main strong,
.client-picker-row-main span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.client-picker-row-main strong {
    color: #2f2140;
    font-size: 0.9rem;
    font-weight: 950;
}

.client-picker-row-main span {
    color: #5f6d76;
    font-size: 0.8rem;
    font-weight: 800;
}

.client-picker-row-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.client-preference-pill {
    display: inline-flex;
    align-items: center;
    min-height: 23px;
    max-width: 100%;
    border: 1px solid #d9c5eb;
    border-radius: 999px;
    padding: 3px 8px;
    background: #f7effc;
    color: #4b136f;
    font-size: 0.72rem;
    font-weight: 950;
    line-height: 1.1;
}

.client-preference-pill.is-muted {
    border-color: #e5e8ec;
    background: #f8fafc;
    color: #6b7780;
}

.appointment-service-picker {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 8px;
}

.appointment-service-card {
    --service-card-accent: #6b159e;
    position: relative;
    min-height: 76px;
    display: grid;
    grid-template-columns: 1fr;
    align-content: center;
    gap: 7px;
    overflow: hidden;
    border: 1px solid #e2d5eb;
    border-radius: 8px;
    padding: 10px 12px 10px 16px;
    background: #fff;
    color: #2f2140;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(44, 24, 64, 0.04);
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.appointment-service-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: var(--service-card-accent);
}

.appointment-service-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.appointment-service-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    min-width: 0;
}

.appointment-service-card-meta span {
    display: inline-flex;
    align-items: center;
    width: max-content;
    max-width: 100%;
    border: 1px solid #e4d5f2;
    border-radius: 999px;
    padding: 3px 8px;
    background: #f7edff;
    color: #4b136f;
    font-size: 0.72rem;
    font-weight: 950;
    line-height: 1.1;
}

.appointment-service-card strong {
    min-width: 0;
    color: #2f2140;
    font-size: 0.9rem;
    font-weight: 950;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.appointment-service-card:hover,
.appointment-service-card:focus-within {
    border-color: #c7a8e3;
    background: #fbf7ff;
    box-shadow: 0 0 0 3px rgba(75, 0, 130, 0.08);
}

.appointment-service-card:has(input:checked) {
    border-color: #6b159e;
    background: #fbf7ff;
    box-shadow: inset 0 0 0 2px rgba(107, 21, 158, 0.86), 0 8px 18px rgba(75, 0, 130, 0.12);
}

.appointment-payment-picker {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 8px;
}

.appointment-payment-card {
    position: relative;
    min-height: 78px;
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-content: center;
    gap: 2px 9px;
    border: 1px solid #e2d5eb;
    border-radius: 8px;
    padding: 11px 12px;
    background: #fff;
    color: #2f2140;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(44, 24, 64, 0.04);
}

.appointment-payment-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.appointment-payment-card > span {
    grid-row: 1 / 3;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border: 1px solid #dac8ec;
    border-radius: 8px;
    background: #f7effc;
    color: var(--brand);
}

.appointment-payment-card strong,
.appointment-payment-card small {
    min-width: 0;
    display: block;
    white-space: normal;
    overflow-wrap: anywhere;
}

.appointment-payment-card strong {
    color: #2f2140;
    font-size: 0.86rem;
    font-weight: 950;
    line-height: 1.2;
}

.appointment-payment-card small {
    color: #6d5d78;
    font-size: 0.75rem;
    font-weight: 850;
    line-height: 1.3;
}

.appointment-payment-card:hover,
.appointment-payment-card:focus-within {
    border-color: #c7a8e3;
    background: #fbf7ff;
    box-shadow: 0 0 0 3px rgba(75, 0, 130, 0.08);
}

.appointment-payment-card:has(input:checked) {
    border-color: #6b159e;
    background: #fbf7ff;
    box-shadow: inset 0 0 0 2px rgba(107, 21, 158, 0.86), 0 8px 18px rgba(75, 0, 130, 0.12);
}

.appointment-create-grid small {
    display: block;
    min-height: 18px;
    margin-top: 6px;
    color: #6d5d78;
    font-size: 0.78rem;
    font-weight: 800;
}

.appointment-create-grid .appointment-payment-card small {
    min-height: 0;
    margin-top: 0;
}

.appointment-create-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 10px;
    border-top: 1px solid #eadff2;
}

.appointment-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-right: 56px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eadff2;
}

.appointment-modal-header span {
    color: var(--brand);
    font-size: 0.76rem;
    font-weight: 900;
    text-transform: uppercase;
}

.appointment-modal-header h2 {
    margin: 2px 0 0;
    color: #2f2140;
    font-size: 1.28rem;
}

.appointment-modal-header p {
    margin: 3px 0 0;
    color: #60707c;
    font-weight: 800;
}

.appointment-detail-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding: 10px;
    border: 1px solid #d8e4e8;
    border-radius: 8px;
    background: linear-gradient(135deg, #f8fbfb 0%, #f4f7fb 100%);
}

.appointment-detail-main span,
.appointment-detail-grid span,
.appointment-section-heading span {
    display: block;
    color: #60707c;
    font-size: 0.74rem;
    font-weight: 900;
    text-transform: uppercase;
}

.appointment-detail-main strong {
    display: block;
    margin-top: 4px;
    color: #21323a;
    font-size: 1.02rem;
}

.appointment-detail-badges {
    display: flex;
    align-content: flex-start;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 7px;
}

.appointment-status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    padding: 4px 9px;
    border: 1px solid #d7bee9;
    border-radius: 999px;
    background: #f7f0fc;
    color: #2f2140;
    font-size: 0.78rem;
    font-weight: 900;
    line-height: 1;
}

.appointment-status-badge.muted {
    border-color: #dde6ea;
    background: #fff;
    color: #60707c;
}

.appointment-detail-grid {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 8px;
}

.appointment-detail-grid div {
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid #dde6ea;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.78);
}

.appointment-detail-grid strong {
    display: block;
    margin-top: 4px;
    color: #21323a;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.appointment-payment-action-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border: 1px solid #efd49d;
    border-radius: 8px;
    background: #fff8e8;
}

.appointment-payment-action-card[hidden] {
    display: none;
}

.appointment-payment-action-card span {
    display: block;
    color: #8b5d14;
    font-size: 0.72rem;
    font-weight: 950;
    text-transform: uppercase;
}

.appointment-payment-action-card strong {
    display: block;
    margin-top: 3px;
    color: #3a2a0e;
    font-size: 0.96rem;
    font-weight: 950;
}

.appointment-payment-action-card p {
    margin: 4px 0 0;
    color: #66512a;
    font-size: 0.84rem;
    font-weight: 800;
}

.appointment-payment-action-card form {
    display: flex;
    justify-content: flex-end;
}

.appointment-video-action-card {
    border-color: #bfd4ff;
    background: #f2f6ff;
}

.appointment-video-action-card span { color: #315ca8; }
.appointment-video-action-card strong { color: #1d3561; }
.appointment-video-action-card p { color: #4f6386; }

.appointment-video-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.calendar-payment-pill {
    min-height: 22px;
    display: inline-flex;
    align-items: center;
    width: max-content;
    max-width: 100%;
    border: 1px solid rgba(75, 0, 130, 0.14);
    border-radius: 999px;
    padding: 2px 7px;
    background: rgba(255, 255, 255, 0.72);
    color: #3c2b47;
    font-size: 0.68rem;
    font-weight: 950;
    line-height: 1.1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendar-payment-pill.payment-status-paid,
.calendar-payment-pill.payment-status-card-secured {
    border-color: rgba(36, 122, 76, 0.22);
    background: #e7f6ee;
    color: #247a4c;
}

.calendar-payment-pill.payment-status-prepay-due,
.calendar-payment-pill.payment-status-card-needed,
.calendar-payment-pill.payment-status-invoice-open {
    border-color: rgba(155, 103, 22, 0.2);
    background: #fff5df;
    color: #8b5d14;
}

.calendar-payment-pill.payment-status-partial {
    border-color: rgba(75, 0, 130, 0.2);
    background: #f1e8ff;
    color: var(--brand);
}

.appointment-note-history-panel {
    display: grid;
    gap: 10px;
    padding: 10px;
    border: 1px solid #edf1f5;
    border-radius: 8px;
    background: #fff;
}

.appointment-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.appointment-section-heading h3 {
    margin: 2px 0 0;
    color: #2f2140;
    font-size: 1rem;
}

.appointment-section-heading .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.appointment-section-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.appointment-note-history {
    display: grid;
    gap: 8px;
}

.appointment-note-row,
.appointment-note-empty {
    border: 1px solid #dde6ea;
    border-radius: 6px;
    background: #f9fbfc;
    padding: 9px 10px;
}

.appointment-note-row-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.appointment-note-row-heading strong {
    color: #21323a;
    font-size: 0.94rem;
}

.appointment-note-row-heading span {
    color: #60707c;
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
}

.appointment-note-row p {
    margin: 6px 0 0;
    color: #3c4d57;
    font-size: 0.86rem;
}

.appointment-note-date,
.appointment-note-empty {
    color: #60707c;
    font-size: 0.78rem;
    font-weight: 800;
}

.appointment-action-panel {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 10px;
    border: 1px solid #edf1f5;
    border-radius: 8px;
    background: linear-gradient(180deg, #fff 0%, #fbfafc 100%);
}

.appointment-action-panel form {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    width: auto;
}

.appointment-action-panel .btn {
    min-width: 92px;
}

.appointment-action-panel .btn.is-current {
    border-color: #d7bee9;
    background: #f7f0fc;
    color: #6b3a91;
    cursor: default;
    opacity: 1;
}

.soap-page-header {
    align-items: flex-start;
}

.soap-documentation-stack,
.soap-appointment-picker {
    display: grid;
    gap: 14px;
}

.soap-documentation-stack {
    height: 100%;
    grid-template-rows: auto minmax(0, 1fr);
    min-height: 0;
}

.soap-documentation-workspace {
    display: grid;
    grid-template-columns: minmax(330px, 0.44fr) minmax(620px, 1fr) 0;
    gap: 14px;
    align-items: stretch;
    min-height: 0;
    height: 100%;
    transition: grid-template-columns 0.24s ease;
}

.soap-documentation-workspace.body-editor-open {
    grid-template-columns: minmax(310px, 0.38fr) minmax(500px, 0.86fr) minmax(310px, 0.36fr);
}

.soap-documentation-workspace.is-note-only {
    grid-template-columns: minmax(0, 1fr);
}

.soap-visit-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
}

.soap-visit-details,
.soap-visit-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.soap-visit-actions {
    justify-content: flex-end;
}

.soap-visit-strip strong,
.soap-visit-strip span {
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border: 1px solid #e3dce9;
    border-radius: 999px;
    background: #fbfdfe;
    color: #26323a;
    font-size: 0.82rem;
    font-weight: 900;
}

.soap-visit-strip span {
    color: var(--muted);
}

.soap-visit-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    padding: 12px;
}

.soap-visit-summary div {
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid #e3dce9;
    border-radius: 8px;
    background: #fbfdfe;
}

.soap-visit-summary span {
    display: block;
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 850;
}

.soap-visit-summary strong {
    display: block;
    margin-top: 4px;
    color: #26323a;
    font-size: 0.94rem;
    font-weight: 900;
}

.soap-note-panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 10px;
    align-content: stretch;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.soap-panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.soap-panel-heading h3 {
    margin: 0 0 3px;
}

.soap-panel-heading span {
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 700;
}

.soap-dynamic-form {
    height: 100%;
    min-height: 0;
    gap: 12px;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    align-items: stretch;
}

.soap-dynamic-form:has(.soap-form-select-field.is-hidden) {
    grid-template-rows: minmax(0, 1fr) auto;
}

.soap-form-select-field.is-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.soap-appointment-summary {
    display: grid;
    gap: 7px;
    padding: 12px;
    border: 1px solid #e6edf2;
    border-radius: 8px;
    background: #fbfdfe;
}

.soap-appointment-summary strong {
    color: #26323a;
    font-size: 1rem;
}

.soap-appointment-summary span {
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 800;
}

.soap-appointment-summary div {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.time-pill {
    min-height: 25px;
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border: 1px solid #e3d6ea;
    border-radius: 999px;
    background: #fbf7fe;
    color: #3a2b48;
    font-size: 0.76rem;
    font-weight: 900;
}

.soap-form-fields {
    align-self: stretch;
    display: grid;
    align-content: start;
    gap: 9px;
    height: 100%;
    min-height: 0;
    overflow: auto;
    padding: 10px;
    overscroll-behavior: contain;
    border: 1px solid #eadff2;
    border-radius: 8px;
    background: #fbfafc;
}

.soap-form-fields.is-compact {
    gap: 8px;
}

.soap-form-fields.is-dense {
    gap: 7px;
    padding: 8px;
}

.soap-form-fields[data-field-count="4"]:not(.is-readonly) {
    grid-template-rows: repeat(4, minmax(0, 1fr));
    align-content: stretch;
    overflow: hidden;
}

.soap-dynamic-field {
    padding: 8px;
    border: 1px solid #edf1f5;
    border-radius: 8px;
    background: #fff;
}

.soap-form-fields[data-field-count="4"]:not(.is-readonly) .soap-dynamic-field {
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 7px;
}

.soap-dynamic-field textarea {
    min-height: 92px;
}

.soap-form-fields[data-field-count="4"]:not(.is-readonly) .soap-dynamic-field textarea {
    height: 100%;
    min-height: 0;
    resize: none;
}

.soap-form-fields.is-compact .soap-dynamic-field {
    padding: 7px;
}

.soap-form-fields.is-compact .soap-dynamic-field textarea {
    min-height: 74px;
}

.soap-form-fields.is-dense .soap-dynamic-field textarea {
    min-height: 62px;
}

.soap-form-fields.is-readonly {
    grid-auto-rows: minmax(74px, 1fr);
    background: #fff;
}

.soap-readonly-field {
    display: grid;
    gap: 6px;
    padding: 10px;
    border: 1px solid #edf1f5;
    border-radius: 8px;
    background: #fbfdfe;
}

.soap-readonly-field span {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 900;
}

.soap-readonly-field strong {
    color: #26323a;
    font-size: 0.9rem;
    font-weight: 850;
    line-height: 1.35;
}

.soap-note-empty {
    color: #94a0aa;
    font-weight: 800;
}

.client-share-badge {
    min-height: 24px;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    padding: 3px 8px;
    border-radius: 999px;
    background: #eef2f0;
    color: #5f6b64;
    font-size: 0.72rem;
    font-weight: 900;
}

.client-share-badge.is-shared {
    background: #dff3e8;
    color: #247a4c;
}

.resource-share-overlay {
    position: fixed;
    inset: 0;
    z-index: 65;
    background: rgba(31, 18, 42, 0.28);
}

.resource-share-overlay[hidden],
.resource-share-drawer[hidden] {
    display: none;
}

.resource-share-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 80;
    height: 100dvh;
    width: min(430px, calc(100vw - 18px));
    overflow: hidden;
    border-left: 1px solid var(--line-strong);
    background: #fff;
    box-shadow: -18px 0 36px rgba(44, 36, 58, 0.18);
}

.resource-share-form {
    height: 100%;
    min-height: 0;
    display: grid;
    grid-template-rows: auto auto auto auto minmax(0, 1fr) auto;
    gap: 12px;
    padding: 16px;
}

.resource-share-header,
.resource-share-status,
.resource-share-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.resource-share-header h3 {
    margin: 0 0 3px;
    color: #2f2140;
    font-size: 1.05rem;
}

.resource-share-header span,
.resource-share-status span:not(.client-share-badge) {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 800;
}

.resource-share-form textarea {
    min-height: 108px;
}

.resource-share-list {
    min-height: 0;
    overflow: auto;
    display: grid;
    align-content: start;
    gap: 8px;
    padding: 8px;
    border: 1px solid #eadff2;
    border-radius: 8px;
    background: #fbfafc;
}

.resource-share-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px;
    border: 1px solid #e6edf2;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
}

.resource-share-option.is-filtered-out {
    display: none !important;
}

.resource-share-empty {
    margin: 0;
    text-align: center;
}

.resource-share-option:has(input:checked) {
    border-color: #bfe5cf;
    background: #f3fbf6;
}

.resource-share-option input {
    width: 16px;
    min-height: 16px;
    margin-top: 2px;
}

.resource-share-option span,
.resource-share-option strong,
.resource-share-option small {
    display: block;
    min-width: 0;
}

.resource-share-option strong {
    color: #26323a;
    font-size: 0.88rem;
}

.resource-share-option small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 750;
}

.resource-share-actions {
    justify-content: flex-end;
    padding-top: 4px;
    border-top: 1px solid var(--line);
}

.section-heading-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.section-heading-row h3 {
    margin: 0 0 3px;
}

.section-heading-row span {
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 750;
}

.client-note-history-panel {
    margin-top: 16px;
}

.soap-choice-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.soap-choice {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border: 1px solid #e4dae9;
    border-radius: 8px;
    background: #fff;
    color: #3a3142;
    font-size: 0.82rem;
    font-weight: 850;
}

.soap-choice input {
    width: 16px;
    min-height: 16px;
}

.soap-form-actions {
    align-self: end;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 0 0;
    border-top: 1px solid #efe8f4;
    background: #fff;
}

.soap-form-actions .btn {
    min-width: 104px;
    min-height: 38px;
    height: 38px;
    flex: 0 0 auto;
    padding: 0 12px;
}

.services-page-header {
    padding-right: 76px;
}

.forms-page-header {
    padding-right: 76px;
}

.service-table-panel {
    padding: 0;
    overflow: hidden;
}

.service-table-panel,
.form-table-panel,
.form-assignments-panel {
    padding: 0;
    overflow: hidden;
}

.form-table-panel,
.form-assignments-panel {
    margin-bottom: 16px;
}

.resource-library-panel {
    margin-bottom: 16px;
}

.resource-create-form {
    display: grid;
    gap: 18px;
}

.resource-create-form textarea {
    min-height: 92px;
}

.resource-modal {
    width: min(720px, 100%);
}

.resource-create-form .field small {
    color: #746a7b;
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.4;
    margin-top: 5px;
}

.resource-storage-note {
    align-items: center;
    background: #faf7fc;
    border: 1px solid #e8ddef;
    border-radius: 10px;
    color: #663080;
    display: flex;
    gap: 12px;
    padding: 13px 14px;
}

.resource-storage-note > .ui-icon {
    flex: 0 0 22px;
    height: 22px;
    width: 22px;
}

.resource-storage-note div {
    display: grid;
    gap: 2px;
}

.resource-storage-note strong {
    color: #3a2b48;
    font-size: 0.82rem;
}

.resource-storage-note span {
    color: #746a7b;
    font-size: 0.76rem;
    line-height: 1.4;
}

.resource-library-toolbar {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    background: #fbfafc;
}

.resource-library-toolbar h3 {
    margin-bottom: 2px;
}

.resource-search-form {
    min-width: min(420px, 100%);
    display: flex;
    align-items: center;
    gap: 8px;
}

.resource-source-cell a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--brand);
    font-weight: 900;
}

.resource-source-cell > span {
    color: #6e6475;
    font-weight: 750;
}

.service-table-toolbar,
.form-table-toolbar {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    background: #fbfafc;
}

.service-table-toolbar h3,
.form-table-toolbar h3 {
    margin-bottom: 2px;
}

.service-table th,
.form-template-table th {
    background: #f8f7fa;
    padding: 12px 14px;
}

.service-table td,
.form-template-table td {
    padding: 12px 14px;
}

.service-table tbody tr:hover td,
.form-template-table tbody tr:hover td {
    background: #fbf9fc;
}

.form-template-table td {
    vertical-align: middle;
}

.form-template-table td strong,
.form-template-table td span {
    display: block;
}

.form-template-table td span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 0.78rem;
}

.form-assignments-panel .list-row {
    margin: 0 16px 12px;
}

.service-name-cell {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 240px;
}

.service-name-cell strong,
.service-name-cell span {
    display: block;
}

.service-name-cell span {
    max-width: 460px;
    margin-top: 3px;
    color: var(--muted);
    font-size: 0.78rem;
}

.service-color-dot {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    margin-top: 2px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: var(--service-color);
    box-shadow: 0 0 0 1px rgba(38, 50, 56, 0.14), 0 2px 6px rgba(38, 50, 56, 0.12);
}

.service-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.service-chip {
    min-height: 23px;
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border: 1px solid #e8dfef;
    border-radius: 999px;
    background: #fbf8fe;
    color: #3a2b48;
    font-size: 0.72rem;
    font-weight: 850;
}

.service-edit-button {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 9px;
    border: 1px solid #e4dae9;
    border-radius: 8px;
    background: #fff;
    color: #3a2b48;
    font-size: 0.78rem;
    font-weight: 850;
    cursor: pointer;
}

.service-edit-button:hover,
.service-edit-button:focus-visible {
    border-color: #cdb8ef;
    background: #f8f1ff;
    color: var(--brand);
    outline: none;
}

.service-edit-button .ui-icon {
    width: 16px;
    height: 16px;
    flex-basis: 16px;
}

.floating-add-button {
    position: fixed;
    right: 26px;
    bottom: 26px;
    z-index: 50;
    width: 56px;
    height: 56px;
    display: inline-grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    box-shadow: 0 16px 34px rgba(75, 0, 130, 0.3);
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.floating-add-button:hover,
.floating-add-button:focus-visible {
    transform: translateY(-2px) scale(1.03);
    background: #5f1a96;
    box-shadow: 0 20px 42px rgba(75, 0, 130, 0.36);
    outline: none;
}

.clients-workspace {
    position: relative;
    min-height: calc(100vh - 132px);
    padding-bottom: 76px;
}

.clients-page-header {
    align-items: stretch;
    overflow: hidden;
    padding: 0;
    border-color: #e5d9f0;
    background: linear-gradient(135deg, #ffffff 0%, #fcf8ff 48%, #f3ecff 100%);
}

.client-page-title {
    display: grid;
    align-content: center;
    padding: 18px 20px;
}

.client-page-kicker {
    margin-bottom: 4px;
    color: var(--brand);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.client-page-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(86px, 1fr));
    min-width: min(560px, 100%);
    border-left: 1px solid rgba(95, 22, 150, 0.16);
    background: rgba(255, 255, 255, 0.72);
}

.client-page-metrics div {
    display: grid;
    align-content: center;
    gap: 3px;
    padding: 16px 18px;
    border-left: 1px solid rgba(95, 22, 150, 0.12);
}

.client-page-metrics div:first-child {
    border-left: 0;
}

.client-page-metrics strong {
    color: #1f2f35;
    font-size: 1.55rem;
    line-height: 1;
}

.client-page-metrics span {
    color: #5d6d72;
    font-size: 0.75rem;
    font-weight: 900;
    text-transform: uppercase;
}

.client-directory-panel {
    overflow: hidden;
    border: 1px solid #e7ddef;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 14px 34px rgba(44, 24, 64, 0.08);
}

.client-directory-toolbar {
    min-height: 78px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    border-bottom: 1px solid #ebe2f3;
    background: #fcfaff;
}

.client-directory-toolbar h3 {
    margin: 0 0 3px;
    color: #2f2140;
    font-size: 1.05rem;
}

.client-search-form {
    width: min(600px, 100%);
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto;
    align-items: center;
    gap: 8px;
}

.client-search-field {
    position: relative;
}

.client-search-field input {
    min-height: 44px;
    padding-left: 42px;
    padding-right: 42px;
    border-color: #e2d7eb;
    background: #fff;
    box-shadow: inset 0 1px 0 rgba(38, 50, 56, 0.03);
}

.client-search-icon,
.client-search-clear {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.client-search-icon {
    left: 13px;
    display: inline-flex;
    color: var(--brand);
    pointer-events: none;
}

.client-search-icon .ui-icon,
.client-search-clear .ui-icon {
    width: 17px;
    height: 17px;
}

.client-search-clear {
    right: 10px;
    width: 28px;
    height: 28px;
    display: inline-grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #7a8791;
    cursor: pointer;
}

.client-search-clear:hover,
.client-search-clear:focus-visible {
    background: #f5effb;
    color: var(--brand);
    outline: none;
}

.client-filter-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid #ede4f4;
    background: #ffffff;
}

.client-filter-group {
    display: inline-flex;
    overflow: hidden;
    border: 1px solid #e4dae9;
    border-radius: 8px;
    background: #fbf8fe;
}

.client-filter-pill {
    min-height: 34px;
    border: 0;
    border-left: 1px solid #e4dae9;
    padding: 0 12px;
    background: transparent;
    color: #44344f;
    cursor: pointer;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 900;
}

.client-filter-pill:first-child {
    border-left: 0;
}

.client-filter-pill:hover,
.client-filter-pill:focus-visible,
.client-filter-pill.is-active {
    background: #f0e7ff;
    color: var(--brand);
    outline: none;
}

.client-tag-filter select {
    min-height: 36px;
    min-width: 150px;
    border-color: #e4dae9;
    background: #fff;
    font-size: 0.8rem;
    font-weight: 850;
}

.client-filter-reset .ui-icon {
    width: 16px;
    height: 16px;
}

.client-table-status {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.client-directory-table-shell {
    max-height: min(680px, calc(100vh - 325px));
    overflow: auto;
    background:
        linear-gradient(90deg, #fff 30%, rgba(255, 255, 255, 0)),
        linear-gradient(90deg, rgba(255, 255, 255, 0), #fff 70%) 100% 0,
        linear-gradient(90deg, rgba(95, 22, 150, 0.08), rgba(95, 22, 150, 0)),
        linear-gradient(90deg, rgba(95, 22, 150, 0), rgba(95, 22, 150, 0.08)) 100% 0;
    background-attachment: local, local, scroll, scroll;
    background-repeat: no-repeat;
    background-size: 36px 100%, 36px 100%, 12px 100%, 12px 100%;
}

.client-directory-table {
    min-width: 1040px;
}

.client-directory-table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    padding: 0;
    border-bottom-color: #e5d9f0;
    background: #fbf8fe;
}

.client-directory-table tbody tr:nth-child(even) td {
    background: #fffafe;
}

.client-directory-table tbody tr:hover td {
    background: #fbf4ff;
}

.client-directory-table td {
    padding: 13px 12px;
    border-bottom-color: #eee5f4;
    vertical-align: middle;
}

.client-directory-table .client-name-column {
    position: sticky;
    left: 0;
    z-index: 2;
    min-width: 264px;
    background: #fff;
    box-shadow: 8px 0 16px rgba(44, 24, 64, 0.04);
}

.client-directory-table tbody tr:nth-child(even) .client-name-column {
    background: #fffafe;
}

.client-directory-table tbody tr:hover .client-name-column {
    background: #fbf4ff;
}

.client-directory-table thead th:first-child {
    left: 0;
    z-index: 4;
}

.client-sort-button {
    width: 100%;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border: 0;
    padding: 0 12px;
    background: transparent;
    color: #5d6d72;
    cursor: pointer;
    font: inherit;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.02em;
    text-align: left;
    text-transform: uppercase;
}

.client-sort-button .ui-icon {
    width: 15px;
    height: 15px;
    color: #8b9a9e;
}

.client-sort-button:hover,
.client-sort-button:focus-visible,
.client-sort-button.is-active {
    color: var(--brand);
    outline: none;
}

.client-sort-button.is-active .ui-icon {
    color: var(--brand);
}

.client-th-label {
    min-height: 44px;
    display: flex;
    align-items: center;
    padding: 0 12px;
    color: #5d6d72;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.client-identity {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
}

.client-avatar {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    display: inline-grid;
    place-items: center;
    border: 1px solid #dac8ee;
    border-radius: 50%;
    background: linear-gradient(135deg, #f4edff, #fff7fb);
    color: var(--brand);
    font-size: 0.78rem;
    font-weight: 900;
}

.client-identity strong,
.client-identity small,
.client-last-column strong,
.client-last-column span {
    display: block;
}

.client-identity strong {
    max-width: 210px;
    overflow: hidden;
    color: #213139;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.client-identity small {
    margin-top: 2px;
    color: #687981;
    font-size: 0.75rem;
    font-weight: 800;
}

.client-contact-column {
    min-width: 230px;
}

.client-contact-column a,
.client-contact-column span {
    min-height: 22px;
    display: flex;
    align-items: center;
    gap: 7px;
    overflow-wrap: anywhere;
    color: #31434b;
    font-size: 0.84rem;
    font-weight: 800;
}

.client-contact-column a + a,
.client-contact-column a + span,
.client-contact-column span + a,
.client-contact-column span + span {
    margin-top: 3px;
}

.client-contact-column .ui-icon {
    width: 15px;
    height: 15px;
    flex: 0 0 15px;
    color: var(--brand);
}

.client-care-note {
    display: block;
    max-width: 230px;
    margin-top: 5px;
    overflow: hidden;
    color: #64717c;
    font-size: 0.78rem;
    font-weight: 750;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.clients-workspace .badge.success {
    background: #f0e7ff;
    color: var(--brand);
}

.client-portal-state {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 9px;
    border: 1px solid #e1e6ea;
    border-radius: 999px;
    background: #f8fafb;
    color: #64717c;
    font-size: 0.76rem;
    font-weight: 900;
}

.client-portal-state.enabled {
    border-color: #d5c0eb;
    background: #f3ecff;
    color: var(--brand);
}

.client-portal-state .ui-icon {
    width: 15px;
    height: 15px;
}

.client-tags-column {
    max-width: 260px;
}

.client-tag {
    min-height: 26px;
    display: inline-flex;
    align-items: center;
    margin: 2px 3px 2px 0;
    border: 1px solid #e3e9ec;
    border-radius: 999px;
    padding: 3px 8px;
    background: #fff;
    color: #40545b;
    cursor: pointer;
    font: inherit;
    font-size: 0.72rem;
    font-weight: 850;
}

.client-tag:hover,
.client-tag:focus-visible {
    border-color: #d5c0eb;
    background: #f5effb;
    color: var(--brand);
    outline: none;
}

.client-last-column {
    min-width: 125px;
}

.client-last-column strong {
    color: #2b3d43;
    font-size: 0.86rem;
}

.client-last-column span {
    margin-top: 2px;
    font-size: 0.75rem;
    font-weight: 800;
}

.client-row-action-form {
    margin: 0;
}

.client-row-action {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid #e4dae9;
    border-radius: 8px;
    padding: 6px 10px;
    background: #fff;
    color: var(--brand);
    cursor: pointer;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 2px 8px rgba(44, 24, 64, 0.04);
}

.client-row-action:hover,
.client-row-action:focus-visible {
    border-color: #cdb8ef;
    background: #f5effb;
    outline: none;
}

.client-row-action .ui-icon {
    width: 15px;
    height: 15px;
}

.client-empty-state {
    display: grid;
    justify-items: center;
    gap: 4px;
    padding: 42px 16px;
    color: #64717c;
}

.client-empty-state strong {
    color: #2b3d43;
    font-size: 1rem;
}

.clients-workspace.is-loading .client-directory-panel {
    cursor: progress;
}

.clients-workspace.is-loading .client-directory-table-shell {
    opacity: 0.72;
}

.client-usage-strip {
    display: grid;
    grid-template-columns: minmax(210px, auto) minmax(180px, 1fr);
    align-items: center;
    gap: 18px;
    margin-top: 14px;
    padding: 13px 16px;
    border: 1px solid #e7ddef;
    border-radius: 8px;
    background: #fcfaff;
}

.client-usage-strip strong,
.client-usage-strip span {
    display: block;
}

.client-usage-strip strong {
    color: #223238;
}

.client-usage-strip span {
    margin-top: 2px;
    color: #64717c;
    font-size: 0.78rem;
    font-weight: 800;
}

.client-usage-strip .progress > span {
    background: linear-gradient(90deg, var(--brand), #8f43c4);
}

.client-floating-add-button {
    background: linear-gradient(135deg, var(--brand), #8f43c4);
}

.client-drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: flex;
    justify-content: flex-end;
    background: rgba(31, 18, 42, 0.36);
}

.client-drawer-backdrop[hidden] {
    display: none;
}

.client-create-drawer {
    width: min(680px, calc(100vw - 32px));
    height: 100%;
    overflow: hidden;
    border-left: 1px solid #d8cfe3;
    background: #fff;
    box-shadow: -22px 0 50px rgba(35, 24, 45, 0.24);
}

.client-create-form {
    height: 100%;
    overflow: auto;
    display: grid;
    align-content: start;
    gap: 15px;
    padding: 22px;
}

.client-drawer-header {
    position: sticky;
    top: -22px;
    z-index: 2;
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 16px;
    margin: -22px -22px 0;
    padding: 20px 22px 16px;
    border-bottom: 1px solid #e8eef0;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
}

.client-drawer-header span {
    color: var(--brand);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.client-drawer-header h2 {
    margin: 2px 0 0;
    color: #223238;
    font-size: 1.18rem;
}

.client-fieldset {
    min-width: 0;
    margin: 0;
    padding: 14px;
    border: 1px solid #eadff2;
    border-radius: 8px;
    background: #fcfaff;
}

.client-fieldset legend {
    padding: 0 6px;
    color: #223238;
    font-size: 0.84rem;
    font-weight: 900;
}

.client-consent-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 12px;
}

.client-drawer-actions {
    position: sticky;
    bottom: -22px;
    z-index: 2;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin: 0 -22px -22px;
    padding: 14px 22px;
    border-top: 1px solid #e8eef0;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
}

.client-record-workspace {
    display: grid;
    gap: 14px;
    padding-bottom: 24px;
}

.client-record-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px;
    border: 1px solid #e4d8ef;
    border-radius: 8px;
    background: linear-gradient(135deg, #ffffff 0%, #fcf8ff 54%, #f3ecff 100%);
    box-shadow: 0 12px 28px rgba(44, 24, 64, 0.08);
}

.client-record-identity {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 14px;
}

.client-record-avatar {
    width: 58px;
    height: 58px;
    flex: 0 0 58px;
    display: grid;
    place-items: center;
    border: 1px solid #d4bdea;
    border-radius: 50%;
    background: #f0e7ff;
    color: var(--brand);
    font-size: 1rem;
    font-weight: 900;
    box-shadow: inset 0 0 0 1px rgba(75, 0, 130, 0.08);
}

.client-record-eyebrow {
    display: block;
    margin-bottom: 3px;
    color: var(--brand);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.client-record-hero h2 {
    margin: 0;
    color: #2f2140;
    font-size: 1.55rem;
    line-height: 1.05;
}

.client-record-contact-line,
.client-record-badges,
.client-record-actions,
.client-chip-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.client-record-contact-line {
    margin-top: 7px;
    color: #63717b;
    font-size: 0.86rem;
    font-weight: 800;
}

.client-record-contact-line a,
.client-record-contact-line span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.client-record-contact-line .ui-icon {
    width: 15px;
    height: 15px;
    color: var(--brand);
}

.client-record-badges {
    margin-top: 10px;
}

.client-record-badge,
.client-record-tag,
.client-consent-chip,
.client-table-status-pill {
    min-height: 25px;
    display: inline-flex;
    align-items: center;
    border: 1px solid #e2d8eb;
    border-radius: 999px;
    padding: 4px 9px;
    background: #fff;
    color: #3f314b;
    font-size: 0.74rem;
    font-weight: 900;
    text-transform: capitalize;
}

.client-record-badge.is-active,
.client-consent-chip.is-active {
    border-color: #d4bdea;
    background: #f0e7ff;
    color: var(--brand);
}

.client-record-badge.is-muted,
.client-consent-chip.is-muted {
    background: #fbfafc;
    color: #67727c;
}

.client-record-tag {
    background: #fff;
    color: #463552;
}

.client-record-actions {
    flex: 0 0 auto;
    justify-content: flex-end;
}

.client-record-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.client-record-metric {
    min-width: 0;
    padding: 14px 15px;
    border: 1px solid #e6dcef;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 6px 18px rgba(44, 24, 64, 0.05);
}

.client-record-metric span,
.client-care-summary span,
.client-key-value-list span {
    display: block;
    color: #6d5d78;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.client-record-metric strong {
    display: block;
    margin-top: 5px;
    overflow: hidden;
    color: #2f2140;
    font-size: 1rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.client-record-metric small {
    display: block;
    margin-top: 4px;
    overflow: hidden;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.client-record-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr) minmax(300px, 0.8fr);
    gap: 14px;
    align-items: start;
}

.client-record-workflows,
.client-record-split,
.client-record-library {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    align-items: start;
}

.client-record-library {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.client-record-panel {
    min-width: 0;
    padding: 16px;
    border: 1px solid #eadff2;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 22px rgba(44, 24, 64, 0.06);
}

.client-record-panel-large {
    min-height: 100%;
}

.client-record-panel h3,
.client-record-panel-heading h3 {
    margin: 0;
    color: #2f2140;
    font-size: 1rem;
}

.client-record-panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 13px;
}

.client-record-panel-heading span {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 750;
}

.client-care-summary,
.client-key-value-list,
.client-mini-list {
    display: grid;
    gap: 0;
}

.client-care-summary > div,
.client-key-value-list > div,
.client-mini-list > div,
.client-timeline-item {
    display: grid;
    gap: 4px;
    padding: 11px 0;
    border-bottom: 1px solid #efe7f5;
}

.client-care-summary > div:first-child,
.client-key-value-list > div:first-child,
.client-mini-list > div:first-child {
    padding-top: 0;
}

.client-care-summary > div:last-child,
.client-key-value-list > div:last-child,
.client-mini-list > div:last-child,
.client-timeline-item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.client-care-summary p {
    margin: 0;
    color: #31414a;
    font-size: 0.9rem;
    font-weight: 750;
    line-height: 1.35;
}

.client-record-note,
.client-empty-compact {
    margin-top: 12px;
    border: 1px dashed #d8cfe3;
    border-radius: 8px;
    padding: 11px 12px;
    background: #fbf7ff;
    color: #62556f;
    font-size: 0.84rem;
    font-weight: 800;
}

.client-empty-compact {
    margin-top: 0;
}

.client-appointment-card {
    display: grid;
    gap: 3px;
    padding: 12px 0;
    border-top: 1px solid #efe7f5;
    border-bottom: 1px solid #efe7f5;
}

.client-appointment-card strong,
.client-appointment-card span,
.client-appointment-card small,
.client-mini-list strong,
.client-mini-list span,
.client-key-value-list strong {
    display: block;
}

.client-appointment-card strong,
.client-mini-list strong,
.client-key-value-list strong {
    color: #2f3d45;
    font-size: 0.9rem;
}

.client-appointment-card span,
.client-mini-list span,
.client-appointment-card small {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 800;
}

.client-key-value-list > div {
    grid-template-columns: minmax(100px, 0.7fr) minmax(0, 1fr);
    align-items: center;
}

.client-chip-row {
    margin-top: 12px;
}

.client-record-form {
    display: grid;
    gap: 12px;
}

.client-record-form textarea {
    min-height: 92px;
}

.client-record-form .btn {
    justify-self: end;
}

.client-inline-check {
    align-self: end;
}

.client-record-table-wrap {
    min-width: 0;
    overflow-x: auto;
}

.client-record-table th,
.client-record-table td {
    padding: 10px 9px;
}

.client-record-table tbody tr:hover td {
    background: #fbf7ff;
}

.client-table-status-pill {
    min-height: 23px;
    padding: 3px 8px;
    background: #fbf8fe;
    color: #4a3b55;
    white-space: nowrap;
}

.client-record-timeline {
    display: grid;
}

.client-timeline-item {
    grid-template-columns: 128px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
}

.client-timeline-item > span {
    color: #6d5d78;
    font-size: 0.78rem;
    font-weight: 900;
}

.client-timeline-item strong,
.client-timeline-item p {
    display: block;
}

.client-timeline-item strong {
    color: #26323a;
}

.client-timeline-item p {
    margin: 2px 0 0;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
}

.client-record-workspace {
    display: grid;
    gap: 12px;
    padding-bottom: 28px;
}

.client-record-banner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 24px;
    min-width: 0;
    padding: 20px 22px;
    border: 1px solid #dfd1ec;
    border-radius: 8px;
    background: linear-gradient(135deg, #ffffff 0%, #fbf8ff 52%, #f3ebff 100%);
    box-shadow: 0 12px 28px rgba(55, 30, 80, 0.08);
}

.client-record-banner-main {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 15px;
}

.client-record-identity {
    min-width: 0;
    display: block;
}

.client-record-avatar {
    width: 62px;
    height: 62px;
    flex: 0 0 62px;
    display: grid;
    place-items: center;
    border: 1px solid #cfb6e8;
    border-radius: 50%;
    background: #eee3ff;
    color: var(--brand);
    font-size: 1rem;
    font-weight: 900;
    box-shadow: inset 0 0 0 1px rgba(95, 22, 150, 0.1);
}

.client-record-eyebrow {
    display: block;
    margin-bottom: 3px;
    color: var(--brand);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.client-record-banner h2 {
    margin: 0;
    color: #2f2140;
    font-size: 1.62rem;
    line-height: 1.05;
}

.client-record-contact-line,
.client-record-badges,
.client-record-banner-actions,
.client-chip-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.client-record-contact-line {
    margin-top: 7px;
    color: #63717b;
    font-size: 0.86rem;
    font-weight: 800;
}

.client-record-contact-line a,
.client-record-contact-line span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.client-record-contact-line .ui-icon {
    width: 15px;
    height: 15px;
    color: var(--brand);
}

.client-record-badges {
    margin-top: 10px;
}

.client-record-badge,
.client-record-tag,
.client-consent-chip,
.client-table-status-pill {
    min-height: 25px;
    display: inline-flex;
    align-items: center;
    border: 1px solid #e2d8eb;
    border-radius: 999px;
    padding: 4px 9px;
    background: #fff;
    color: #3f314b;
    font-size: 0.74rem;
    font-weight: 900;
    text-transform: capitalize;
}

.client-record-badge.is-active,
.client-consent-chip.is-active {
    border-color: #caaee8;
    background: #f0e7ff;
    color: var(--brand);
}

.client-record-badge.is-muted,
.client-consent-chip.is-muted {
    background: #fbfafc;
    color: #67727c;
}

.client-record-tag {
    background: #fff;
    color: #463552;
}

.client-record-banner-actions {
    justify-content: flex-end;
}

.client-record-subnav {
    position: sticky;
    top: 0;
    z-index: 12;
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 54px;
    padding: 8px 10px 8px 16px;
    border: 1px solid #e3d7ee;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 8px 20px rgba(55, 30, 80, 0.07);
    backdrop-filter: blur(12px);
}

.client-record-subnav-label {
    flex: 0 0 auto;
    color: #6e5d7b;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.client-record-subnav-links {
    min-width: 0;
    margin-left: auto;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: thin;
}

.client-record-tab,
.client-record-subnav-links a {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #d8c5ea;
    border-radius: 8px;
    padding: 0 14px;
    background: #fff;
    box-shadow: 0 3px 10px rgba(55, 30, 80, 0.06);
    color: #3d2b4e;
    font-size: 0.8rem;
    font-weight: 900;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, color 0.16s ease;
}

.client-record-tab:hover,
.client-record-tab:focus-visible,
.client-record-subnav-links a:hover,
.client-record-subnav-links a:focus-visible {
    border-color: #b88add;
    background: #f4ecff;
    color: var(--brand);
    box-shadow: 0 5px 14px rgba(75, 0, 130, 0.12);
}

.client-record-tab.is-active,
.client-record-subnav-links a.is-active {
    border-color: var(--brand);
    background: var(--brand);
    color: #fff;
    box-shadow: 0 8px 18px rgba(75, 0, 130, 0.22);
}

.client-record-tab.is-active:focus-visible,
.client-record-subnav-links a.is-active:focus-visible {
    outline: 2px solid #cfb6e8;
    outline-offset: 2px;
}

.client-record-section {
    min-width: 0;
    overflow: hidden;
    scroll-margin-top: 72px;
    border: 1px solid #e5d9ef;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 22px rgba(55, 30, 80, 0.055);
}

.client-record-section[hidden] {
    display: none !important;
}

.client-record-section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 18px;
    border-bottom: 1px solid #eee4f5;
    background: #fff;
}

.client-record-section-header span {
    display: block;
    color: var(--brand);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.client-record-section-header h3,
.client-record-block h4,
.client-record-form-header h4 {
    margin: 2px 0 0;
    color: #2f2140;
    font-size: 1rem;
}

.client-record-section-header p {
    max-width: 520px;
    margin: 0;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1.35;
    text-align: right;
}

.client-summary-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    background: #fcfaff;
    border-bottom: 1px solid #eee4f5;
}

.client-summary-item {
    min-width: 0;
    padding: 14px 18px;
    border-left: 1px solid #eee4f5;
}

.client-summary-item:first-child {
    border-left: 0;
}

.client-summary-item span,
.client-data-rows span,
.client-mini-table span {
    display: block;
    color: #6d5d78;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.client-summary-item strong {
    display: block;
    margin-top: 5px;
    overflow: hidden;
    color: #2f2140;
    font-size: 1rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.client-summary-item small {
    display: block;
    margin-top: 4px;
    overflow: hidden;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.client-overview-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.85fr);
}

.client-record-side {
    display: grid;
    grid-template-rows: auto 1fr;
    border-left: 1px solid #eee4f5;
}

.client-record-block {
    min-width: 0;
    padding: 18px;
}

.client-record-side .client-record-block + .client-record-block,
.client-library-layout .client-record-block.is-wide {
    border-top: 1px solid #eee4f5;
}

.client-record-block h4,
.client-record-form-header h4 {
    font-size: 0.95rem;
}

.client-record-block p,
.client-record-form-header span {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 0.81rem;
    font-weight: 800;
    line-height: 1.35;
}

.client-data-rows {
    display: grid;
    gap: 0;
    margin-top: 13px;
}

.client-data-rows > div,
.client-mini-table > div {
    display: grid;
    grid-template-columns: minmax(128px, 0.34fr) minmax(0, 1fr);
    align-items: start;
    gap: 16px;
    padding: 11px 0;
    border-bottom: 1px solid #f0e8f6;
}

.client-data-rows > div:first-child,
.client-mini-table > div:first-child {
    padding-top: 0;
}

.client-data-rows > div:last-child,
.client-mini-table > div:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.client-data-rows strong,
.client-mini-table strong {
    min-width: 0;
    color: #31414a;
    font-size: 0.88rem;
    font-weight: 850;
    line-height: 1.35;
}

.client-data-rows.is-compact > div {
    grid-template-columns: 112px minmax(0, 1fr);
}

.client-record-note,
.client-empty-compact {
    margin-top: 12px;
    border: 1px dashed #d8cfe3;
    border-radius: 8px;
    padding: 11px 12px;
    background: #fbf7ff;
    color: #62556f;
    font-size: 0.84rem;
    font-weight: 800;
}

.client-empty-compact {
    display: inline-flex;
    margin-top: 0;
}

.client-visit-focus {
    display: grid;
    gap: 3px;
    margin-top: 13px;
    padding: 13px 14px;
    border: 1px solid #e3d7ee;
    border-radius: 8px;
    background: #fbf8ff;
}

.client-visit-focus strong,
.client-visit-focus span,
.client-visit-focus small {
    display: block;
}

.client-visit-focus strong {
    color: #2f2140;
    font-size: 0.95rem;
}

.client-visit-focus span,
.client-visit-focus small {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
}

.client-mini-table {
    display: grid;
    margin-top: 13px;
}

.client-record-table-wrap {
    min-width: 0;
    overflow-x: auto;
}

.client-record-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.client-record-table th,
.client-record-table td {
    padding: 12px 18px;
    border-bottom: 1px solid #efe7f5;
    text-align: left;
    vertical-align: middle;
}

.client-record-table th {
    background: #fbf8ff;
    color: #6d5d78;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.client-record-table td {
    color: #31414a;
    font-size: 0.86rem;
    font-weight: 780;
}

.client-record-table td strong,
.client-record-table td span {
    display: block;
}

.client-record-table td span:not(.client-table-status-pill) {
    margin-top: 3px;
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 800;
}

.client-record-table tbody tr:last-child td {
    border-bottom: 0;
}

.client-record-table tbody tr:hover td {
    background: #fcf9ff;
}

.client-table-status-pill {
    min-height: 23px;
    width: max-content;
    padding: 3px 8px;
    background: #fbf8fe;
    color: #4a3b55;
    white-space: nowrap;
}

.client-library-layout,
.client-settings-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.client-library-layout .client-record-block,
.client-settings-layout .client-record-form {
    border-left: 1px solid #eee4f5;
}

.client-library-layout .client-record-block:first-child,
.client-settings-layout .client-record-form:first-child {
    border-left: 0;
}

.client-library-layout .client-record-block.is-wide {
    grid-column: 1 / -1;
    border-left: 0;
}

.client-library-layout .client-record-table {
    margin-top: 13px;
}

.client-record-form {
    min-width: 0;
    display: grid;
    gap: 13px;
    padding: 18px;
}

.client-record-form textarea {
    min-height: 104px;
}

.client-record-form .btn {
    justify-self: end;
}

.client-record-form-header {
    min-width: 0;
}

.client-inline-check {
    align-self: end;
}

.client-record-workspace {
    --client-record-panel-height: clamp(380px, calc(100vh - 372px), 680px);
}

.client-record-section {
    display: flex;
    flex-direction: column;
}

.client-record-section.is-active {
    max-height: var(--client-record-panel-height);
}

.client-record-section-header,
.client-summary-strip {
    flex: 0 0 auto;
}

.client-overview-layout,
.client-contact-layout,
.client-visits-layout,
.client-library-layout,
.client-payment-layout,
.client-preferences-layout {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.client-contact-layout,
.client-payment-layout,
.client-preferences-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.client-contact-layout .client-record-block,
.client-payment-layout .client-record-block,
.client-preferences-layout .client-record-block {
    min-height: 0;
    overflow: auto;
    border-left: 1px solid #eee4f5;
}

.client-contact-layout .client-record-block:first-child,
.client-payment-layout .client-record-block:first-child,
.client-preferences-layout .client-record-block:first-child {
    border-left: 0;
}

.client-contact-layout .client-record-block.is-wide {
    grid-column: 1 / -1;
    border-top: 1px solid #eee4f5;
    border-left: 0;
}

.client-overview-layout .client-record-block,
.client-record-side,
.client-library-layout .client-record-block {
    min-height: 0;
    overflow: auto;
}

.client-visits-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
}

.client-visits-layout.has-flyout {
    grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
}

.client-visits-list {
    min-width: 0;
    min-height: 0;
    overflow: auto;
    padding: 12px;
}

.client-visit-accordion {
    border: 1px solid #eadff2;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 4px 14px rgba(55, 30, 80, 0.04);
}

.client-visit-accordion + .client-visit-accordion {
    margin-top: 8px;
}

.client-visit-accordion summary {
    min-height: 54px;
    display: grid;
    grid-template-columns: minmax(190px, 0.55fr) minmax(230px, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 9px 14px;
    color: #2f2140;
    cursor: pointer;
    list-style: none;
}

.client-visit-accordion summary::-webkit-details-marker {
    display: none;
}

.client-visit-accordion summary strong,
.client-visit-accordion summary small {
    display: inline;
}

.client-visit-accordion summary small {
    margin-top: 0;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
}

.client-visit-date,
.client-visit-service {
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: 8px;
    white-space: nowrap;
}

.client-visit-service strong {
    overflow: hidden;
    text-overflow: ellipsis;
}

.client-visit-counts {
    display: inline-flex;
    justify-content: flex-end;
    gap: 6px;
}

.client-visit-counts b {
    min-height: 26px;
    display: inline-flex;
    align-items: center;
    border: 1px solid #ddcfeb;
    border-radius: 999px;
    padding: 3px 9px;
    background: #fbf8ff;
    color: #4b3860;
    font-size: 0.74rem;
    font-weight: 900;
    white-space: nowrap;
}

.client-visit-detail {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    padding: 0 14px 14px;
    border-top: 1px solid #f0e8f6;
}

.client-visit-note-list {
    display: grid;
    gap: 8px;
    min-width: 0;
    padding-top: 12px;
}

.client-visit-note-list article {
    display: grid;
    gap: 7px;
    border: 1px solid #eee4f5;
    border-radius: 8px;
    padding: 11px 12px;
    background: #fcfaff;
}

.client-visit-note-list article strong,
.client-visit-note-list article span {
    display: block;
}

.client-visit-note-list article span {
    margin-top: 2px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
}

.client-visit-note-list article p {
    margin: 0;
    color: #31414a;
    font-size: 0.84rem;
    font-weight: 750;
    line-height: 1.42;
}

.client-visit-actions {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding-top: 12px;
}

.client-body-chart-flyout {
    min-width: 0;
    min-height: 0;
    overflow: auto;
    border-left: 1px solid #eee4f5;
    background: #fbf8ff;
}

.client-body-chart-heading {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 15px;
    border-bottom: 1px solid #eadff2;
    background: rgba(251, 248, 255, 0.96);
    backdrop-filter: blur(10px);
}

.client-body-chart-heading h4 {
    margin: 0;
    color: #2f2140;
    font-size: 0.95rem;
}

.client-body-chart-heading span {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
}

.client-body-chart-content {
    display: grid;
    gap: 10px;
    padding: 14px;
}

.client-body-chart-mark {
    display: grid;
    gap: 5px;
    border: 1px solid #e3d7ee;
    border-radius: 8px;
    padding: 12px;
    background: #fff;
}

.client-body-chart-mark strong,
.client-body-chart-mark span {
    display: block;
}

.client-body-chart-mark span {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 850;
    text-transform: capitalize;
}

.client-body-chart-mark p {
    margin: 0;
    color: #31414a;
    font-size: 0.84rem;
    font-weight: 750;
    line-height: 1.4;
}

.client-payment-layout {
    grid-template-columns: minmax(280px, 0.72fr) minmax(0, 1.28fr);
}

.client-payment-stack {
    min-height: 0;
    display: grid;
    grid-template-rows: repeat(2, minmax(0, 1fr));
    border-right: 1px solid #eee4f5;
}

.client-payment-stack .client-record-block {
    border-left: 0;
    border-bottom: 1px solid #eee4f5;
}

.client-payment-stack .client-record-block:last-child {
    border-bottom: 0;
}

.client-payment-focus {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.client-payment-focus span {
    color: #6d5d78;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.client-payment-focus strong {
    color: #2f2140;
    font-size: 1.25rem;
}

.client-payment-focus .btn {
    justify-self: start;
}

.client-payment-summary-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    flex: 0 0 auto;
    border-bottom: 1px solid #eee4f5;
    background: #fcfaff;
}

.client-payment-summary-strip > div {
    min-width: 0;
    padding: 14px 18px;
    border-left: 1px solid #eee4f5;
}

.client-payment-summary-strip > div:first-child {
    border-left: 0;
}

.client-payment-summary-strip span,
.client-payment-summary-strip small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.client-payment-summary-strip span {
    color: #6d5d78;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.client-payment-summary-strip strong {
    display: block;
    margin-top: 5px;
    overflow: hidden;
    color: #2f2140;
    font-size: 1rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.client-payment-summary-strip small {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
}

.client-payment-ledger-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #eee4f5;
}

.client-payment-ledger-grid h4 {
    margin-bottom: 8px;
}

.client-financial-row {
    min-width: 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f0e8f6;
}

.client-financial-row:last-child {
    border-bottom: 0;
}

.client-financial-row strong,
.client-financial-row span:not(.client-table-status-pill) {
    display: block;
}

.client-financial-row strong {
    color: #2f2140;
    font-size: 0.88rem;
}

.client-financial-row span:not(.client-table-status-pill) {
    margin-top: 3px;
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 800;
}

.client-preferences-form {
    min-height: 0;
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
}

.client-preferences-layout {
    grid-template-columns: minmax(0, 1fr);
}

.client-preferences-layout .client-record-block {
    min-height: 0;
    overflow: auto;
}

.client-preferences-form:not(.is-editing) textarea {
    border-color: transparent;
    background: #fbfcfc;
    box-shadow: none;
    color: #2f3a40;
    resize: none;
}

.client-preferences-form:not(.is-editing) textarea:focus {
    outline: none;
    border-color: transparent;
    box-shadow: none;
}

.client-care-edit-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.client-record-badge.is-preference {
    border-color: #d8cfe3;
    background: #fff;
    color: #4d3d5d;
}

.client-overview-status-form {
    gap: 12px;
}

.client-app-access-toggle {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    border: 1px solid #e1e5e8;
    border-radius: 8px;
    padding: 9px 11px;
    background: #f8f9fa;
    color: #66747c;
    font-weight: 900;
}

.client-app-access-toggle.is-on {
    border-color: #d3b9ea;
    background: #f4ecff;
    color: var(--brand);
}

.client-app-access-toggle input {
    width: 16px;
    height: 16px;
    margin: 0;
}

.client-contact-note {
    margin: 14px 0 0;
    color: #6d5d78;
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1.4;
}

.client-record-controls {
    display: grid;
    gap: 14px;
    margin-top: 14px;
}

.client-preferences-actions {
    flex: 0 0 auto;
    display: flex;
    justify-content: flex-end;
    border-top: 1px solid #eee4f5;
    padding: 12px 18px;
    background: #fff;
}

.client-record-tab {
    flex: 0 0 auto;
}

.service-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(31, 18, 42, 0.42);
}

.service-modal-backdrop[hidden] {
    display: none;
}

.service-modal {
    position: relative;
    width: min(760px, 100%);
    max-height: calc(100vh - 48px);
    overflow: hidden;
    border: 1px solid #d8cfe3;
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow-strong);
}

.form-builder-modal {
    width: min(820px, 100%);
}

.service-modal-form {
    max-height: calc(100vh - 48px);
    overflow: auto;
    display: grid;
    gap: 18px;
    padding: 20px;
}

.service-modal-header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 16px;
    padding-right: 54px;
}

.service-modal-header span {
    color: var(--brand);
    font-size: 0.76rem;
    font-weight: 900;
    text-transform: uppercase;
}

.service-modal-header h2 {
    margin: 2px 0 0;
    color: #2f2140;
    font-size: 1.18rem;
}

.service-fieldset {
    min-width: 0;
    margin: 0;
    padding: 14px;
    border: 1px solid #eadff2;
    border-radius: 8px;
}

.service-fieldset legend {
    padding: 0 6px;
    color: #2f2140;
    font-size: 0.86rem;
    font-weight: 900;
}

.form-fields-fieldset {
    background: #fbfafc;
}

.clinical-note-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border: 1px solid #e6edf2;
    border-radius: 8px;
    background: #fbfdfe;
}

.clinical-note-summary strong,
.clinical-note-summary span {
    display: block;
}

.clinical-note-summary strong {
    color: #26323a;
    font-size: 0.98rem;
}

.clinical-note-summary span {
    max-width: 480px;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 750;
}

.form-field-builder-list {
    display: grid;
    gap: 10px;
    margin-bottom: 12px;
}

.form-field-builder-row {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid #e8dfef;
    border-radius: 8px;
    background: #fff;
}

.form-field-builder-main {
    display: grid;
    grid-template-columns: minmax(220px, 1.2fr) minmax(160px, 0.8fr) auto auto 36px;
    align-items: end;
    gap: 10px;
}

.share-client-line {
    display: none;
}

.service-modal-form.is-note-form .form-fields-fieldset {
    background: #fff;
}

.service-modal-form.is-note-form .form-field-builder-main {
    grid-template-columns: minmax(260px, 1fr) 160px auto 36px;
}

.service-modal-form.is-note-form .form-field-builder-row .required-line {
    display: none;
}

.service-modal-form.is-note-form .form-field-builder-row .share-client-line {
    display: flex;
}

.service-modal-form.is-note-form .form-field-builder-row {
    padding: 10px;
}

.form-field-builder-row textarea {
    min-height: 38px;
    resize: vertical;
}

.form-field-builder-row .calendar-icon-btn {
    align-self: end;
}

.form-field-builder-row .checkbox-line {
    align-self: center;
    min-height: 38px;
    color: #3a3142;
    font-size: 0.78rem;
    font-weight: 900;
}

.form-field-choices[hidden] {
    display: none;
}

.form-field-choices textarea {
    min-height: 58px;
}

.form-static-value {
    min-height: 38px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid #e4dae9;
    border-radius: 8px;
    background: #fbfafc;
    color: #3a2b48;
    font-size: 0.86rem;
    font-weight: 900;
}

.form-static-value .ui-icon {
    width: 16px;
    height: 16px;
    color: var(--brand);
}

.soap-body-chart-field {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border: 1px solid #dce8ee;
    border-radius: 8px;
    background: #fbfdfe;
}

.soap-body-chart-field.is-disabled {
    background: #f7f8fa;
    color: #7a8791;
}

.soap-body-chart-field.is-disabled .btn {
    cursor: not-allowed;
    opacity: 0.65;
}

.soap-body-chart-field strong,
.soap-body-chart-field span {
    display: block;
}

.soap-body-chart-field strong {
    color: #26323a;
    font-size: 0.9rem;
}

.soap-body-chart-field span {
    margin-top: 2px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 750;
}

.form-advanced-settings {
    padding: 12px 14px;
    border: 1px solid #eadff2;
    border-radius: 8px;
    background: #fff;
}

.form-advanced-settings summary {
    cursor: pointer;
    color: #3a2b48;
    font-size: 0.86rem;
    font-weight: 900;
}

.form-advanced-settings .form-grid {
    margin-top: 12px;
}

.service-color-picker {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.service-color-choice {
    min-width: 0;
    min-height: 42px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border: 1px solid #e4dae9;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
}

.service-color-choice input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.service-color-choice span {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: var(--service-color);
    box-shadow: 0 0 0 1px rgba(38, 50, 56, 0.18);
}

.service-color-choice strong {
    min-width: 0;
    overflow: hidden;
    color: #2f2140;
    font-size: 0.8rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.service-color-choice:has(input:checked) {
    border-color: #cdb8ef;
    background: #f8f1ff;
    box-shadow: inset 0 0 0 1px rgba(75, 0, 130, 0.08);
}

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

.service-form-option {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 9px;
    border: 1px solid #e4dae9;
    border-radius: 8px;
    background: #fff;
}

.service-form-option span,
.service-form-option strong,
.service-form-option small {
    display: block;
    min-width: 0;
}

.service-form-option strong {
    color: #26323a;
    font-size: 0.84rem;
}

.service-form-option small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 0.72rem;
    text-transform: capitalize;
}

.service-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.brand-mark {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 22px;
}

.brand-icon {
    width: 38px;
    height: 38px;
    border: 1px solid #cdb8ef;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: var(--brand-soft);
    color: var(--brand);
    font-weight: 900;
    overflow: hidden;
    flex: 0 0 38px;
}

.auth-page,
.portal-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px;
    background: #f3f2f5;
}

.auth-card,
.portal-card {
    width: min(520px, 100%);
    border: 1px solid var(--brand-frame-line);
    border-radius: 10px;
    padding: 33px;
    background: #fff;
    box-shadow: 0 0 0 5px var(--brand-frame), 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Client portal application */
.portal-page { min-height: 100vh; display: block; place-items: initial; padding: 0; background: #f5f4f8; color: #292637; }
.client-portal-app, .client-portal-auth-shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 24px 0 64px; }
.client-portal-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 18px; margin-bottom: 16px; background: rgba(255,255,255,.94); border: 1px solid #e7e3ee; border-radius: 20px; box-shadow: 0 12px 34px rgba(51,36,79,.07); position: sticky; top: 12px; z-index: 30; backdrop-filter: blur(16px); }
.client-portal-brand, .client-portal-auth-brand, .client-portal-welcome, .client-portal-welcome > div { display: flex; align-items: center; gap: 12px; }
.client-portal-brand img, .client-portal-auth-brand img { border-radius: 12px; }
.client-portal-brand div, .client-portal-auth-brand div, .client-portal-welcome > div { display: grid; gap: 1px; }
.client-portal-brand span, .client-portal-welcome span, .client-portal-auth-brand span { color: #777184; font-size: 12px; }
.client-portal-brand strong, .client-portal-welcome strong { color: #302a3b; }
.portal-icon-button { display: inline-flex; align-items: center; gap: 7px; border: 0; background: transparent; color: #5d536e; cursor: pointer; font: inherit; padding: 8px 10px; border-radius: 10px; }
.portal-icon-button:hover { background: #f1edf7; }
.client-portal-tabs { display: grid; grid-template-columns: repeat(9, 1fr); gap: 7px; padding: 8px; margin-bottom: 20px; background: #fff; border: 1px solid #e7e3ee; border-radius: 18px; box-shadow: 0 10px 30px rgba(51,36,79,.05); }
.client-portal-tabs a { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 46px; color: #6c6577; text-decoration: none; border-radius: 12px; font-size: 13px; font-weight: 700; position: relative; }
.client-portal-tabs a:hover, .client-portal-tabs a.is-active { background: #efe9f8; color: #4b1c71; }
.client-portal-tabs b { display: grid; place-items: center; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; background: #7a3da0; color: #fff; font-size: 10px; }
.client-portal-content { display: block; }
.client-portal-panel { display: none; animation: portal-in .18s ease; }
.client-portal-panel.is-active { display: block; }
@keyframes portal-in { from { opacity: 0; transform: translateY(4px); } }
.portal-flash-stack { display: grid; gap: 8px; margin: 0 0 18px; }
.portal-flash { padding: 12px 15px; border-radius: 12px; border: 1px solid #dcd5e5; background: #fff; }
.portal-flash.success { background: #eef9f1; border-color: #c9e8d1; color: #275f37; }
.portal-flash.error { background: #fff0f0; border-color: #efcaca; color: #8a2d2d; }
.portal-flash.info { background: #eef5ff; border-color: #ccdcf5; color: #315e89; }
.portal-hero-card { display: flex; justify-content: space-between; align-items: end; gap: 28px; padding: 36px; color: #fff; background: linear-gradient(135deg, #35124f 0%, #653180 55%, #9370ab 100%); border-radius: 26px; box-shadow: 0 20px 50px rgba(65,29,91,.18); overflow: hidden; position: relative; }
.portal-hero-card::after { content: ''; position: absolute; width: 280px; height: 280px; right: -80px; top: -130px; border-radius: 50%; border: 50px solid rgba(255,255,255,.08); }
.portal-hero-card > * { position: relative; z-index: 1; }
.portal-hero-card h1, .portal-page-heading h1 { margin: 5px 0 8px; font-size: clamp(28px, 4vw, 43px); line-height: 1.08; letter-spacing: -.035em; }
.portal-hero-card p { max-width: 680px; margin: 0; color: rgba(255,255,255,.82); }
.portal-kicker { display: block; color: #7a4b96; text-transform: uppercase; letter-spacing: .12em; font-size: 11px; font-weight: 800; }
.portal-hero-card .portal-kicker { color: #d9c8e5; }
.portal-primary, .portal-secondary, .portal-danger { border: 0; border-radius: 11px; min-height: 42px; padding: 10px 16px; font: inherit; font-weight: 800; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 7px; text-decoration: none; }
.portal-primary { background: #5b267c; color: #fff; box-shadow: 0 8px 18px rgba(76,29,104,.18); }
.portal-primary:hover { background: #481961; }
.portal-hero-card .portal-primary { background: #fff; color: #4b1c70; white-space: nowrap; }
.portal-secondary { background: #f0ebf5; color: #522272; }
.portal-secondary:hover { background: #e5ddec; }
.portal-danger { background: #fdecec; color: #9c3434; }
.portal-button-link { width: fit-content; }
.portal-summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 18px 0; }
.portal-summary-grid article { display: flex; gap: 13px; padding: 18px; background: #fff; border: 1px solid #e7e3ee; border-radius: 18px; }
.portal-summary-grid article > span { display: grid; place-items: center; flex: 0 0 39px; height: 39px; color: #653080; background: #f0e9f5; border-radius: 12px; }
.portal-summary-grid article div { display: grid; gap: 3px; min-width: 0; }
.portal-summary-grid small, .portal-detail-grid small, .portal-invoice-total small, .portal-saved-card small { color: #817b88; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; }
.portal-summary-grid strong { font-size: 16px; }
.portal-summary-grid p { margin: 0; color: #777184; font-size: 12px; line-height: 1.45; }
.portal-section-card { background: #fff; border: 1px solid #e7e3ee; border-radius: 20px; padding: 22px; box-shadow: 0 10px 30px rgba(51,36,79,.045); }
.portal-section-heading, .portal-page-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.portal-section-heading h2, .portal-section-heading h3, .portal-section-card h2, .portal-section-card h3 { margin: 3px 0; }
.portal-section-heading p { margin: 4px 0 0; color: #777184; }
.portal-page-heading { margin: 10px 0 22px; align-items: end; }
.portal-page-heading p { margin: 0; color: #736d7d; }
.portal-detail-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 18px; }
.portal-detail-grid > div { display: grid; gap: 4px; padding: 14px; background: #f8f6fa; border-radius: 12px; }
.portal-booking-layout { display: grid; grid-template-columns: 310px 1fr; gap: 16px; align-items: start; }
.portal-form-stack { display: grid; gap: 14px; }
.portal-form-stack label { display: grid; gap: 6px; color: #514b5b; font-size: 13px; font-weight: 700; }
.portal-form-stack input, .portal-form-stack select, .portal-form-stack textarea { width: 100%; border: 1px solid #dcd6e3; border-radius: 10px; background: #fff; color: #2f2a36; padding: 10px 11px; font: inherit; font-weight: 500; }
.portal-form-stack input:focus, .portal-form-stack select:focus, .portal-form-stack textarea:focus { outline: 3px solid rgba(111,65,142,.12); border-color: #7b4b97; }
.portal-form-stack small { color: #817a89; font-weight: 500; }
.portal-form-stack hr { border: 0; border-top: 1px solid #eee9f2; width: 100%; }
.portal-form-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.portal-slot-list { display: grid; gap: 9px; max-height: 620px; overflow: auto; }
.portal-slot-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 13px; background: #f8f6fa; border-radius: 12px; }
.portal-slot-row div { display: grid; gap: 2px; }
.portal-slot-row span { color: #7a7481; font-size: 12px; }
.portal-appointment-list, .portal-invoice-list, .portal-form-list { display: grid; gap: 10px; }
.portal-appointment-card { width: 100%; display: grid; grid-template-columns: 64px 1fr auto; align-items: center; gap: 16px; text-align: left; padding: 15px; border: 1px solid #e7e3ee; background: #fff; border-radius: 16px; cursor: pointer; color: inherit; }
.portal-appointment-card:hover { border-color: #bda9ca; box-shadow: 0 12px 28px rgba(63,33,79,.07); transform: translateY(-1px); }
.portal-date-tile { display: grid; place-items: center; height: 62px; border-radius: 14px; background: #efe8f5; color: #51246e; }
.portal-date-tile b { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.portal-date-tile strong { font-size: 23px; line-height: 1; }
.portal-appointment-copy { display: grid; gap: 2px; }
.portal-appointment-copy small, .portal-appointment-copy span { color: #7b7482; }
.portal-appointment-copy strong { font-size: 17px; }
.portal-appointment-meta { display: flex; align-items: center; gap: 12px; }
.portal-status { display: inline-flex; width: fit-content; padding: 5px 9px; border-radius: 999px; background: #eeeaf1; color: #665d6d; font-size: 10px; font-style: normal; font-weight: 900; text-transform: uppercase; letter-spacing: .055em; }
.portal-status.status-scheduled, .portal-status.status-rescheduled, .portal-status.status-assigned { background: #edf3ff; color: #315c91; }
.portal-status.status-completed, .portal-status.status-paid { background: #e9f7ed; color: #2d6e3d; }
.portal-status.status-cancelled, .portal-status.status-canceled, .portal-status.status-void { background: #fcecec; color: #943a3a; }
.portal-form-card { padding: 0; overflow: hidden; }
.portal-form-card summary { list-style: none; display: flex; align-items: center; justify-content: space-between; padding: 19px 22px; cursor: pointer; }
.portal-form-card summary::-webkit-details-marker { display: none; }
.portal-form-card summary h2 { margin: 6px 0 2px; font-size: 18px; }
.portal-form-card summary p { margin: 0; color: #7b7482; }
.portal-form-card-body { border-top: 1px solid #eee9f2; padding: 22px; }
.portal-form-actions { display: flex; justify-content: flex-end; gap: 10px; }
.portal-choice-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.portal-choice-grid label { display: flex; align-items: center; gap: 7px; padding: 9px 11px; background: #f8f6fa; border-radius: 9px; }
.portal-choice-grid input { width: auto; }
.portal-complete-note { display: flex; align-items: center; gap: 8px; color: #377046; }
.portal-saved-card { display: flex; align-items: center; gap: 13px; padding: 17px; margin-bottom: 15px; border-radius: 16px; background: linear-gradient(135deg, #3c194f, #6a3a80); color: #fff; width: min(420px, 100%); }
.portal-saved-card > svg { width: 34px; height: 34px; }
.portal-saved-card div { display: grid; gap: 2px; }
.portal-saved-card small, .portal-saved-card span { color: rgba(255,255,255,.7); }
.portal-invoice-card { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 20px; }
.portal-invoice-card h2 { margin: 7px 0 2px; }
.portal-invoice-card p { margin: 0; color: #7c7583; }
.portal-invoice-total { display: grid; text-align: right; }
.portal-invoice-total strong { font-size: 21px; }
.portal-invoice-actions { display: flex; gap: 8px; }
.portal-payment-history { margin-top: 16px; }
.portal-payment-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 13px 0; border-top: 1px solid #eee9f2; }
.portal-payment-row:first-of-type { margin-top: 14px; }
.portal-payment-row div { display: grid; gap: 2px; }
.portal-payment-row span, .portal-payment-row time { color: #7b7482; font-size: 12px; }
.portal-value-grid, .portal-profile-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; align-items: start; }
.portal-value-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 13px 0; border-top: 1px solid #eee9f2; }
.portal-value-row:first-of-type { border-top: 0; }
.portal-value-row div { display: grid; gap: 2px; }
.portal-value-row span { color: #7a7481; font-size: 12px; }
.portal-value-row em { font-style: normal; font-weight: 800; color: #5d286f; }
.portal-switch { display: flex !important; grid-template-columns: none; align-items: center; gap: 10px !important; padding: 11px; background: #f8f6fa; border-radius: 10px; }
.portal-switch input { width: auto; }
.portal-request-history { margin-top: 15px; }
.portal-request-history > div { display: grid; grid-template-columns: 1fr auto auto; gap: 15px; padding: 11px 0; border-top: 1px solid #eee9f2; }
.portal-empty-state { display: grid; place-items: center; text-align: center; min-height: 150px; padding: 24px; color: #7b7482; border: 1px dashed #d9d2df; border-radius: 14px; }
.portal-empty-state p { margin: 4px 0 0; }
.portal-empty-state.compact { min-height: 80px; }
.portal-appointment-dialog { width: min(720px, calc(100% - 30px)); max-height: calc(100vh - 40px); padding: 0; border: 0; border-radius: 24px; box-shadow: 0 30px 80px rgba(35,20,45,.3); overflow: auto; }
.portal-appointment-dialog::backdrop { background: rgba(29,20,35,.58); backdrop-filter: blur(3px); }
.portal-dialog-close { position: absolute; right: 14px; top: 14px; z-index: 2; }
.portal-dialog-close button { display: grid; place-items: center; border: 0; background: rgba(255,255,255,.9); color: #553b64; width: 38px; height: 38px; border-radius: 50%; cursor: pointer; }
.portal-dialog-hero { padding: 28px 30px 22px; background: linear-gradient(135deg, #efe8f5, #faf8fb); }
.portal-dialog-hero h2 { margin: 10px 0 3px; font-size: 27px; }
.portal-dialog-hero p { margin: 0; color: #716b78; }
.portal-appointment-dialog > .portal-detail-grid, .portal-dialog-section, .portal-dialog-actions, .portal-policy-note { margin-left: 28px; margin-right: 28px; }
.portal-dialog-section { margin-top: 18px; padding: 17px; background: #f8f6fa; border-radius: 14px; }
.portal-dialog-section.shared-care { background: #f0f7f1; border: 1px solid #d4e8d7; }
.portal-dialog-section.shared-care p { line-height: 1.6; }
.portal-shared-note { padding: 11px 0; border-bottom: 1px solid #d7e8da; }
.portal-shared-note small { color: #65806c; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.portal-shared-note p { margin: 5px 0 0; }
.portal-dialog-section.shared-care a { display: flex; align-items: center; gap: 10px; padding: 10px 0; color: #385f43; text-decoration: none; border-top: 1px solid #d7e8da; }
.portal-dialog-section.shared-care a span { display: grid; flex: 1; }
.portal-dialog-section.shared-care a small { color: #65806c; }
.portal-policy-note { padding: 12px; background: #fff5e9; color: #7d5a28; border-radius: 10px; }
.portal-dialog-actions { display: flex; flex-wrap: wrap; gap: 10px; padding: 0 0 28px; margin-top: 18px; }
.portal-dialog-actions details { flex: 1; min-width: 210px; }
.portal-dialog-actions summary { list-style: none; cursor: pointer; }
.portal-dialog-actions details[open] summary { margin-bottom: 12px; }
.client-portal-auth-shell { max-width: 960px; padding-top: 70px; }
.client-portal-auth-brand { justify-content: center; margin-bottom: 22px; }
.client-portal-auth-brand h1 { margin: 0; }
.client-portal-auth-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.client-portal-auth-card { max-width: 500px; margin: 0 auto; padding: 28px; background: #fff; border: 1px solid #e4deea; border-radius: 22px; box-shadow: 0 20px 60px rgba(56,35,70,.09); }
.client-portal-auth-grid .client-portal-auth-card { max-width: none; margin: 0; }
.client-portal-auth-card h2 { font-size: 27px; margin: 6px 0; }
.client-portal-auth-card > p { color: #756f7d; margin: 0 0 20px; }
.portal-auth-secondary { background: #f9f7fb; }

@media (max-width: 900px) {
    .client-portal-tabs { grid-template-columns: repeat(9, minmax(70px, 1fr)); overflow-x: auto; justify-content: start; }
    .client-portal-tabs a { padding: 0 10px; }
    .portal-summary-grid { grid-template-columns: repeat(2, 1fr); }
    .portal-booking-layout { grid-template-columns: 1fr; }
    .portal-value-grid, .portal-profile-grid { grid-template-columns: 1fr; }
    .portal-invoice-card { grid-template-columns: 1fr auto; }
    .portal-invoice-actions { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
    .client-portal-app, .client-portal-auth-shell { width: min(100% - 20px, 1180px); padding-top: 10px; }
    .client-portal-header { top: 5px; padding: 10px 12px; }
    .client-portal-welcome > div, .portal-icon-button span { display: none; }
    .client-portal-tabs { position: fixed; z-index: 40; bottom: 0; left: 0; right: 0; margin: 0; border-radius: 16px 16px 0 0; border-bottom: 0; grid-template-columns: repeat(9, 68px); padding: 6px; }
    .client-portal-tabs a { display: grid; place-items: center; align-content: center; gap: 1px; min-height: 54px; font-size: 9px; }
    .client-portal-tabs a .ui-icon { width: 18px; }
    .client-portal-tabs b { position: absolute; right: 7px; top: 2px; }
    .portal-hero-card { align-items: start; flex-direction: column; padding: 25px; }
    .portal-summary-grid { grid-template-columns: 1fr; }
    .portal-detail-grid { grid-template-columns: repeat(2, 1fr); }
    .portal-page-heading { align-items: start; flex-direction: column; }
    .portal-page-heading h1 { font-size: 31px; }
    .portal-appointment-card { grid-template-columns: 54px 1fr; gap: 12px; }
    .portal-appointment-meta { grid-column: 2; justify-content: space-between; }
    .portal-date-tile { height: 55px; }
    .portal-invoice-card { grid-template-columns: 1fr; }
    .portal-invoice-total { text-align: left; }
    .portal-invoice-actions { flex-wrap: wrap; }
    .portal-form-row { grid-template-columns: 1fr; }
    .portal-form-actions { flex-direction: column-reverse; }
    .client-portal-auth-grid { grid-template-columns: 1fr; }
    .client-portal-auth-shell { padding-bottom: 30px; }
    .portal-appointment-dialog > .portal-detail-grid, .portal-dialog-section, .portal-dialog-actions, .portal-policy-note { margin-left: 16px; margin-right: 16px; }
    .portal-dialog-hero { padding: 25px 20px 19px; }
    .portal-appointment-dialog > .portal-detail-grid { grid-template-columns: 1fr 1fr; }
}

.portal-receipt-page { width: min(850px, calc(100% - 28px)); margin: 0 auto; padding: 28px 0 60px; }
.portal-receipt-actions { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.portal-receipt-sheet { background: #fff; border: 1px solid #e5e0e9; border-radius: 20px; padding: 42px; box-shadow: 0 20px 60px rgba(55,35,69,.08); }
.portal-receipt-sheet > header { display: flex; justify-content: space-between; gap: 24px; padding-bottom: 25px; border-bottom: 2px solid #ede8f0; }
.portal-receipt-sheet h1 { margin: 5px 0 0; font-size: 34px; }
.portal-receipt-brand { display: flex; align-items: center; gap: 10px; }
.portal-receipt-addresses { display: grid; grid-template-columns: 1fr 1fr; gap: 25px; margin: 28px 0; }
.portal-receipt-addresses > div, .portal-receipt-meta > div { display: grid; gap: 3px; }
.portal-receipt-addresses small, .portal-receipt-meta small { text-transform: uppercase; letter-spacing: .08em; color: #827b89; font-size: 10px; }
.portal-receipt-addresses span { color: #746d7c; }
.portal-receipt-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 16px; background: #f7f5f8; border-radius: 12px; }
.portal-receipt-table { width: 100%; border-collapse: collapse; margin-top: 25px; }
.portal-receipt-table th, .portal-receipt-table td { padding: 13px 9px; border-bottom: 1px solid #eae6ed; text-align: left; }
.portal-receipt-table th:not(:first-child), .portal-receipt-table td:not(:first-child) { text-align: right; }
.portal-receipt-table tfoot tr:last-child { font-size: 18px; }
.portal-receipt-payments { margin-top: 28px; }
.portal-receipt-payments > div { display: flex; justify-content: space-between; padding: 10px 0; border-top: 1px solid #ece8ef; }
.portal-receipt-sheet footer { margin-top: 35px; padding-top: 18px; border-top: 1px solid #ece8ef; color: #827b89; text-align: center; font-size: 12px; }
.client-portal-invite-form { display: flex; align-items: center; gap: 8px; }
.client-portal-invite-form select, .client-portal-request-list input { min-height: 36px; border: 1px solid #d9d2df; border-radius: 8px; padding: 7px 9px; }
.client-portal-request-list { display: grid; gap: 8px; margin-top: 10px; }
.client-portal-request-list details { border: 1px solid #e6e1e9; border-radius: 10px; padding: 10px; }
.client-portal-request-list summary { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; cursor: pointer; }
.client-portal-request-list summary small { color: #7f7886; }
.client-portal-request-value { display: grid; grid-template-columns: 150px 1fr; gap: 10px; padding: 5px 0; border-top: 1px solid #eeeaf0; }
.client-portal-request-value span { color: #7a7381; }
.client-portal-request-list form { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.client-portal-request-list form input { flex: 1 1 220px; }
@media print { .portal-receipt-actions { display: none; } .portal-page { background: #fff; } .portal-receipt-page { width: 100%; padding: 0; } .portal-receipt-sheet { box-shadow: none; border: 0; } }

@media (max-width: 1050px) {
    .clients-page-header,
    .client-directory-toolbar,
    .client-usage-strip {
        display: grid;
        grid-template-columns: 1fr;
    }

    .client-page-metrics {
        min-width: 0;
        border-top: 1px solid rgba(95, 22, 150, 0.16);
        border-left: 0;
    }

    .client-search-form {
        width: 100%;
    }

    .client-record-hero,
    .client-record-grid,
    .client-record-workflows,
    .client-record-split,
    .client-record-library {
        grid-template-columns: 1fr;
    }

    .client-record-hero {
        display: grid;
    }

    .client-record-actions {
        justify-content: flex-start;
    }

    .client-record-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .grid.four,
    .grid.three,
    .grid.two,
    .financial-metric-grid,
    .financial-pos-summary,
    .soap-documentation-workspace,
    .body-chart-workspace,
    .pos-terminal-grid,
    .pos-register-grid,
    .pos-product-tools,
    .pos-inventory-toolbar,
    .pos-settings-grid,
    .form-grid,
    .form-grid.three {
        grid-template-columns: 1fr;
    }

    .form-field-builder-main,
    .service-modal-form.is-note-form .form-field-builder-main {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .clinical-note-summary,
    .soap-body-chart-field {
        align-items: stretch;
        flex-direction: column;
    }

    .body-chart-appointment-context {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .soap-visit-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .appointment-payment-picker,
    .client-payment-summary-strip,
    .client-payment-ledger-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .body-map-stage {
        padding-inline: 108px;
    }

    .top-nav-list {
        scrollbar-width: thin;
    }
}

@media (max-width: 760px) {
    .clients-workspace {
        padding-bottom: 82px;
    }

    .client-page-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .client-page-metrics div:nth-child(odd) {
        border-left: 0;
    }

    .client-directory-toolbar,
    .client-filter-bar {
        align-items: stretch;
    }

    .client-search-form,
    .client-consent-grid {
        grid-template-columns: 1fr;
    }

    .financial-metric-grid,
    .financial-pos-summary,
    .appointment-payment-picker,
    .appointment-payment-action-card,
    .client-payment-summary-strip,
    .client-payment-ledger-grid,
    .pos-payment-methods,
    .pos-product-grid,
    .pos-settings-check-grid {
        grid-template-columns: 1fr;
    }

    .pos-register-cart {
        position: static;
    }

    .pos-cart-line {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .pos-product-edit-row summary,
    .pos-product-editor-actions,
    .pos-settings-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .pos-inventory-row-panel {
        width: min(680px, calc(100vw - 52px));
    }

    .client-search-submit {
        width: 100%;
    }

    .client-filter-group,
    .client-tag-filter,
    .client-tag-filter select,
    .client-filter-reset {
        width: 100%;
    }

    .client-filter-pill {
        flex: 1;
        padding: 0 8px;
    }

    .client-directory-table-shell {
        max-height: none;
    }

    .client-record-identity {
        align-items: flex-start;
    }

    .client-record-avatar {
        width: 48px;
        height: 48px;
        flex-basis: 48px;
    }

    .client-record-metrics {
        grid-template-columns: 1fr;
    }

    .client-record-actions .btn {
        flex: 1;
    }

    .client-key-value-list > div,
    .client-timeline-item {
        grid-template-columns: 1fr;
    }

    .client-record-form .btn {
        width: 100%;
        justify-self: stretch;
    }

    .appointment-payment-action-card .btn {
        width: 100%;
        justify-content: center;
    }

    .client-create-drawer {
        width: 100%;
    }

    .client-create-form {
        padding: 18px;
    }

    .client-drawer-header {
        top: -18px;
        margin: -18px -18px 0;
        padding: 18px;
    }

    .client-drawer-actions {
        bottom: -18px;
        margin: 0 -18px -18px;
        padding: 12px 18px;
    }

    .sidebar {
        position: static;
        width: 100%;
        min-height: 0;
        white-space: normal;
    }

    .sidebar::after {
        display: none;
    }

    .sidebar:hover,
    .sidebar:focus-within {
        width: 100%;
    }

    .sidebar-logo {
        justify-content: flex-start;
        min-height: 58px;
        padding: 10px 14px;
    }

    .logo-collapsed {
        opacity: 1;
    }

    .logo-expanded {
        position: static;
        transform: none;
        margin-left: 10px;
        opacity: 1;
        visibility: visible;
    }

    .logo-expanded-mark {
        display: none;
    }

    .nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding: 0 8px 10px;
    }

    .button-text {
        opacity: 1;
        visibility: visible;
    }

    .main,
    .sidebar:hover ~ .main,
    .sidebar:focus-within ~ .main {
        margin-left: 0;
        padding-top: 0;
    }

    .topbar {
        position: sticky;
        left: 0;
        top: 0;
    }

    .sidebar:hover ~ .main .topbar,
    .sidebar:focus-within ~ .main .topbar {
        left: 0;
    }

    .content {
        padding: 12px;
    }

    .content-surface {
        padding: 12px;
    }

    .page-header {
        display: grid;
    }

    .page-header-actions {
        justify-content: flex-start;
    }

    .resource-library-toolbar,
    .resource-search-form {
        display: grid;
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .calendar-toolbar {
        align-items: stretch;
    }

    .calendar-view-switch,
    .calendar-nav {
        width: 100%;
    }

    .calendar-view-option,
    .calendar-today-btn {
        flex: 1;
        justify-content: center;
    }

    .calendar-toolbar-title {
        width: 100%;
        justify-items: start;
    }

    .calendar-shell {
        overflow-x: auto;
    }

    .calendar-weekdays,
    .calendar-grid {
        min-width: 760px;
    }

    .calendar-day {
        min-height: 136px;
    }

    .body-map-stage {
        min-height: 680px;
        padding-inline: 12px;
    }

    .body-chart-appointment-context {
        grid-template-columns: 1fr;
    }

    .soap-visit-summary {
        grid-template-columns: 1fr;
    }

    .body-chart-picker-heading,
    .body-chart-appointment-card {
        align-items: stretch;
        flex-direction: column;
    }

    .body-chart-appointment-card > div:last-child {
        justify-content: flex-start;
    }

    .body-map-canvas {
        width: min(360px, 100%);
        height: 620px;
        min-height: 560px;
    }

    .body-callout {
        width: 164px;
    }

    .body-callout.is-right,
    .body-callout.is-left {
        transform: translate(-50%, calc(-100% - 14px));
    }

    .body-callout-pin {
        display: none;
    }
}

@media (max-width: 520px) {
    .nav {
        grid-template-columns: 1fr;
    }

    .top-nav-title {
        max-width: 180px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .profile-dropdown {
        right: -8px;
        min-width: 230px;
    }

    .payment-method-cards {
        grid-template-columns: 1fr;
    }

}

@media (max-width: 1050px) {
    .client-record-banner,
    .client-overview-layout,
    .client-library-layout,
    .client-settings-layout {
        grid-template-columns: 1fr;
    }

    .client-record-banner-actions {
        justify-content: flex-start;
    }

    .client-record-side,
    .client-library-layout .client-record-block,
    .client-settings-layout .client-record-form {
        border-left: 0;
        border-top: 1px solid #eee4f5;
    }

    .client-library-layout .client-record-block:first-child,
    .client-settings-layout .client-record-form:first-child {
        border-top: 0;
    }

    .client-summary-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .client-summary-item:nth-child(odd) {
        border-left: 0;
    }
}

@media (max-width: 760px) {
    .client-record-banner-main {
        align-items: flex-start;
    }

    .client-record-banner-actions,
    .client-record-subnav {
        align-items: stretch;
    }

    .client-record-banner-actions .btn {
        flex: 1;
    }

    .client-record-subnav {
        position: static;
        display: grid;
    }

    .client-record-subnav-links {
        margin-left: 0;
        justify-content: flex-start;
    }

    .client-record-subnav-links a {
        flex: 0 0 auto;
    }

    .client-record-section-header {
        display: grid;
    }

    .client-record-section-header p {
        max-width: none;
        text-align: left;
    }

    .client-summary-strip {
        grid-template-columns: 1fr;
    }

    .client-summary-item {
        border-left: 0;
        border-top: 1px solid #eee4f5;
    }

    .client-summary-item:first-child {
        border-top: 0;
    }

    .client-data-rows > div,
    .client-mini-table > div {
        grid-template-columns: 1fr;
        gap: 5px;
    }

    .client-record-table th,
    .client-record-table td {
        padding: 10px 12px;
    }

    .client-record-form .btn {
        width: 100%;
        justify-self: stretch;
    }
}

@media (max-width: 1050px) {
    .client-contact-layout,
    .client-payment-layout,
    .client-preferences-layout,
    .client-visits-layout.has-flyout {
        grid-template-columns: 1fr;
    }

    .client-contact-layout .client-record-block,
    .client-payment-layout .client-record-block,
    .client-preferences-layout .client-record-block,
    .client-payment-stack,
    .client-body-chart-flyout {
        border-left: 0;
    }

    .client-contact-layout .client-record-block,
    .client-payment-layout .client-record-block,
    .client-preferences-layout .client-record-block,
    .client-body-chart-flyout {
        border-top: 1px solid #eee4f5;
    }

    .client-contact-layout .client-record-block:first-child,
    .client-payment-layout .client-record-block:first-child,
    .client-preferences-layout .client-record-block:first-child {
        border-top: 0;
    }
}

@media (max-width: 760px) {
    .client-record-workspace {
        --client-record-panel-height: auto;
    }

    .client-record-section.is-active {
        max-height: none;
    }

    .client-visit-accordion summary,
    .client-visit-detail {
        grid-template-columns: 1fr;
    }

    .client-visit-date,
    .client-visit-service {
        flex-wrap: wrap;
        white-space: normal;
    }

    .client-visit-actions {
        flex-wrap: wrap;
    }

    .client-visit-actions .btn {
        flex: 1;
    }

    .client-payment-stack {
        grid-template-rows: auto;
    }
}

/* Client redesign: compact directory and single-panel record workspace. */
.content:has(.clients-workspace) {
    height: calc(100vh - var(--topbar-height));
    overflow: hidden;
    padding: 12px 18px;
}

.content-frame:has(.clients-workspace),
.content-surface:has(.clients-workspace) {
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.content-surface:has(.clients-workspace) {
    padding: 14px;
}

.clients-workspace {
    height: 100%;
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 10px;
    overflow: hidden;
    padding-bottom: 0;
}

.clients-workspace .clients-page-header {
    margin-bottom: 0;
}

.clients-workspace .client-directory-panel {
    height: 100%;
    min-height: 0;
    align-self: stretch;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    overflow: hidden;
}

.clients-workspace .client-directory-table-shell {
    height: 100%;
    min-height: 0;
    max-height: none;
    overflow: auto;
}

.client-directory-table-redesign thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #fbf7ff;
}

.clients-workspace .client-usage-strip {
    display: none;
}

.content:has(.client-record-workspace) {
    height: calc(100vh - var(--topbar-height));
    overflow: hidden;
    padding: 12px 18px;
}

.content-frame:has(.client-record-workspace),
.content-surface:has(.client-record-workspace) {
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.content-frame:has(.client-record-workspace) {
    margin-bottom: 0;
}

.content-surface:has(.client-record-workspace) {
    padding: 14px;
}

.client-directory-table-redesign {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
}

.client-directory-table-redesign .client-name-column {
    width: 24%;
    min-width: 0;
}

.client-directory-table-redesign .client-contact-column {
    width: 22%;
    min-width: 0;
}

.client-directory-table-redesign .client-care-column {
    width: 30%;
    min-width: 0;
    max-width: none;
}

.client-directory-table-redesign .client-last-column {
    width: 16%;
    min-width: 0;
}

.client-directory-table-redesign th:last-child,
.client-directory-table-redesign td:last-child {
    width: 8%;
    min-width: 0;
}

.client-table-pill {
    min-height: 24px;
    display: inline-flex;
    align-items: center;
    border: 1px solid #d9c4ec;
    border-radius: 999px;
    padding: 3px 9px;
    background: #f3ecff;
    color: var(--brand);
    font-size: 0.72rem;
    font-weight: 900;
}

.client-table-pill.is-muted {
    border-color: #dce1e5;
    background: #f7f8f9;
    color: #68747c;
}

.client-care-text {
    margin: 0;
    color: #31414a;
    font-size: 0.84rem;
    font-weight: 780;
    line-height: 1.35;
    white-space: normal;
}

.client-record-workspace {
    height: 100%;
    min-height: 0;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: 10px;
    padding-bottom: 0;
}

.client-record-banner {
    min-height: 128px;
    grid-template-columns: minmax(0, 1fr);
    padding: 16px 18px;
    box-shadow: 0 8px 22px rgba(55, 30, 80, 0.06);
}

.client-record-banner-main {
    gap: 16px;
}

.client-record-avatar {
    width: 58px;
    height: 58px;
    flex-basis: 58px;
    background: #eee3ff;
}

.client-record-banner h2 {
    font-size: 1.42rem;
}

.client-record-contact-line {
    gap: 10px;
}

.client-record-contact-line a,
.client-record-contact-line span {
    color: #61717a;
    font-size: 0.83rem;
    font-weight: 850;
}

.client-record-subnav {
    position: static;
    min-height: 50px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    padding: 7px 10px;
}

.client-record-subnav-label {
    align-self: center;
}

.client-record-subnav-links {
    align-items: center;
}

.client-record-tab {
    min-height: 36px;
    border: 1px solid #d8c5ea;
    border-radius: 8px;
    padding: 0 13px;
    background: #fff;
}

.client-record-tab.is-active {
    border-color: var(--brand);
    background: var(--brand);
    color: #fff;
}

.client-record-section {
    height: 100%;
    max-height: none;
    min-height: 0;
}

.client-record-section.is-active {
    height: 100%;
    max-height: none;
}

.client-record-section-header {
    min-height: 60px;
    align-items: center;
    padding: 13px 16px;
}

.client-record-section-header p {
    display: none;
}

.client-summary-strip {
    min-height: 86px;
}

.client-summary-item {
    padding: 12px 16px;
}

.client-overview-layout,
.client-contact-layout,
.client-visits-layout,
.client-forms-layout,
.client-payment-layout,
.client-preferences-layout {
    min-height: 0;
    height: 100%;
    overflow: hidden;
}

.client-overview-layout {
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
}

.client-record-block {
    min-height: 0;
    overflow: auto;
    padding: 16px;
}

.client-care-data-rows > div {
    grid-template-columns: minmax(142px, 0.25fr) minmax(0, 1fr);
}

.client-care-data-rows strong,
.client-note-preview p,
.client-form-response-list p,
.client-all-notes-list p {
    white-space: normal;
}

.client-note-preview {
    display: grid;
    gap: 5px;
    margin-top: 12px;
}

.client-note-preview strong,
.client-note-preview span {
    display: block;
}

.client-note-preview span {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
}

.client-note-preview p {
    margin: 0;
    color: #31414a;
    font-size: 0.84rem;
    font-weight: 760;
    line-height: 1.42;
}

.client-contact-layout {
    grid-template-columns: minmax(340px, 1.05fr) minmax(360px, 1.1fr) minmax(260px, 0.72fr);
}

.client-contact-layout .client-record-block,
.client-payment-layout .client-record-block,
.client-preferences-layout .client-record-block {
    border-left: 1px solid #eee4f5;
}

.client-contact-layout .client-record-block:nth-child(3n + 1),
.client-payment-layout .client-record-block:first-child,
.client-preferences-layout .client-record-block:first-child {
    border-left: 0;
}

.client-contact-layout .client-record-block.is-wide {
    grid-column: 1 / -1;
    border-top: 1px solid #eee4f5;
    border-left: 0;
}

.client-message-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
    margin-top: 14px;
}

.client-message-button {
    min-height: 84px;
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 5px;
    border: 1px solid #d9c4ec;
    border-radius: 8px;
    padding: 10px;
    background: #fff;
    color: var(--brand);
    cursor: pointer;
    font: inherit;
    box-shadow: 0 4px 12px rgba(55, 30, 80, 0.05);
}

.client-message-button[disabled],
.client-message-button[aria-disabled="true"] {
    border-color: #e1e5e8;
    background: #f8f9fa;
    color: #79848b;
    cursor: not-allowed;
    pointer-events: none;
}

.client-message-button .ui-icon {
    width: 20px;
    height: 20px;
}

.client-message-button span {
    font-size: 0.86rem;
    font-weight: 900;
}

.client-message-button small {
    color: #66747c;
    font-size: 0.72rem;
    font-weight: 800;
}

.client-notification-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    margin-top: 14px;
}

.client-notification-grid label {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1px solid #e1e5e8;
    border-radius: 8px;
    padding: 8px 10px;
    background: #f8f9fa;
    color: #66747c;
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: capitalize;
}

.client-notification-grid label.is-on {
    border-color: #d3b9ea;
    background: #f4ecff;
    color: var(--brand);
}

.client-notification-grid input {
    width: 16px;
    height: 16px;
    margin: 0;
}

.client-notification-grid .ui-icon {
    width: 16px;
    height: 16px;
}

.client-contact-settings-form {
    display: grid;
    align-content: start;
    gap: 12px;
}

.client-contact-settings-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.client-contact-data-rows {
    margin-top: 4px;
}

.client-thread-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 16px 0 8px;
}

.client-thread-heading h5 {
    margin: 0;
    color: #2f2140;
    font-size: 0.9rem;
}

.client-thread-heading span {
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 850;
}

.client-sms-thread-list {
    max-height: min(32vh, 280px);
    display: grid;
    gap: 8px;
    overflow: auto;
    padding-right: 2px;
}

.client-sms-bubble {
    display: grid;
    gap: 5px;
    max-width: 88%;
    border: 1px solid #eadff2;
    border-radius: 8px;
    padding: 9px 10px;
    background: #fff;
}

.client-sms-bubble.is-outbound {
    justify-self: end;
    border-color: var(--brand);
    background: var(--brand);
}

.client-sms-bubble.is-inbound {
    justify-self: start;
    border-color: #e1e5e8;
    background: #f4f5f6;
}

.client-sms-bubble div {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.client-sms-bubble strong,
.client-sms-bubble span {
    display: block;
}

.client-sms-bubble strong {
    color: #2f2140;
    font-size: 0.78rem;
}

.client-sms-bubble.is-outbound strong,
.client-sms-bubble.is-outbound span,
.client-sms-bubble.is-outbound p {
    color: #fff;
}

.client-sms-bubble span {
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 800;
}

.client-sms-bubble p {
    margin: 0;
    color: #31414a;
    font-size: 0.82rem;
    font-weight: 740;
    line-height: 1.38;
    white-space: pre-wrap;
}

.client-permission-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.client-visits-layout {
    position: relative;
    grid-template-columns: minmax(0, 1fr);
}

.client-visits-list {
    min-height: 0;
    display: grid;
    align-content: start;
    gap: 8px;
    overflow: auto;
    padding: 14px;
}

.client-all-notes-panel {
    border-left: 1px solid #eee4f5;
    padding: 14px;
    background: #fff;
}

.client-all-notes-panel h4 {
    margin: 0 0 12px;
    color: #2f2140;
    font-size: 0.95rem;
}

.client-all-notes-list,
.client-form-response-list {
    display: grid;
    gap: 9px;
}

.client-all-notes-list article,
.client-form-response-list article {
    display: grid;
    gap: 5px;
    border: 1px solid #eadff2;
    border-radius: 8px;
    padding: 11px 12px;
    background: #fff;
}

.client-all-notes-list strong,
.client-all-notes-list span,
.client-form-response-list strong,
.client-form-response-list span {
    display: block;
}

.client-all-notes-list span,
.client-form-response-list span {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 800;
}

.client-all-notes-list p,
.client-form-response-list p {
    margin: 0;
    color: #31414a;
    font-size: 0.83rem;
    font-weight: 750;
    line-height: 1.4;
}

.client-visit-accordion {
    border-left-width: 4px;
}

.client-visit-accordion.is-upcoming {
    border-left-color: var(--brand);
    background: #fff;
}

.client-visit-accordion.is-history {
    border-color: #eadff2;
    border-left-color: #cdb8ef;
    background: #fbf8ff;
}

.client-visit-accordion summary {
    min-height: 50px;
    grid-template-columns: minmax(118px, 0.55fr) minmax(132px, 0.62fr) minmax(220px, 1.05fr) minmax(86px, 0.36fr) minmax(150px, 0.72fr) auto 14px;
    gap: 12px;
    padding: 8px 14px 8px 12px;
}

.client-visit-accordion summary::after {
    content: "";
    width: 9px;
    height: 9px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.18s ease;
}

.client-visit-accordion[open] summary::after {
    transform: rotate(225deg);
}

.client-visit-date,
.client-visit-service {
    display: block;
    overflow: hidden;
    white-space: nowrap;
}

.client-visit-time,
.client-visit-status,
.client-visit-regions {
    overflow: hidden;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 850;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.client-visit-regions {
    color: #5b188b;
}

.client-visit-service strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.client-visit-counts {
    white-space: nowrap;
}

.client-visit-detail {
    grid-template-columns: minmax(0, 1fr) auto;
}

.client-message-overlay,
.client-body-chart-overlay {
    position: fixed;
    inset: 0;
    z-index: 90;
    background: rgba(32, 24, 39, 0.42);
    backdrop-filter: blur(1px);
}

.client-message-drawer,
.client-body-chart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 91;
    width: min(500px, 92vw);
    height: 100dvh;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    border-left: 1px solid #e3d4ef;
    background: #fff;
    box-shadow: -22px 0 44px rgba(50, 26, 72, 0.18);
}

.client-message-drawer .client-drawer-header,
.client-body-chart-drawer .client-drawer-header {
    position: static;
    top: auto;
    margin: 0;
    padding: 18px 20px 16px;
}

.client-message-drawer {
    grid-template-rows: minmax(0, 1fr);
}

.client-message-drawer-form {
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
}

.client-message-drawer-body,
.client-body-chart-drawer-body {
    min-height: 0;
    overflow: auto;
    padding: 16px;
}

.client-message-drawer-body {
    background: #fbfafc;
}

.client-message-drawer .client-drawer-footer {
    display: grid;
    gap: 10px;
    padding: 14px 16px;
    border-top: 1px solid #eee4f5;
    background: #fff;
}

.client-message-drawer .client-drawer-footer textarea {
    min-height: 56px;
    max-height: 120px;
    resize: vertical;
}

.client-message-composer-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.client-message-count {
    margin-right: auto;
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 850;
}

.client-message-chat-list {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 10px;
}

.client-message-history-status {
    align-self: center;
    padding: 5px 10px;
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 800;
    text-align: center;
}

.client-message-chat-bubble {
    max-width: 82%;
    display: grid;
    gap: 5px;
    border: 1px solid #e1e5e8;
    border-radius: 14px;
    padding: 10px 12px;
    background: #f4f5f6;
}

.client-message-chat-bubble.is-outbound {
    align-self: flex-end;
    border-color: var(--brand);
    border-bottom-right-radius: 5px;
    background: var(--brand);
    color: #fff;
}

.client-message-chat-bubble.is-inbound {
    align-self: flex-start;
    border-bottom-left-radius: 5px;
}

.client-message-chat-bubble div {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.client-message-chat-bubble strong,
.client-message-chat-bubble span {
    display: block;
    font-size: 0.72rem;
    font-weight: 900;
}

.client-message-chat-bubble span {
    color: #6a7880;
    font-weight: 800;
}

.client-message-chat-bubble.is-outbound span {
    color: rgba(255, 255, 255, 0.78);
}

.client-message-chat-bubble p {
    margin: 0;
    color: #31414a;
    font-size: 0.86rem;
    font-weight: 760;
    line-height: 1.38;
    white-space: pre-wrap;
}

.client-message-chat-bubble.is-outbound p {
    color: #fff;
}

.client-body-chart-switch {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid #eee4f5;
    background: #fbfafc;
}

.client-body-chart-switch button {
    min-height: 38px;
    border: 1px solid #d8c5ea;
    border-radius: 8px;
    background: #fff;
    color: #3a2b48;
    cursor: pointer;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 900;
}

.client-body-chart-switch button.is-active {
    border-color: var(--brand);
    background: var(--brand);
    color: #fff;
}

.client-body-chart-side-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border: 1px solid #eadff2;
    border-radius: 8px;
    padding: 12px;
    background: #fbf7ff;
}

.client-body-chart-side-card strong {
    color: #2f2140;
    font-size: 0.95rem;
}

.client-body-chart-side-card span {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 850;
}

.client-body-chart-drawer-body {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 12px;
    overflow: hidden;
}

.client-body-chart-visual {
    display: grid;
    place-items: center;
    min-height: 0;
    height: 100%;
    border: 1px solid #eadff2;
    border-radius: 8px;
    padding: 16px;
    background:
        linear-gradient(90deg, rgba(251, 247, 255, 0.85), rgba(255, 255, 255, 0.92)),
        #fff;
}

.client-body-chart-figure {
    position: relative;
    width: min(250px, 74%);
    height: 100%;
    min-height: 390px;
    max-height: 620px;
}

.client-body-chart-figure::before,
.client-body-chart-figure::after {
    content: none;
}

.client-body-chart-part {
    position: absolute;
    z-index: 1;
    border: 2px solid #d8c5ea;
    background: #fbf7ff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.client-body-chart-visual[data-body-chart-side="back"] .client-body-chart-part {
    background: #f5effb;
}

.client-body-chart-head {
    top: 0%;
    left: 50%;
    width: 48px;
    height: 10%;
    border-radius: 999px;
    transform: translateX(-50%);
}

.client-body-chart-neck {
    top: 9%;
    left: 50%;
    width: 28px;
    height: 5%;
    border-radius: 10px;
    transform: translateX(-50%);
}

.client-body-chart-torso {
    top: 14%;
    left: 50%;
    width: 96px;
    height: 31%;
    border-radius: 46px 46px 28px 28px;
    transform: translateX(-50%);
}

.client-body-chart-pelvis {
    top: 43%;
    left: 50%;
    width: 98px;
    height: 12%;
    border-radius: 16px 16px 34px 34px;
    transform: translateX(-50%);
}

.client-body-chart-left-upper-arm,
.client-body-chart-right-upper-arm {
    top: 18%;
    width: 32px;
    height: 21%;
    border-radius: 18px;
}

.client-body-chart-left-upper-arm {
    left: 38px;
    transform: rotate(9deg);
}

.client-body-chart-right-upper-arm {
    right: 38px;
    transform: rotate(-9deg);
}

.client-body-chart-left-forearm,
.client-body-chart-right-forearm {
    top: 37%;
    width: 30px;
    height: 23%;
    border-radius: 17px;
}

.client-body-chart-left-forearm {
    left: 32px;
    transform: rotate(4deg);
}

.client-body-chart-right-forearm {
    right: 32px;
    transform: rotate(-4deg);
}

.client-body-chart-left-hand,
.client-body-chart-right-hand {
    top: 58%;
    width: 34px;
    height: 8%;
    border-radius: 999px;
}

.client-body-chart-left-hand {
    left: 28px;
}

.client-body-chart-right-hand {
    right: 28px;
}

.client-body-chart-left-thigh,
.client-body-chart-right-thigh {
    top: 54%;
    width: 42px;
    height: 23%;
    border-radius: 16px 16px 20px 20px;
}

.client-body-chart-left-thigh {
    left: 76px;
    transform: rotate(4deg);
}

.client-body-chart-right-thigh {
    right: 76px;
    transform: rotate(-4deg);
}

.client-body-chart-left-lower-leg,
.client-body-chart-right-lower-leg {
    top: 75%;
    width: 42px;
    height: 21%;
    border-radius: 18px;
}

.client-body-chart-left-lower-leg {
    left: 72px;
}

.client-body-chart-right-lower-leg {
    right: 72px;
}

.client-body-chart-left-foot,
.client-body-chart-right-foot {
    top: 94%;
    width: 50px;
    height: 6%;
    border-radius: 999px 999px 12px 12px;
}

.client-body-chart-left-foot {
    left: 64px;
}

.client-body-chart-right-foot {
    right: 64px;
}

.client-body-chart-pin {
    position: absolute;
    z-index: 3;
    width: 25px;
    height: 25px;
    display: grid;
    place-items: center;
    transform: translate(-50%, -50%);
    border: 2px solid #fff;
    border-radius: 999px;
    background: var(--brand);
    color: #fff;
    font-size: 0.74rem;
    font-weight: 950;
    box-shadow: 0 8px 18px rgba(75, 0, 130, 0.24);
}

.client-body-chart-content {
    display: grid;
    gap: 9px;
    max-height: 170px;
    overflow: auto;
}

.client-body-chart-mark {
    display: grid;
    gap: 5px;
    border: 1px solid #eadff2;
    border-radius: 8px;
    padding: 12px;
    background: #fff;
}

.client-body-chart-mark strong {
    color: #2f2140;
}

.client-body-chart-mark span {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 850;
    text-transform: capitalize;
}

.client-body-chart-mark p {
    margin: 0;
    color: #31414a;
    font-size: 0.84rem;
    font-weight: 760;
    line-height: 1.4;
    white-space: pre-wrap;
}

.client-forms-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.client-forms-layout .client-record-block {
    border-left: 1px solid #eee4f5;
    border-top: 1px solid #eee4f5;
}

.client-forms-layout .client-record-block:nth-child(1),
.client-forms-layout .client-record-block:nth-child(2) {
    border-top: 0;
}

.client-forms-layout .client-record-block:nth-child(odd) {
    border-left: 0;
}

.client-payment-layout {
    grid-template-columns: minmax(280px, 0.65fr) minmax(0, 1.35fr);
}

.client-preferences-layout {
    grid-template-columns: minmax(0, 1.15fr) minmax(330px, 0.85fr);
}

.client-preferences-layout textarea {
    min-height: 74px;
}

.client-status-toggle {
    position: relative;
    width: min(100%, 260px);
    min-height: 40px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: center;
    border: 1px solid #d8c5ea;
    border-radius: 999px;
    padding: 3px;
    background: #f3f5f6;
    overflow: hidden;
}

.client-status-toggle input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.client-status-toggle label {
    position: relative;
    z-index: 2;
    min-height: 32px;
    display: grid;
    place-items: center;
    margin: 0;
    color: #64717c;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 900;
    transition: color 0.18s ease;
}

.client-status-slider {
    position: absolute;
    z-index: 1;
    left: 3px;
    top: 3px;
    width: calc(50% - 3px);
    height: calc(100% - 6px);
    border-radius: 999px;
    background: var(--brand);
    box-shadow: 0 5px 14px rgba(75, 0, 130, 0.22);
    transition: transform 0.22s cubic-bezier(0.2, 0, 0, 1), background-color 0.22s ease;
}

.client-status-toggle input[value="active"]:checked ~ label[for="client-status-active"],
.client-status-toggle input[value="inactive"]:checked ~ label[for="client-status-inactive"] {
    color: #fff;
}

.client-status-toggle input[value="inactive"]:checked ~ .client-status-slider {
    background: #77838b;
    transform: translateX(100%);
}

.settings-panel-heading {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.settings-panel-heading h3 {
    margin: 0 0 4px;
}

.settings-location-grid {
    display: grid;
    grid-template-columns: minmax(280px, 0.75fr) minmax(0, 1.25fr);
    gap: 14px;
}

.settings-location-list {
    display: grid;
    align-content: start;
    gap: 8px;
}

.settings-location-card {
    display: grid;
    gap: 6px;
    border: 1px solid #eadff2;
    border-radius: 8px;
    padding: 12px;
    background: #fff;
}

.settings-location-card strong,
.settings-location-card span,
.settings-location-card small {
    display: block;
}

.settings-location-card strong {
    color: #2f2140;
}

.settings-location-card span,
.settings-location-card small {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 800;
}

.settings-location-form {
    display: grid;
    gap: 12px;
}

.settings-location-form .btn {
    justify-self: end;
}

/* Settings workspace: subpage navigation, read-only forms, and table-first management. */
.content:has(.settings-workspace) {
    height: calc(100vh - var(--topbar-height));
    overflow: hidden;
    padding: 12px 18px;
}

.content-frame:has(.settings-workspace),
.content-surface:has(.settings-workspace) {
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.content-surface:has(.settings-workspace) {
    padding: 14px;
    display: grid;
    grid-template-rows: minmax(0, 1fr);
}

.settings-workspace {
    height: 100%;
    min-height: 0;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: 12px;
    overflow: hidden;
    padding-bottom: 14px;
    scrollbar-gutter: stable;
}

.settings-hero,
.settings-subnav,
.settings-panel {
    border: 1px solid #eadff2;
    border-radius: 8px;
    background: #fff;
}

.settings-hero {
    min-height: 88px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    box-shadow: 0 8px 22px rgba(55, 30, 80, 0.05);
}

.settings-hero h2,
.settings-hero p {
    margin: 0;
}

.settings-hero h2 {
    color: #2f2140;
    font-size: 1.32rem;
}

.settings-hero p {
    margin-top: 4px;
    color: var(--muted);
    font-weight: 760;
}

.settings-eyebrow {
    color: var(--brand);
    font-size: 0.72rem;
    font-weight: 950;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.settings-subnav {
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 7px 10px;
}

.settings-tab {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #d8c5ea;
    border-radius: 8px;
    padding: 0 13px;
    background: #fff;
    color: #3a2b48;
    cursor: pointer;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 900;
    text-decoration: none;
}

.settings-tab.is-active {
    border-color: var(--brand);
    background: var(--brand);
    color: #fff;
}

.settings-subnav-standalone {
    margin: 0 0 12px;
}

.settings-panel {
    height: 100%;
    min-height: 0;
    overflow: auto;
    box-shadow: 0 12px 26px rgba(55, 30, 80, 0.05);
}

.settings-panel-header,
.settings-table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid #eee4f5;
}

.settings-panel-header span,
.settings-table-header span {
    display: block;
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 850;
}

.settings-panel-header > div > span {
    color: var(--brand);
    font-weight: 950;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.settings-panel-header h3,
.settings-table-header h4 {
    margin: 2px 0 0;
    color: #2f2140;
}

.settings-account-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-bottom: 1px solid #eee4f5;
}

.settings-account-card {
    min-height: 112px;
    display: grid;
    align-content: center;
    gap: 5px;
    padding: 16px;
    border-left: 1px solid #eee4f5;
}

.settings-account-card:first-child {
    border-left: 0;
}

.settings-account-card.is-primary {
    background: #fbf7ff;
}

.settings-account-card span,
.settings-account-card small {
    display: block;
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 850;
    text-transform: uppercase;
}

.settings-account-card strong {
    color: #2f2140;
    font-size: 1.2rem;
    font-weight: 950;
}

.settings-readonly-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    padding: 0;
}

.settings-readonly-item {
    min-height: 76px;
    display: grid;
    align-content: center;
    gap: 4px;
    padding: 14px 16px;
    border-right: 1px solid #eee4f5;
    border-bottom: 1px solid #eee4f5;
    background: #fbfdfe;
}

.settings-readonly-item:nth-child(3n) {
    border-right: 0;
}

.settings-readonly-item:nth-last-child(-n + 3) {
    border-bottom: 0;
}

.settings-readonly-item span,
.settings-profile-summary span {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 950;
    text-transform: uppercase;
}

.settings-readonly-item strong,
.settings-profile-summary strong {
    color: #2f2140;
    font-size: 0.96rem;
    font-weight: 900;
}

.settings-payment-current {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    padding: 12px 16px;
    border-top: 1px solid #eee4f5;
    border-bottom: 1px solid #eee4f5;
    background: #fbfdfe;
}

.settings-payment-current strong span {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 950;
}

.settings-payment-current strong {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    color: #2f2140;
    font-size: 1rem;
    font-weight: 950;
}

.settings-payment-current small {
    color: #52626a;
    font-size: 0.8rem;
    font-weight: 800;
    line-height: 1.35;
}

.settings-payout-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
}

.settings-payout-card {
    min-height: 166px;
    display: grid;
    grid-template-rows: auto auto auto auto minmax(0, 1fr) auto;
    align-content: start;
    gap: 7px;
    padding: 16px;
    border-right: 1px solid #eee4f5;
    border-top: 0;
    border-bottom: 0;
    border-left: 0;
    background: #fff;
    color: inherit;
    font: inherit;
    text-align: left;
}

.settings-payout-card:last-child {
    border-right: 0;
}

.settings-payout-card.is-selected {
    background: #fbf7ff;
    box-shadow: inset 0 0 0 2px #6b159e;
}

.settings-payout-card.is-unavailable {
    background: #fdfbff;
}

.settings-payout-card span {
    width: max-content;
    border: 1px solid #e4d5f2;
    border-radius: 999px;
    padding: 3px 8px;
    background: #f7edff;
    color: var(--brand);
    font-size: 0.7rem;
    font-weight: 950;
    text-transform: uppercase;
}

.settings-payout-card strong {
    color: #2f2140;
    font-size: 0.98rem;
    font-weight: 950;
}

.settings-payout-card p {
    margin: 0;
    color: #52626a;
    font-size: 0.82rem;
    font-weight: 750;
    line-height: 1.4;
}

.settings-provider-status {
    width: max-content;
    border: 1px solid #dbe7df;
    border-radius: 999px;
    padding: 3px 8px;
    background: #effaf3;
    color: #25613a;
    font-size: 0.7rem;
    font-weight: 950;
    text-transform: uppercase;
}

.settings-provider-status.is-disconnected {
    border-color: #ecd6d6;
    background: #fff5f5;
    color: #9b2f2f;
}

.settings-payout-card .settings-provider-note {
    color: #687983;
    font-size: 0.76rem;
    font-weight: 760;
}

.settings-provider-connect-note {
    border-left: 3px solid #cfb2df;
    padding-left: 8px;
    color: #5f526a;
    font-size: 0.74rem;
    font-weight: 820;
    line-height: 1.32;
}

.settings-video-provider-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    border: 1px solid #e1e7f3;
    border-radius: 12px;
    padding: 16px;
    background: #f8faff;
}

.settings-video-provider-card.is-connected {
    border-color: #b9dfca;
    background: #f3fbf6;
}

.settings-video-provider-icon {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: #2d8cff;
    color: #fff;
}

.settings-video-provider-card span,
.settings-video-provider-card strong {
    display: block;
}

.settings-video-provider-card span {
    color: #67758b;
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
}

.settings-video-provider-card strong {
    margin-top: 3px;
    color: #26354b;
    font-size: 1rem;
}

.settings-video-provider-card p {
    margin: 4px 0 0;
    color: #5c6b7e;
    font-size: 0.82rem;
    font-weight: 720;
    line-height: 1.45;
}

.settings-video-provider-card form { margin: 0; }

.settings-payout-action {
    width: max-content;
    align-self: end;
    margin-top: 4px;
    border: 1px solid #dac8ec;
    border-radius: 7px;
    background: #fff;
    color: #4a215f;
    padding: 7px 10px;
    font-size: 0.78rem;
    font-weight: 950;
    cursor: pointer;
}

.settings-payout-action:disabled {
    cursor: default;
    opacity: 0.72;
}

.settings-payout-card.is-selected .settings-payout-action {
    border-color: #6b159e;
    background: #6b159e;
    color: #fff;
}

.settings-provider-advanced {
    border-top: 1px solid #eee4f5;
    background: #fbfdfe;
}

.settings-provider-advanced summary {
    min-height: 44px;
    display: flex;
    align-items: center;
    padding: 0 16px;
    color: #4a215f;
    font-size: 0.8rem;
    font-weight: 950;
    cursor: pointer;
}

.settings-provider-advanced summary:focus-visible {
    outline: 3px solid rgba(75, 0, 130, 0.18);
    outline-offset: -3px;
}

.settings-provider-oauth-note {
    display: grid;
    gap: 3px;
    padding: 0 16px 12px;
    color: #5f526a;
}

.settings-provider-oauth-note strong {
    color: #2f2140;
    font-size: 0.82rem;
    font-weight: 950;
}

.settings-provider-oauth-note span {
    font-size: 0.76rem;
    font-weight: 780;
    line-height: 1.35;
}

.settings-provider-setup-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-top: 1px solid #eee4f5;
    background: #fbfdfe;
}

.settings-provider-setup-form {
    display: grid;
    grid-template-columns: minmax(92px, 0.32fr) minmax(0, 1fr);
    gap: 8px 10px;
    align-items: center;
    padding: 14px 16px;
    border-right: 1px solid #eee4f5;
}

.settings-provider-setup-form:last-child {
    border-right: 0;
}

.settings-provider-setup-form > div {
    grid-column: 1 / -1;
    display: grid;
    gap: 2px;
    min-height: 46px;
}

.settings-provider-setup-form strong {
    color: #2f2140;
    font-size: 0.9rem;
    font-weight: 950;
}

.settings-provider-setup-form span {
    color: #687983;
    font-size: 0.74rem;
    font-weight: 760;
    line-height: 1.28;
}

.settings-provider-setup-form label {
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 950;
    text-transform: uppercase;
}

.settings-provider-setup-form input,
.settings-provider-setup-form select {
    min-height: 34px;
    width: 100%;
    min-width: 0;
    border: 1px solid #ded2e7;
    border-radius: 7px;
    padding: 7px 9px;
    background: #fff;
    color: #2f2140;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 800;
}

.settings-provider-setup-form button {
    grid-column: 2;
    justify-self: start;
}

.settings-danger-zone {
    margin: 14px 16px 16px;
    border: 1px solid #f0c9c3;
    border-radius: 8px;
    background: #fff;
}

.settings-danger-zone summary {
    min-height: 48px;
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 0 14px;
    color: #8f1f16;
    font-size: 0.86rem;
    font-weight: 950;
}

.settings-danger-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.55fr);
    gap: 16px;
    border-top: 1px solid #f0c9c3;
    padding: 14px;
}

.settings-danger-content h4,
.settings-danger-content p {
    margin: 0;
}

.settings-danger-content p {
    margin-top: 5px;
    color: #765a58;
    font-size: 0.84rem;
    font-weight: 760;
    line-height: 1.4;
}

.settings-danger-confirm {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 8px;
}

.settings-danger-confirm label {
    grid-column: 1 / -1;
    color: #8f1f16;
    font-size: 0.76rem;
    font-weight: 900;
}

.settings-editable-form,
.settings-table-card {
    border-bottom: 1px solid #eee4f5;
}

.settings-editable-form:last-child,
.settings-table-card:last-child {
    border-bottom: 0;
}

.settings-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 16px;
}

.settings-form-grid.compact {
    padding: 0;
}

.settings-form-grid .field.full {
    grid-column: 1 / -1;
}

.settings-editable-form:not(.is-editing) input:not([type="hidden"]):not([type="checkbox"]),
.settings-editable-form:not(.is-editing) select,
.settings-editable-form:not(.is-editing) textarea {
    border-color: transparent;
    background: #fbfdfe;
    color: #26323a;
    box-shadow: none;
}

.settings-editable-form:not(.is-editing) input[type="number"] {
    appearance: textfield;
}

.settings-editable-form:not(.is-editing) input[type="number"]::-webkit-inner-spin-button,
.settings-editable-form:not(.is-editing) input[type="number"]::-webkit-outer-spin-button {
    margin: 0;
    appearance: none;
}

.settings-editable-form:not(.is-editing) select {
    appearance: none;
}

.settings-check {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    border: 1px solid #eadff2;
    border-radius: 8px;
    padding: 10px 12px;
    background: #fbfdfe;
    color: #31414a;
    font-size: 0.86rem;
    font-weight: 850;
}

.settings-check input {
    width: 17px;
    height: 17px;
    margin: 0;
    accent-color: var(--brand);
}

.settings-check.full {
    grid-column: 1 / -1;
}

.settings-confirmation {
    grid-column: 1 / -1;
    display: grid;
    gap: 7px;
    border: 1px solid #e6d8f1;
    border-radius: 8px;
    padding: 10px;
    background: #fbf7ff;
}

.settings-confirmation[hidden] {
    display: none;
}

.settings-confirmation .settings-check {
    min-height: 38px;
    padding: 8px 10px;
    background: #fff;
}

.settings-confirmation p,
.settings-inline-note {
    margin: 0;
    color: #6a596f;
    font-size: 0.8rem;
    font-weight: 760;
    line-height: 1.35;
}

.settings-inline-note.full,
.settings-policy-note.full {
    grid-column: 1 / -1;
}

.settings-policy-note {
    min-height: 58px;
    display: grid;
    align-content: center;
    gap: 4px;
    border: 1px solid #eadff2;
    border-radius: 8px;
    padding: 10px 12px;
    background: #fbfdfe;
}

.settings-policy-note span {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 950;
    text-transform: uppercase;
}

.settings-policy-note strong {
    color: #2f2140;
    font-size: 0.88rem;
    font-weight: 900;
}

.settings-edit-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.settings-profile-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.75fr);
    gap: 16px;
    padding: 16px;
}

.settings-profile-grid {
    gap: 12px 14px;
    align-items: start;
}

.settings-profile-grid .field {
    grid-template-rows: auto minmax(32px, auto) 40px;
    gap: 5px;
}

.settings-profile-grid .field-hint {
    min-height: 32px;
    height: 32px;
    display: flex;
    align-items: flex-start;
    color: #64737d;
    font-size: 0.74rem;
    font-weight: 820;
    line-height: 1.3;
    overflow: hidden;
}

.settings-profile-grid select {
    min-height: 40px;
    height: 40px;
    padding: 0 34px 0 11px;
    font-size: 0.9rem;
    font-weight: 820;
    line-height: 1.1;
}

.settings-profile-grid .settings-check {
    min-height: 54px;
    padding: 10px 14px;
    gap: 10px;
    font-size: 0.86rem;
    line-height: 1.25;
}

.settings-profile-grid .settings-check input {
    flex: 0 0 auto;
}

.settings-profile-grid .settings-confirmation {
    gap: 8px;
    padding: 12px;
}

.settings-profile-grid .settings-confirmation .settings-check {
    min-height: 46px;
    padding: 9px 12px;
}

.settings-profile-summary {
    display: grid;
    align-content: start;
    gap: 8px;
    border-left: 1px solid #eee4f5;
    padding-left: 16px;
}

.settings-profile-summary p {
    margin: 0;
    color: #52626a;
    font-size: 0.86rem;
    font-weight: 760;
    line-height: 1.45;
}

.settings-rule-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0;
}

.settings-rule-card {
    display: grid;
    align-content: start;
    gap: 12px;
    padding: 16px;
    border-right: 1px solid #eee4f5;
    border-bottom: 1px solid #eee4f5;
}

.settings-rule-card:nth-child(2n) {
    border-right: 0;
}

.settings-rule-card:last-child {
    grid-column: 1 / -1;
    border-right: 0;
    border-bottom: 0;
}

.settings-rule-card h5 {
    margin: 0;
    color: #2f2140;
    font-size: 0.94rem;
}

.settings-data-table {
    width: 100%;
    border-collapse: collapse;
}

.settings-data-table th,
.settings-data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #eee4f5;
    color: #31414a;
    font-size: 0.84rem;
    font-weight: 760;
    text-align: left;
}

.settings-data-table th {
    color: #66747c;
    font-size: 0.74rem;
    font-weight: 950;
    text-transform: uppercase;
}

.settings-data-table tr:last-child td {
    border-bottom: 0;
}

.settings-floating-add {
    background: var(--brand);
}

.settings-drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: flex;
    justify-content: flex-end;
    background: rgba(31, 18, 42, 0.36);
}

.settings-drawer-backdrop[hidden] {
    display: none;
}

.settings-create-drawer {
    width: min(620px, calc(100vw - 32px));
    height: 100%;
    overflow: hidden;
    border-left: 1px solid #d8cfe3;
    background: #fff;
    box-shadow: -22px 0 50px rgba(35, 24, 45, 0.24);
}

.settings-create-drawer .settings-location-form {
    height: 100%;
    overflow: auto;
    display: grid;
    align-content: start;
    gap: 14px;
    padding: 22px;
}

.settings-create-drawer .client-drawer-header {
    position: sticky;
}

@media (max-width: 1050px) {
    .content:has(.client-record-workspace) {
        height: auto;
        overflow: visible;
    }

    .content-frame:has(.client-record-workspace),
    .content-surface:has(.client-record-workspace),
    .client-record-workspace,
    .client-record-section,
    .client-record-section.is-active {
        height: auto;
    }

    .content-surface:has(.client-record-workspace),
    .client-record-section {
        overflow: visible;
    }

    .client-record-subnav {
        grid-template-columns: 1fr;
    }

    .client-record-subnav-links {
        justify-content: flex-start;
        margin-left: 0;
    }

    .client-overview-layout,
    .client-contact-layout,
    .client-visits-layout,
    .client-visits-layout.has-flyout,
    .client-forms-layout,
    .client-payment-layout,
    .client-preferences-layout,
    .settings-location-grid {
        grid-template-columns: 1fr;
        height: auto;
        overflow: visible;
    }

    .client-record-block,
    .client-visits-list,
    .client-all-notes-panel {
        overflow: visible;
    }

    .client-contact-layout .client-record-block,
    .client-payment-layout .client-record-block,
    .client-preferences-layout .client-record-block,
    .client-forms-layout .client-record-block,
    .client-all-notes-panel,
    .client-body-chart-flyout {
        border-left: 0;
        border-top: 1px solid #eee4f5;
    }

    .client-contact-layout .client-record-block:first-child,
    .client-preferences-layout .client-record-block:first-child,
    .client-forms-layout .client-record-block:first-child {
        border-top: 0;
    }

    .settings-readonly-grid,
    .settings-payout-grid,
    .settings-provider-setup-grid,
    .settings-danger-content,
    .settings-profile-layout,
    .settings-rule-grid,
    .settings-form-grid,
    .settings-form-grid.compact {
        grid-template-columns: 1fr;
    }

    .settings-payment-current {
        gap: 5px;
        align-items: start;
    }

    .settings-readonly-item,
    .settings-readonly-item:nth-child(3n),
    .settings-rule-card,
    .settings-rule-card:nth-child(2n),
    .settings-rule-card:last-child {
        grid-column: auto;
        border-right: 0;
        border-bottom: 1px solid #eee4f5;
    }

    .settings-readonly-item:last-child,
    .settings-rule-card:last-child {
        border-bottom: 0;
    }

    .settings-payout-card {
        border-right: 0;
        border-bottom: 1px solid #eee4f5;
    }

    .settings-payout-card:last-child {
        border-bottom: 0;
    }

    .settings-provider-setup-form {
        grid-template-columns: 1fr;
        border-right: 0;
        border-bottom: 1px solid #eee4f5;
    }

    .settings-provider-setup-form:last-child {
        border-bottom: 0;
    }

    .settings-provider-setup-form button {
        grid-column: 1;
    }

    .settings-danger-confirm {
        grid-template-columns: 1fr;
    }

    .settings-profile-summary {
        border-left: 0;
        border-top: 1px solid #eee4f5;
        padding-top: 16px;
        padding-left: 0;
    }

    .settings-profile-grid .field {
        grid-template-rows: auto auto 40px;
    }

    .settings-profile-grid .field-hint {
        min-height: 0;
        height: auto;
        overflow: visible;
    }
}

@media (max-width: 760px) {
    .content:has(.client-record-workspace) {
        padding: 12px;
    }

    .client-record-banner {
        min-height: 0;
    }

    .client-record-banner-main {
        align-items: flex-start;
    }

    .client-record-contact-line {
        align-items: flex-start;
        flex-direction: column;
        gap: 5px;
    }

    .client-record-subnav-links {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        overflow: visible;
    }

    .appointment-create-grid {
        grid-template-columns: 1fr;
    }

    .client-picker-row-main {
        grid-template-columns: 1fr;
        gap: 3px;
    }

    .client-record-tab {
        width: 100%;
    }

    .client-summary-strip {
        grid-template-columns: 1fr;
    }

    .client-message-actions,
    .client-notification-grid {
        grid-template-columns: 1fr;
    }

    .client-visit-accordion summary {
        grid-template-columns: 1fr auto;
        white-space: normal;
    }

    .client-visit-time,
    .client-visit-status,
    .client-visit-service strong {
        white-space: normal;
    }

    .settings-location-form .btn {
        width: 100%;
        justify-self: stretch;
    }
}

/* Client portal refinement pass */
.portal-v2 .portal-home-hero {
    min-height: 0;
    padding: 25px 36px;
}

.portal-v2 .portal-home-hero::after {
    border-width: 38px;
    height: 170px;
    right: -48px;
    top: -72px;
    width: 170px;
}

.portal-v2 .portal-home-hero h1 {
    font-size: clamp(29px, 3.2vw, 39px);
    margin: 5px 0;
}

.portal-v2 .portal-summary-attention {
    border-color: #d8b9e6;
    box-shadow: inset 0 3px 0 #7b3a9d;
}

.portal-v2 .portal-practitioner-card {
    cursor: pointer;
    font: inherit;
    text-align: left;
    width: 100%;
}

.portal-v2 .portal-practitioner-card:disabled {
    cursor: default;
}

.portal-practitioner-profile {
    display: grid;
    gap: 14px;
    padding: 22px 26px 26px;
}

.portal-practitioner-profile > div,
.portal-practitioner-profile > article {
    border-bottom: 1px solid #eee4f3;
    display: grid;
    gap: 5px;
    margin: 0;
    padding-bottom: 14px;
}

.portal-practitioner-profile > :last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.portal-practitioner-profile small {
    color: #7d7185;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.portal-practitioner-profile p {
    color: #5f5665;
    line-height: 1.6;
    margin: 0;
}

.portal-practitioner-profile p span,
.portal-practitioner-profile p a {
    display: block;
}

.practitioner-public-preview small {
    color: #6a5e71;
    line-height: 1.5;
}

.waiver-template-picker {
    background: #fbf7fd;
    border: 1px solid #eadcf2;
    border-radius: 12px;
    padding: 14px;
}

.waiver-template-picker small {
    color: #765d83;
    display: block;
    line-height: 1.45;
}

.portal-v2 .client-portal-tabs .portal-nav-alert {
    align-items: center;
    background: #7a2e9d;
    border: 2px solid #fff;
    border-radius: 999px;
    box-shadow: 0 2px 7px rgba(77, 24, 99, .25);
    color: #fff;
    display: inline-flex;
    font-size: 9px;
    font-style: normal;
    font-weight: 900;
    height: 18px;
    justify-content: center;
    line-height: 1;
    min-width: 18px;
    padding: 0 5px;
}

.portal-v2 .portal-service-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 13px;
}

.portal-v2 .portal-service-card {
    align-items: start;
    gap: 12px;
    grid-template-columns: 40px minmax(0, 1fr) 16px;
    min-height: 132px;
    padding: 18px;
}

.portal-v2 .portal-service-icon {
    border-radius: 12px;
    height: 40px;
}

.portal-v2 .portal-service-copy {
    gap: 4px;
}

.portal-v2 .portal-service-copy strong {
    font-size: 16px;
    line-height: 1.25;
}

.portal-v2 .portal-service-copy small {
    font-size: 12px;
    line-height: 1.35;
}

.portal-v2 .portal-service-copy em {
    font-size: 12px;
    margin-top: 3px;
}

.portal-v2 .portal-date-selector {
    display: grid;
    gap: 9px;
    grid-template-columns: repeat(7, minmax(82px, 1fr));
    margin: 18px 0 22px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.portal-v2 .portal-date-card {
    background: #fbf9fc;
    border: 1px solid #e9e2ed;
    border-radius: 14px;
    color: #746b7c;
    cursor: pointer;
    display: grid;
    gap: 2px;
    padding: 12px 9px;
    text-align: center;
}

.portal-v2 .portal-date-card span {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.portal-v2 .portal-date-card strong {
    color: #322b3b;
    font-size: 14px;
}

.portal-v2 .portal-date-card.is-selected {
    background: #672687;
    border-color: #672687;
    box-shadow: 0 7px 16px rgba(86, 29, 112, .18);
    color: #eadff0;
}

.portal-v2 .portal-date-card.is-selected strong {
    color: #fff;
}

.portal-v2 .portal-day-times {
    display: grid;
    gap: 18px;
}

.portal-v2 .portal-daypart {
    display: grid;
    gap: 12px;
}

.portal-v2 .portal-daypart-heading {
    align-items: center;
    border-bottom: 1px solid #e6dce9;
    color: #746a7c;
    display: flex;
    font-size: 14px;
    font-weight: 900;
    gap: 8px;
    letter-spacing: .06em;
    padding: 0 2px 10px;
    text-transform: uppercase;
    width: 100%;
}

.portal-v2 .portal-daypart-heading svg {
    color: #7a329a;
    height: 20px;
    width: 20px;
}

.portal-v2 .portal-daypart .portal-time-grid {
    grid-template-columns: repeat(6, minmax(94px, 1fr));
    max-height: none;
    overflow: visible;
}

.portal-v2 .portal-daypart .portal-time-card {
    align-items: center;
    display: flex;
    justify-content: center;
    min-height: 48px;
    padding: 11px 13px;
    text-align: center;
}

.portal-v2 .portal-daypart .portal-time-card strong {
    font-size: 16px;
    font-weight: 900;
    line-height: 1.1;
}

.portal-v2 .portal-appointment-months {
    display: grid;
    gap: 14px;
}

.portal-v2 .portal-month-group {
    background: #fff;
    border: 1px solid #e7e0eb;
    border-radius: 18px;
    overflow: hidden;
}

.portal-v2 details.portal-month-group > summary,
.portal-v2 .portal-month-heading {
    align-items: center;
    background: #fbf9fc;
    color: #342d3c;
    display: flex;
    justify-content: space-between;
    list-style: none;
    padding: 17px 20px;
}

.portal-v2 details.portal-month-group > summary {
    cursor: pointer;
}

.portal-v2 details.portal-month-group > summary::-webkit-details-marker {
    display: none;
}

.portal-v2 .portal-month-group summary > span,
.portal-v2 .portal-month-heading > span {
    display: grid;
    gap: 2px;
}

.portal-v2 .portal-month-group summary small,
.portal-v2 .portal-month-heading small {
    color: #817789;
    font-size: 11px;
}

.portal-v2 .portal-month-group summary > svg {
    transition: transform .2s ease;
}

.portal-v2 .portal-month-group[open] summary > svg {
    transform: rotate(180deg);
}

.portal-v2 .portal-month-group .portal-appointment-list {
    gap: 0;
    padding: 0 14px 14px;
}

.portal-v2 .portal-month-group .portal-appointment-row {
    border-color: transparent;
    border-radius: 12px;
    border-top-color: #eee8f1;
}

.portal-v2 .portal-month-group .portal-appointment-row:first-child {
    border-top-color: transparent;
}

.portal-v2 .portal-wallet-owned,
.portal-v2 .portal-wallet-market {
    margin-bottom: 18px;
}

.portal-v2 .portal-wallet-empty {
    align-items: center;
    background: #faf8fb;
    border: 1px dashed #d9cde0;
    border-radius: 15px;
    display: flex;
    gap: 15px;
    padding: 22px;
    width: 100%;
}

.portal-v2 .portal-wallet-empty.compact {
    grid-column: 1 / -1;
    min-height: 108px;
}

.portal-v2 .portal-wallet-empty > i {
    align-items: center;
    background: #eee3f3;
    border-radius: 12px;
    color: #6d2b8d;
    display: flex;
    flex: 0 0 42px;
    height: 42px;
    justify-content: center;
}

.portal-v2 .portal-wallet-empty strong,
.portal-v2 .portal-wallet-empty p {
    display: block;
    margin: 0;
}

.portal-v2 .portal-wallet-empty p,
.portal-v2 .portal-wallet-none {
    color: #756d7c;
    font-size: 13px;
    margin-top: 4px;
}

.portal-v2 .portal-wallet-owned-grid {
    display: grid;
    gap: 24px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.portal-v2 .portal-wallet-owned-grid h3 {
    font-size: 14px;
    margin: 0 0 10px;
}

.portal-v2 .portal-product-grid {
    grid-template-columns: 1fr;
}

.portal-v2 .portal-product-grid .portal-package-offer-card {
    align-items: center;
    background: linear-gradient(135deg, #fff 0%, #fbf7fc 100%);
    border: 1px solid #e4d8e9;
    border-radius: 18px;
    display: grid;
    gap: 18px;
    grid-template-columns: 54px minmax(0, 1fr) auto;
    min-height: 132px;
    padding: 20px 22px;
}

.portal-v2 .portal-package-offer-icon {
    align-items: center;
    background: linear-gradient(135deg, #efe2f4, #f7effa);
    border-radius: 15px;
    color: #6d2b8d;
    display: flex;
    height: 54px;
    justify-content: center;
    width: 54px;
}

.portal-v2 .portal-package-offer-icon .ui-icon {
    height: 25px;
    width: 25px;
}

.portal-v2 .portal-package-offer-copy {
    min-width: 0;
}

.portal-v2 .portal-package-offer-copy > span {
    color: #7b3c98;
    display: block;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.portal-v2 .portal-package-offer-copy h3 {
    font-size: 19px;
    margin: 4px 0;
}

.portal-v2 .portal-package-offer-copy p {
    color: #756d7c;
    font-size: 13px;
    line-height: 1.45;
    margin: 0 0 7px;
}

.portal-v2 .portal-package-offer-copy small {
    color: #4f4458;
    font-size: 12px;
    font-weight: 800;
}

.portal-v2 .portal-package-offer-purchase {
    align-items: flex-end;
    border-left: 1px solid #eee5f1;
    display: flex;
    flex-direction: column;
    min-width: 190px;
    padding-left: 22px;
}

.portal-v2 .portal-package-offer-purchase > strong {
    color: #2e2236;
    font-size: 24px;
    line-height: 1.1;
}

.portal-v2 .portal-package-offer-purchase > span {
    color: #7a7081;
    font-size: 12px;
    margin: 4px 0 12px;
}

.portal-v2 .portal-package-offer-purchase form {
    margin: 0;
}

.portal-v2 .portal-product-grid > .portal-empty-state,
.portal-v2 .portal-gift-list > .portal-empty-state {
    grid-column: 1 / -1;
    width: 100%;
}

.portal-v2 .portal-wallet-gift-cta {
    align-items: center;
    background: linear-gradient(120deg, #f5ecf8, #fbf7fc);
    border: 1px solid #dfcde7;
    border-radius: 18px;
    display: flex;
    justify-content: space-between;
    padding: 18px 20px;
}

.portal-v2 .portal-wallet-gift-cta > div {
    align-items: center;
    display: flex;
    gap: 13px;
}

.portal-v2 .portal-wallet-gift-cta i {
    align-items: center;
    background: #fff;
    border-radius: 11px;
    color: #6d2b8d;
    display: flex;
    height: 40px;
    justify-content: center;
    width: 40px;
}

.portal-v2 .portal-wallet-gift-cta span {
    display: grid;
}

.portal-v2 .portal-wallet-gift-cta small {
    color: #756b7c;
}

.portal-v2 dialog.portal-modal {
    border-radius: 22px;
    max-height: min(88vh, 900px);
    overflow-x: hidden;
    overflow-y: auto;
    padding: 0;
    position: relative;
}

.portal-v2 .portal-dialog-hero {
    background: linear-gradient(135deg, #f5edf9, #faf6fc);
    border-radius: 22px 22px 0 0;
    margin: 0;
    padding: 24px 68px 22px 28px;
}

.portal-v2 .portal-dialog-close {
    height: 0;
    margin: 0;
    position: sticky;
    right: 0;
    top: 0;
    z-index: 5;
}

.portal-v2 .portal-dialog-close button {
    align-items: center;
    background: #fff;
    border: 1px solid #d9c9e1;
    border-radius: 999px;
    box-shadow: 0 3px 9px rgba(70, 36, 84, .09);
    color: #652887;
    display: flex;
    height: 36px;
    justify-content: center;
    margin: 18px 18px 0 0;
    padding: 0;
    width: 36px;
}

.portal-v2 .portal-dialog-close button:focus,
.portal-v2 .portal-dialog-close button:focus-visible {
    box-shadow: 0 0 0 3px rgba(111, 45, 143, .18), 0 3px 9px rgba(70, 36, 84, .09);
    outline: none;
}

.portal-v2 dialog.portal-modal > .portal-form-stack {
    margin: 0;
    padding: 20px 28px 28px;
}

.portal-v2 dialog.portal-modal > .portal-detail-grid,
.portal-v2 dialog.portal-modal > .portal-dialog-section,
.portal-v2 dialog.portal-modal > .portal-policy-note,
.portal-v2 dialog.portal-modal > .portal-dialog-actions {
    margin-left: 28px;
    margin-right: 28px;
}

.portal-v2 dialog.portal-modal > .portal-detail-grid {
    margin-top: 20px;
}

.portal-v2 dialog.portal-modal > .portal-dialog-actions {
    margin-bottom: 28px;
}

.portal-v2 .portal-payment-choice input[type="radio"] {
    appearance: none;
    background: #fff;
    border: 2px solid #a887b7;
    border-radius: 50%;
    box-sizing: border-box;
    flex: 0 0 18px;
    height: 18px;
    margin: 0;
    min-height: 18px;
    min-width: 18px;
    padding: 0 !important;
    width: 18px;
}

.portal-v2 .portal-payment-choice input[type="radio"]:checked {
    background: #6d2b8d;
    border-color: #6d2b8d;
    box-shadow: inset 0 0 0 4px #fff;
}

.portal-v2 .portal-payment-choice input[type="radio"]:focus,
.portal-v2 .portal-payment-choice input[type="radio"]:focus-visible {
    outline: none;
}

@media (max-width: 980px) {
    .portal-v2 .portal-service-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .portal-v2 .portal-daypart .portal-time-grid {
        grid-template-columns: repeat(4, minmax(94px, 1fr));
    }

    .portal-v2 .portal-product-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 680px) {
    .portal-v2 .portal-home-hero {
        padding: 22px;
    }

    .portal-v2 .portal-service-grid,
    .portal-v2 .portal-wallet-owned-grid,
    .portal-v2 .portal-product-grid {
        grid-template-columns: 1fr;
    }

    .portal-v2 .portal-product-grid .portal-package-offer-card {
        align-items: start;
        grid-template-columns: 46px minmax(0, 1fr);
        padding: 18px;
    }

    .portal-v2 .portal-package-offer-icon {
        height: 46px;
        width: 46px;
    }

    .portal-v2 .portal-package-offer-purchase {
        align-items: stretch;
        border-left: 0;
        border-top: 1px solid #eee5f1;
        grid-column: 1 / -1;
        padding: 14px 0 0;
    }

    .portal-v2 .portal-daypart .portal-time-grid {
        grid-template-columns: repeat(3, minmax(82px, 1fr));
    }

    .portal-v2 .portal-wallet-gift-cta {
        align-items: stretch;
        flex-direction: column;
        gap: 14px;
    }

    .portal-v2 dialog.portal-modal {
        border-radius: 18px;
    }

    .portal-v2 .portal-dialog-hero {
        border-radius: 18px 18px 0 0;
        padding-left: 20px;
    }

    .portal-v2 dialog.portal-modal > .portal-form-stack {
        padding: 18px 20px 20px;
    }
}

/* Calendar-first portal booking */
.portal-v2 .portal-book-calendar {
    border: 1px solid #e6deea;
    border-radius: 18px;
    margin-top: 18px;
    max-width: 760px;
    overflow: hidden;
}

.portal-v2 .portal-book-calendar-toolbar {
    align-items: center;
    background: #faf7fb;
    border-bottom: 1px solid #ebe4ee;
    display: grid;
    grid-template-columns: 42px 1fr 42px;
    padding: 12px 14px;
}

.portal-v2 .portal-book-calendar-toolbar strong {
    color: #342c3d;
    font-size: 17px;
    text-align: center;
}

.portal-v2 .portal-book-calendar-toolbar button {
    align-items: center;
    background: #fff;
    border: 1px solid #ddd2e3;
    border-radius: 10px;
    color: #672687;
    cursor: pointer;
    display: flex;
    height: 36px;
    justify-content: center;
    padding: 0;
    width: 36px;
}

.portal-v2 .portal-book-calendar-toolbar button:disabled {
    cursor: default;
    opacity: .35;
}

.portal-v2 .portal-book-calendar-weekdays,
.portal-v2 .portal-book-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.portal-v2 .portal-book-calendar-weekdays {
    background: #fff;
    border-bottom: 1px solid #f0ebf2;
    padding: 0 12px;
}

.portal-v2 .portal-book-calendar-weekdays span {
    color: #8b8191;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .07em;
    padding: 10px 4px;
    text-align: center;
    text-transform: uppercase;
}

.portal-v2 .portal-book-calendar-grid {
    gap: 5px;
    padding: 12px;
}

.portal-v2 .portal-book-calendar-grid > button,
.portal-v2 .portal-book-calendar-grid > span {
    align-items: center;
    aspect-ratio: 1.45 / 1;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    min-height: 42px;
}

.portal-v2 .portal-book-calendar-grid > button {
    background: #f5ecf8;
    border: 1px solid #d8c2e2;
    color: #602480;
    cursor: pointer;
    font: inherit;
    font-weight: 900;
    position: relative;
}

.portal-v2 .portal-book-calendar-grid > button:hover {
    background: #682889;
    border-color: #682889;
    color: #fff;
}

.portal-v2 .portal-book-calendar-grid > button i {
    background: #8a42a7;
    border-radius: 50%;
    bottom: 5px;
    height: 4px;
    position: absolute;
    width: 4px;
}

.portal-v2 .portal-book-calendar-grid > button:hover i {
    background: #fff;
}

.portal-v2 .portal-calendar-day-disabled {
    color: #b8b0bc;
    font-size: 13px;
}

.portal-v2 .portal-book-calendar-grid .is-blank {
    min-height: 0;
}

.portal-v2 .portal-selected-date-summary {
    align-items: center;
    background: linear-gradient(120deg, #f4eaf8, #faf6fc);
    border: 1px solid #d8c4e2;
    border-radius: 15px;
    display: flex;
    justify-content: space-between;
    margin: 18px 0;
    max-width: 760px;
    padding: 14px 16px;
}

.portal-v2 .portal-selected-date-summary > div {
    align-items: center;
    display: flex;
    gap: 12px;
}

.portal-v2 .portal-selected-date-summary > div > i {
    align-items: center;
    background: #fff;
    border-radius: 10px;
    color: #672687;
    display: flex;
    height: 40px;
    justify-content: center;
    width: 40px;
}

.portal-v2 .portal-selected-date-summary span {
    display: grid;
    gap: 2px;
}

.portal-v2 .portal-selected-date-summary small {
    color: #85798c;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.portal-v2 .portal-selected-date-summary strong {
    color: #332a3b;
}

@media (max-width: 680px) {
    .portal-v2 .portal-book-calendar-grid {
        gap: 3px;
        padding: 8px;
    }

    .portal-v2 .portal-book-calendar-grid > button,
    .portal-v2 .portal-book-calendar-grid > span {
        aspect-ratio: 1 / 1;
        min-height: 36px;
    }

    .portal-v2 .portal-selected-date-summary {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }
}
.pos-applied-gifts{display:grid;gap:6px;margin-top:8px}.pos-applied-gift{display:flex;justify-content:space-between;align-items:center;padding:8px 10px;border:1px solid var(--border);border-radius:9px;background:var(--surface-subtle,#faf8fc);font-size:.86rem}.pos-applied-gift button{border:0;background:transparent;color:#b42318;font-size:1.1rem;cursor:pointer}.pos-custom-tax{display:flex;align-items:center;gap:8px;margin-bottom:14px;font-weight:650}

/* Group offerings and practitioner-built memberships */
.offerings-eyebrow{color:#6e2f88;display:block;font-size:.72rem;font-weight:900;letter-spacing:.12em;margin-bottom:5px;text-transform:uppercase}
.offerings-page-header,.memberships-page-header,.offering-detail-header{align-items:flex-end}
.offerings-page-header h1,.memberships-page-header h1,.offering-detail-header h1{margin:.15rem 0 .35rem}
.offerings-builder-layout,.membership-builder-layout{align-items:start;display:grid;gap:22px;grid-template-columns:minmax(0,1.25fr) minmax(340px,.75fr)}
.offerings-list-panel,.offering-builder-panel,.membership-list-panel,.membership-builder-panel{padding:0;overflow:hidden}
.offerings-panel-heading{align-items:center;border-bottom:1px solid #e7deeb;display:flex;justify-content:space-between;padding:20px 22px}
.offerings-panel-heading>div>span{color:#8b7b91;display:block;font-size:.68rem;font-weight:900;letter-spacing:.1em;text-transform:uppercase}
.offerings-panel-heading h2{font-size:1.15rem;margin:3px 0 0}
.offering-card-list,.membership-plan-list{display:grid;gap:12px;padding:16px}
.offering-card{align-items:center;background:#fff;border:1px solid #e5dbe9;border-radius:15px;color:inherit;display:grid;gap:14px;grid-template-columns:5px minmax(0,1fr) 24px;overflow:hidden;padding:0 18px 0 0;transition:border-color .15s ease,box-shadow .15s ease,transform .15s ease}
.offering-card:hover{border-color:#b99bc7;box-shadow:0 8px 22px rgba(75,0,130,.08);transform:translateY(-1px)}
.offering-color-bar{align-self:stretch;background:var(--offering-color,#6fa8dc);min-height:144px}
.offering-card-main{padding:16px 0}
.offering-card-title{align-items:flex-start;display:flex;gap:14px;justify-content:space-between}
.offering-card-title h3{font-size:1.05rem;margin:7px 0 0}
.offering-card-title>strong{font-size:1.08rem}
.offering-card-main>p{color:#746a79;font-size:.88rem;line-height:1.5;margin:10px 0 13px}
.offering-card-meta{display:flex;flex-wrap:wrap;gap:8px 16px}
.offering-card-meta span{align-items:center;color:#665c6b;display:inline-flex;font-size:.77rem;font-weight:700;gap:5px}
.offering-card-meta .ui-icon{height:15px;width:15px}
.offering-card-arrow{color:#85509a}
.offerings-empty{align-items:center;color:#786c7f;display:flex;flex-direction:column;justify-content:center;min-height:250px;padding:35px;text-align:center}
.offerings-empty>.ui-icon{color:#8950a0;height:36px;width:36px}
.offerings-empty h3{color:#3d3342;margin:14px 0 5px}
.offerings-empty p{margin:0;max-width:340px}
.offering-builder-form,.membership-builder-form{display:grid;gap:17px;padding:20px 22px 24px}
.offerings-compact-grid{gap:12px;grid-template-columns:repeat(2,minmax(0,1fr))}
.input-suffix,.input-prefix{align-items:stretch;display:flex}
.input-suffix input,.input-prefix input{min-width:0}
.input-suffix span,.input-prefix span{align-items:center;background:#f6f1f8;border:1px solid #d9ccdf;color:#74677b;display:flex;font-size:.74rem;font-weight:800;padding:0 10px;white-space:nowrap}
.input-prefix span{border-radius:9px 0 0 9px;border-right:0}.input-prefix input{border-radius:0 9px 9px 0}
.input-suffix input{border-radius:9px 0 0 9px}.input-suffix span{border-left:0;border-radius:0 9px 9px 0}
.offering-policy-details{border:1px solid #e1d6e6;border-radius:12px;padding:0 14px}
.offering-policy-details summary{color:#473b4d;cursor:pointer;font-size:.82rem;font-weight:900;padding:13px 0}
.offering-policy-details[open] summary{border-bottom:1px solid #eee6f1;margin-bottom:14px}
.offering-policy-details>.form-grid,.offering-policy-details>.field{margin-bottom:14px}
.offering-builder-footer{align-items:center;display:flex;gap:18px;justify-content:space-between}
.offering-color-field{align-items:center;color:#665b6c;display:flex;font-size:.78rem;font-weight:800;gap:8px}
.offering-color-field input{height:30px;padding:2px;width:44px}
.offering-create-button{justify-content:center;width:auto}
.offering-form-actions{align-items:center;border-top:1px solid #eadff2;display:flex;justify-content:flex-end;padding-top:14px}
.offering-builder-form input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),.offering-builder-form select,.membership-builder-form input:not([type="checkbox"]):not([type="radio"]),.membership-builder-form select,.offering-enroll-form input:not([type="checkbox"]):not([type="radio"]),.offering-enroll-form select{height:40px;min-height:40px}
.offering-builder-form textarea,.membership-builder-form textarea{min-height:88px}
.offering-builder-form .input-prefix>span,.offering-builder-form .input-suffix>span,.membership-builder-form .input-prefix>span,.membership-builder-form .input-suffix>span{height:40px}
.offering-back-link{align-items:center;color:#6d2c89;display:inline-flex;font-size:.8rem;font-weight:800;gap:5px;margin-bottom:16px}
.offering-back-link .ui-icon{height:16px;width:16px}
.offering-detail-price{background:#f5edf8;border:1px solid #decce6;border-radius:14px;display:grid;min-width:130px;padding:12px 18px;text-align:right}
.offering-detail-price span{color:#806c89;font-size:.7rem;font-weight:900;text-transform:uppercase}.offering-detail-price strong{font-size:1.35rem}
.offering-summary-grid{display:grid;gap:14px;grid-template-columns:repeat(4,minmax(0,1fr));margin-bottom:20px}
.offering-summary-card{display:grid;gap:5px;padding:17px}.offering-summary-card>span{color:#8b7b91;font-size:.67rem;font-weight:900;letter-spacing:.09em;text-transform:uppercase}.offering-summary-card>strong{font-size:.98rem}.offering-summary-card>small{color:#756a7b}
.offering-detail-layout{align-items:start;display:grid;gap:20px;grid-template-columns:minmax(0,1.35fr) minmax(300px,.65fr)}
.offering-sessions-panel,.offering-enroll-panel,.offering-roster-panel{padding:0;overflow:hidden}
.offering-session-list{display:grid}.offering-session-row{align-items:center;border-bottom:1px solid #eee7f1;display:grid;gap:13px;grid-template-columns:34px minmax(150px,1fr) minmax(130px,1fr) 70px;padding:14px 20px}.offering-session-row:last-child{border-bottom:0}
.offering-session-number{align-items:center;background:#f2e9f6;border-radius:50%;color:#702c8d;display:flex;font-size:.78rem;font-weight:900;height:30px;justify-content:center;width:30px}.offering-session-time,.offering-session-place,.offering-session-fill{display:grid;gap:3px}.offering-session-row span{color:#776b7d;font-size:.76rem}.offering-session-fill{text-align:right}
.offering-enroll-form{display:grid;gap:15px;padding:18px 20px}.series-enrollment-note{align-items:center;background:#f5eef8;border-radius:10px;color:#613076;display:flex;font-size:.8rem;font-weight:750;gap:9px;padding:11px}.series-enrollment-note .ui-icon{height:18px;width:18px}.offering-enroll-form .btn{justify-content:center}.offering-enroll-help{font-size:.74rem;line-height:1.45;margin:0;text-align:center}
.offering-roster-panel{margin-top:20px}.offering-roster-panel table strong{font-size:.86rem}
.membership-principle-banner{align-items:center;background:linear-gradient(120deg,#f3e9f7,#faf7fb);border:1px solid #dcc9e5;border-radius:14px;color:#57465f;display:flex;gap:13px;margin-bottom:20px;padding:14px 17px}.membership-principle-banner>div{align-items:center;background:#fff;border-radius:10px;color:#722f8d;display:flex;height:38px;justify-content:center;width:38px}.membership-principle-banner .ui-icon{height:20px;width:20px}
.membership-plan-card{border:1px solid #e3d8e7;border-radius:15px;padding:18px}.membership-plan-topline{align-items:flex-start;display:flex;gap:12px;justify-content:space-between}.membership-plan-topline h3{margin:7px 0 0}.membership-plan-price{align-items:baseline;display:flex;gap:3px}.membership-plan-price strong{font-size:1.2rem}.membership-plan-price span{color:#807486;font-size:.73rem}.membership-plan-card>p{color:#756b7a;font-size:.84rem;line-height:1.45}
.membership-benefit-list{display:grid;gap:7px}.membership-benefit-list span{align-items:center;color:#514657;display:flex;font-size:.8rem;font-weight:750;gap:7px}.membership-benefit-list .ui-icon{color:#2f855a;height:15px;width:15px}
.calendar-group-event{border-style:dashed;box-shadow:inset 3px 0 0 var(--calendar-event-border,#80509a)}
.group-session-modal{gap:14px;width:min(980px,100%)}
.group-session-capacity-card{align-items:center;background:linear-gradient(120deg,#f6eff9,#fbf9fc);border:1px solid #dfcfe7;border-radius:8px;display:grid;gap:18px;grid-template-columns:minmax(190px,.55fr) minmax(240px,1.45fr);padding:12px 14px}
.group-session-capacity-card>div:first-child{display:grid;gap:3px}.group-session-capacity-card span{color:#765780;font-size:.7rem;font-weight:900;letter-spacing:.08em;text-transform:uppercase}.group-session-capacity-card strong{color:#34233d;font-size:1rem}.group-session-capacity-card small{color:#776a7d;font-weight:750}
.group-session-capacity-track{background:#e5dce9;border-radius:999px;height:10px;overflow:hidden}.group-session-capacity-track i{background:linear-gradient(90deg,#783493,#a56abb);border-radius:inherit;display:block;height:100%;min-width:3px;transition:width .2s ease}
.group-session-detail-card{margin:0}.group-session-list-section{border:1px solid #e3d9e7;border-radius:8px;overflow:hidden}.group-session-section-heading{align-items:center;border-bottom:1px solid #e8dfee;display:flex;justify-content:space-between;margin:0;padding:12px 14px}.group-session-section-heading h3{margin:3px 0 0}.group-session-section-heading form{display:flex;justify-content:flex-end}
.group-session-detail-card .appointment-detail-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
.group-session-table-wrap{overflow-x:auto}.group-session-roster-table{border-collapse:collapse;width:100%}.group-session-roster-table th{background:#faf7fb;color:#75687c;font-size:.7rem;letter-spacing:.06em;padding:9px 12px;text-align:left;text-transform:uppercase}.group-session-roster-table th:last-child{text-align:right}.group-session-roster-table td{border-top:1px solid #eee7f1;padding:10px 12px;vertical-align:middle}.group-session-roster-table tbody tr:first-child td{border-top:0}.group-session-roster-table td:first-child{min-width:190px}.group-session-roster-table td:nth-child(3){min-width:250px}.group-session-roster-table td:last-child{text-align:right;width:1%}.group-session-roster-table td>strong,.group-session-roster-table td>small{display:block}.group-session-roster-table td>small{color:#7a6f80;font-size:.72rem;margin-top:3px}
.group-session-payment-label{background:#f4eef7;border:1px solid #e0d3e6;border-radius:999px;color:#594660;display:inline-flex;font-size:.72rem;font-weight:850;min-height:25px;padding:4px 9px;white-space:nowrap}
.group-session-attendance-form{align-items:center;display:grid;gap:8px;grid-template-columns:minmax(135px,1fr) auto}.group-session-attendance-form select{height:38px;min-height:38px}.group-session-save-button,.group-session-cancel-button{min-width:68px}.group-session-cancel-form{display:flex;justify-content:flex-end}
.group-session-empty{color:#7b7081;font-size:.82rem;padding:18px;text-align:center}.group-session-waitlist-list{display:grid}.group-session-waitlist-row{align-items:center;border-top:1px solid #eee7f1;display:grid;gap:12px;grid-template-columns:38px minmax(0,1fr) auto auto;padding:10px 14px}.group-session-waitlist-row:first-child{border-top:0}.group-session-waitlist-position{align-items:center;background:#f5edf8;border-radius:50%;color:#6e2f88;display:flex;font-size:.74rem;font-weight:900;height:30px;justify-content:center;width:30px}.group-session-waitlist-row>div{display:grid;gap:2px}.group-session-waitlist-row small{color:#7a6f80;font-size:.72rem}.group-session-waitlist-book-form{display:flex;justify-content:flex-end}
.group-session-modal-actions{align-items:center;border-top:1px solid #eadff2;display:flex;gap:9px;justify-content:flex-end;padding-top:12px}
.membership-plan-footer{border-top:1px solid #eee6f1;display:flex;flex-wrap:wrap;gap:7px 15px;margin-top:14px;padding-top:12px}.membership-plan-footer span{color:#7c7082;font-size:.7rem;font-weight:800}
.membership-interval-input{display:grid;grid-template-columns:70px 1fr}.membership-interval-input input{border-radius:9px 0 0 9px}.membership-interval-input select{border-left:0;border-radius:0 9px 9px 0}
.membership-benefit-builder{border:1px solid #ded1e4;border-radius:13px;display:grid;gap:14px;padding:15px}.membership-benefit-builder legend{align-items:center;color:#493e4f;display:flex;font-size:.82rem;font-weight:900;gap:8px;padding:0 7px}.membership-benefit-builder legend span{align-items:center;background:#742f90;border-radius:50%;color:#fff;display:inline-flex;height:22px;justify-content:center;width:22px}
.membership-targets label>small{color:#8b7f91;display:block;font-weight:500;margin-top:3px}.membership-checkbox-grid{display:grid;gap:7px;grid-template-columns:repeat(2,minmax(0,1fr));margin-top:7px;max-height:150px;overflow:auto}.membership-checkbox-grid label,.membership-policy-checks label{align-items:center;background:#faf7fb;border:1px solid #eee5f1;border-radius:8px;color:#5f5365;display:flex;font-size:.76rem;font-weight:750;gap:7px;padding:8px}.membership-checkbox-grid-small{grid-template-columns:repeat(3,minmax(0,1fr));max-height:none}.membership-policy-checks{display:grid;gap:8px;grid-template-columns:repeat(3,minmax(0,1fr))}.membership-stripe-note{font-size:.73rem;line-height:1.45;margin:0;text-align:center}
@media(max-width:1100px){.offerings-builder-layout,.membership-builder-layout,.offering-detail-layout{grid-template-columns:1fr}.offering-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.group-session-detail-card .appointment-detail-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:700px){.offerings-compact-grid,.offering-summary-grid{grid-template-columns:1fr}.offering-session-row{grid-template-columns:30px minmax(0,1fr) 60px}.offering-session-place{display:none}.membership-policy-checks,.membership-checkbox-grid-small{grid-template-columns:1fr}.offering-builder-footer{align-items:flex-start;flex-direction:column}.offerings-page-header,.memberships-page-header,.offering-detail-header{align-items:flex-start}.offering-detail-price{text-align:left}.group-session-capacity-card{grid-template-columns:1fr}.group-session-modal-backdrop{padding:8px}.group-session-modal{max-height:calc(100vh - 16px);padding:12px}.group-session-detail-card .appointment-detail-grid{grid-template-columns:1fr}.group-session-roster-table thead{display:none}.group-session-roster-table,.group-session-roster-table tbody,.group-session-roster-table tr,.group-session-roster-table td{display:block;width:100%}.group-session-roster-table tr{border-top:1px solid #e9e1ed;padding:11px 12px}.group-session-roster-table tr:first-child{border-top:0}.group-session-roster-table td{border:0;padding:4px 0;text-align:left!important}.group-session-roster-table td:first-child{min-width:0}.group-session-roster-table td:nth-child(3){min-width:0}.group-session-attendance-form{grid-template-columns:minmax(0,1fr) auto}.group-session-cancel-form{justify-content:flex-end}.group-session-modal-actions{position:sticky;bottom:-12px;background:#fff;padding:10px 0 0}.group-session-section-heading{align-items:flex-start;gap:10px}.group-session-waitlist-row{grid-template-columns:34px minmax(0,1fr)}.group-session-waitlist-row>.badge,.group-session-waitlist-book-form{grid-column:2;width:max-content}}
/* Client portal: group sessions and memberships */
.portal-waitlist-offer{display:flex;align-items:center;justify-content:space-between;gap:24px;border-color:#9fc6b5;background:linear-gradient(135deg,#f4fbf7,#fff)}
.portal-waitlist-offer h2{margin:4px 0 6px}.portal-waitlist-offer p{margin:0;color:var(--muted)}
.portal-group-list,.portal-group-catalog{display:grid;gap:12px}
.portal-group-row{display:grid;grid-template-columns:92px minmax(0,1fr) auto auto;align-items:center;gap:18px;padding:16px;border:1px solid var(--border);border-radius:16px;background:#fff}
.portal-group-row time{display:grid;gap:3px;padding-right:16px;border-right:1px solid var(--border)}.portal-group-row time strong{font-size:17px}.portal-group-row time span,.portal-group-row p{color:var(--muted);font-size:13px}
.portal-group-row h3,.portal-group-card h3,.portal-membership-card h3{margin:3px 0 5px;font-size:19px}.portal-group-row p,.portal-group-card p,.portal-membership-card p{margin:0}
.portal-group-card{position:relative;display:grid;grid-template-columns:110px minmax(0,1fr) 178px;align-items:center;gap:22px;padding:20px;border:1px solid var(--border);border-radius:18px;background:#fff;overflow:hidden}
.portal-group-card::before{content:"";position:absolute;inset:0 auto 0 0;width:5px;background:var(--group-color,#6fa8dc)}
.portal-group-date{display:grid;gap:4px;text-align:center;padding-right:18px;border-right:1px solid var(--border)}.portal-group-date strong{font-size:12px;text-transform:uppercase;letter-spacing:.08em;color:var(--muted)}.portal-group-date b{font-size:20px}.portal-group-date span{font-size:13px;color:var(--muted)}
.portal-group-copy small{display:block;margin-top:9px;color:var(--muted)}
.portal-group-action{display:flex;min-width:0;flex-direction:column;align-items:flex-end;gap:7px;text-align:right}.portal-group-action form,.portal-group-action button{width:100%}.portal-group-action>span:not(.portal-status){font-size:13px;color:var(--muted)}
.portal-membership-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.portal-membership-card{display:flex;min-height:290px;flex-direction:column;gap:18px;padding:22px;border:1px solid var(--border);border-radius:18px;background:#fff}.portal-membership-card.is-owned{border-color:#9fc6b5;background:linear-gradient(145deg,#f7fcf9,#fff 55%)}
.portal-membership-benefits{display:grid;gap:9px}.portal-membership-benefits p{display:flex;gap:9px;align-items:flex-start;font-size:14px;color:var(--muted)}.portal-membership-benefits svg{width:18px;height:18px;flex:0 0 auto;color:#34755c}.portal-membership-benefits strong{color:var(--ink)}
.portal-membership-card footer{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;margin-top:auto;padding-top:16px;border-top:1px solid var(--border)}.portal-membership-card footer>div{display:grid;gap:3px}.portal-membership-card footer>div>strong{font-size:22px}.portal-membership-card footer span{font-size:13px;color:var(--muted)}
.portal-membership-card footer form,.portal-membership-card footer button{min-width:164px}
@media(max-width:900px){.portal-group-card{grid-template-columns:88px minmax(0,1fr)}.portal-group-action{grid-column:1/-1;align-items:stretch}.portal-group-row{grid-template-columns:76px minmax(0,1fr)}.portal-group-row>.portal-status,.portal-group-row>form{grid-column:2}.portal-membership-grid{grid-template-columns:1fr}.portal-waitlist-offer{align-items:stretch;flex-direction:column}}
@media(max-width:620px){.portal-group-card{grid-template-columns:1fr}.portal-group-date{grid-template-columns:auto auto auto;align-items:center;justify-content:start;gap:9px;text-align:left;border-right:0;border-bottom:1px solid var(--border);padding:0 0 14px}.portal-group-row{grid-template-columns:1fr}.portal-group-row time{grid-template-columns:auto auto;justify-content:start;gap:8px;border-right:0;border-bottom:1px solid var(--border);padding:0 0 10px}.portal-group-row>.portal-status,.portal-group-row>form{grid-column:1}.portal-membership-card footer{align-items:stretch;flex-direction:column}.portal-membership-card footer form,.portal-membership-card footer button{width:100%}}
.offering-settings-panel{margin:18px 0}.offering-settings-panel>summary{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:18px 20px;cursor:pointer;list-style:none}.offering-settings-panel>summary::-webkit-details-marker{display:none}.offering-settings-panel>summary span{display:grid;gap:4px}.offering-settings-panel>summary small{color:var(--muted);text-transform:uppercase;letter-spacing:.08em}.offering-settings-panel[open]>summary{border-bottom:1px solid var(--border)}.offering-settings-panel>.offering-builder-form{padding:22px}
.offering-form-checklist{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.offering-form-fieldset{margin:0;padding:16px;border:1px solid var(--border);border-radius:14px}.offering-form-fieldset legend{padding:0 6px;font-weight:700}
.offering-session-menu{position:relative}.offering-session-menu>summary{list-style:none;cursor:pointer}.offering-session-menu>summary::-webkit-details-marker{display:none}.offering-session-menu-card{position:absolute;z-index:25;right:0;top:calc(100% + 8px);width:min(430px,calc(100vw - 48px));padding:18px;border:1px solid var(--border);border-radius:16px;background:#fff;box-shadow:0 18px 55px rgba(24,38,33,.18)}.offering-session-menu-card .offering-builder-form{display:grid;gap:12px}.offering-cancel-session{display:grid;gap:10px;margin-top:16px;padding-top:16px;border-top:1px solid var(--border)}.offering-cancel-session .btn{justify-self:end}.offering-session-row{overflow:visible}
@media(max-width:720px){.offering-form-checklist{grid-template-columns:1fr}.offering-session-menu{grid-column:1/-1}.offering-session-menu-card{position:fixed;inset:72px 16px auto;width:auto;max-height:calc(100vh - 96px);overflow:auto}}
.membership-members-panel{margin-top:20px}.membership-add-member{position:relative}.membership-add-member>summary{list-style:none;cursor:pointer}.membership-add-member>summary::-webkit-details-marker{display:none}.membership-enroll-popover{position:absolute;z-index:20;right:0;top:calc(100% + 8px);display:grid;gap:12px;width:360px;padding:18px;border:1px solid var(--border);border-radius:16px;background:#fff;box-shadow:0 18px 55px rgba(24,38,33,.18)}
.membership-plan-edit{margin-top:14px;border-top:1px solid var(--border);padding-top:12px}.membership-plan-edit>summary{cursor:pointer;list-style:none;text-align:right;color:var(--accent);font-weight:700}.membership-plan-edit>summary::-webkit-details-marker{display:none}.membership-plan-edit>.membership-builder-form{margin-top:12px;padding:16px;border-radius:14px;background:#faf8fc}
.offering-session-menu-card{left:0;right:auto}
.portal-form-stack input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),.portal-form-stack select{height:44px;min-height:44px}.portal-form-actions,.offering-form-actions{justify-content:flex-end}.portal-page-heading>form,.portal-page-heading>form .portal-secondary{margin-left:auto}
@media(max-width:620px){.membership-enroll-popover{position:fixed;inset:84px 16px auto;width:auto}}

/* Management tables and modal creation flow */
.management-page-header{margin-bottom:20px}
.management-table-panel{overflow:hidden;padding:0}
.management-table-wrap{overflow-x:auto}
.management-table{border-collapse:collapse;min-width:920px;width:100%}
.management-table th{background:#faf8fb;border-bottom:1px solid #e7deeb;color:#786b7e;font-size:.68rem;font-weight:900;letter-spacing:.08em;padding:11px 16px;text-align:left;text-transform:uppercase;white-space:nowrap}
.management-table td{border-bottom:1px solid #eee7f1;color:#514757;font-size:.82rem;padding:14px 16px;vertical-align:middle}
.management-table tbody tr:last-child td{border-bottom:0}
.management-table-row{cursor:pointer;transition:background-color .15s ease}
.management-table-row:hover,.management-table-row:focus{background:#fbf8fc;outline:0}
.management-table td>small{color:#807486;display:block;font-size:.7rem;margin-top:4px}
.management-name-link{align-items:center;color:inherit;display:flex;gap:11px;min-width:225px;text-decoration:none}
.management-name-link>span{display:grid;gap:4px;min-width:0}
.management-name-link strong{color:#3d3342;font-size:.88rem}
.management-name-link small{color:#817587;display:block;font-size:.72rem;max-width:340px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.management-color-dot{background:var(--offering-color,#6fa8dc);border-radius:50%;box-shadow:0 0 0 4px color-mix(in srgb,var(--offering-color,#6fa8dc) 18%,white);display:block;flex:0 0 auto;height:10px;width:10px}
.management-color-dot.membership-dot{--offering-color:#7a3892}
.management-table td:nth-last-child(2),.management-table th:nth-last-child(2){white-space:nowrap}
.management-row-arrow{color:#8b5a9f;text-align:right;width:34px}.management-row-arrow .ui-icon{height:17px;width:17px}
.management-benefit-summary{display:grid;gap:5px;min-width:230px}.management-benefit-summary span{align-items:center;display:flex;font-size:.73rem;gap:6px}.management-benefit-summary .ui-icon{color:#31805e;height:14px;width:14px}
.management-edit-button{min-height:34px;padding:6px 12px}
.management-empty{align-items:center;display:flex;flex-direction:column;gap:5px;justify-content:center;min-height:180px;text-align:center}.management-empty span{color:#817587}
.management-modal-backdrop{z-index:90;background:rgba(31,18,42,.5);backdrop-filter:blur(3px)}
.management-create-modal{width:min(820px,100%);border-color:#d9c9e8;box-shadow:0 28px 80px rgba(32,16,48,.34)}
.membership-create-modal{width:min(900px,100%)}
.management-dialog-form{padding:20px 22px 0}
.management-dialog-form>.management-dialog-header{position:sticky;top:-20px;z-index:4;margin:-20px -22px 0;padding:14px 68px 14px 22px;border-bottom:1px solid #eadff2;background:linear-gradient(180deg,#fbf7ff 0%,#f1e7fb 100%)}
.management-dialog-header>div>span{font-size:.7rem;letter-spacing:.08em}.management-dialog-header h2{font-size:1.22rem}
.management-form-section{display:grid;gap:14px}
.management-dialog-actions{position:sticky;bottom:-24px;z-index:4;margin:3px -22px 0;padding:14px 22px;border-top:1px solid #eadff2;background:#fff;box-shadow:0 -12px 24px rgba(248,250,252,.9)}
.management-edit-dialog{width:min(600px,100%)}.management-edit-dialog .membership-policy-checks{grid-template-columns:repeat(2,minmax(0,1fr))}
@media(max-width:760px){.management-page-header{align-items:flex-start}.management-modal-backdrop{padding:12px}.management-create-modal{max-height:calc(100vh - 24px)}.management-dialog-form{max-height:calc(100vh - 24px);padding:18px 18px 0}.management-dialog-form>.management-dialog-header{top:-18px;margin:-18px -18px 0;padding:13px 62px 13px 18px}.management-dialog-actions{bottom:-24px;margin-left:-18px;margin-right:-18px;padding:12px 18px}.management-edit-dialog .membership-policy-checks{grid-template-columns:1fr}}
@media(max-width:480px){.membership-create-modal .membership-benefit-builder{padding:12px}}

/* Restored client calendar and appointment management controls */
.portal-v2 dialog.portal-modal > .portal-dialog-actions.portal-appointment-footer {
    align-items: flex-end;
    border-top: 1px solid #eee7f1;
    display: flex;
    flex-wrap: nowrap;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 16px;
    margin-top: 22px;
    padding-bottom: 0;
    padding-top: 18px;
    position: relative;
}

.portal-v2 .portal-calendar-chooser {
    flex: 0 0 auto;
    margin: 0;
    min-width: 0;
    position: relative;
}

.portal-v2 .portal-calendar-chooser > summary {
    list-style: none;
    min-height: 42px;
    white-space: nowrap;
    width: auto;
}

.portal-v2 .portal-calendar-chooser > summary::-webkit-details-marker {
    display: none;
}

.portal-v2 .portal-calendar-chooser[open] > summary {
    background: #e7ddec;
}

.portal-v2 .portal-calendar-options {
    background: #faf8fb;
    border: 1px solid #ebe3ef;
    border-radius: 14px;
    bottom: calc(100% + 10px);
    box-shadow: 0 20px 48px rgba(41, 22, 51, .18);
    display: grid;
    gap: 8px;
    left: 0;
    margin: 0;
    padding: 14px;
    position: absolute;
    width: min(330px, calc(100vw - 64px));
    z-index: 6;
}

.portal-v2 .portal-calendar-options-heading {
    display: grid;
    gap: 3px;
    padding: 1px 3px 7px;
}

.portal-v2 .portal-calendar-options-heading span {
    color: var(--portal-muted);
    font-size: 12px;
}

.portal-v2 .portal-calendar-option {
    align-items: center;
    background: #fff;
    border: 1px solid #e9e1ed;
    border-radius: 11px;
    color: var(--portal-ink);
    display: flex;
    gap: 12px;
    justify-content: space-between;
    padding: 12px 13px;
    text-decoration: none;
}

.portal-v2 .portal-calendar-option:hover {
    border-color: #cdb8d8;
    box-shadow: 0 8px 18px rgba(69, 34, 85, .08);
}

.portal-v2 .portal-calendar-option span {
    display: grid;
    gap: 2px;
}

.portal-v2 .portal-calendar-option small {
    color: var(--portal-muted);
}

.portal-v2 .portal-calendar-option .arrow-forward {
    color: #6b347f;
}

.portal-v2 .portal-manage-appointment {
    flex: 0 0 auto;
    margin-left: auto;
    min-width: 0;
    position: relative;
}

.portal-v2 .portal-manage-appointment > summary {
    list-style: none;
    min-height: 42px;
    white-space: nowrap;
}

.portal-v2 .portal-manage-appointment > summary::-webkit-details-marker {
    display: none;
}

.portal-v2 .portal-manage-appointment > summary .ui-icon:last-child {
    transition: transform .18s ease;
}

.portal-v2 .portal-manage-appointment[open] > summary {
    background: #e7ddec;
}

.portal-v2 .portal-manage-appointment[open] > summary .ui-icon:last-child {
    transform: rotate(180deg);
}

.portal-v2 .portal-manage-menu {
    background: #fff;
    border: 1px solid #e7ddeb;
    border-radius: 14px;
    bottom: calc(100% + 10px);
    box-shadow: 0 20px 48px rgba(41, 22, 51, .18);
    display: grid;
    gap: 8px;
    padding: 10px;
    position: absolute;
    right: 0;
    width: min(310px, calc(100vw - 64px));
    z-index: 6;
}

.portal-v2 .portal-manage-menu > details {
    flex: none;
    min-width: 0;
    width: 100%;
}

.portal-v2 .portal-manage-menu > details > summary {
    justify-content: flex-start;
    min-height: 42px;
    width: 100%;
}

.portal-v2 .portal-manage-menu > details[open] > summary {
    margin-bottom: 10px;
}

.portal-v2 .portal-manage-menu .portal-form-stack {
    background: #faf8fb;
    border-radius: 11px;
    padding: 12px;
}
@media (max-width: 680px) {
    .portal-v2 .portal-calendar-chooser {
        margin: 0;
    }

    .portal-v2 dialog.portal-modal > .portal-dialog-actions.portal-appointment-footer {
        gap: 8px;
    }

    .portal-v2 .portal-calendar-chooser > summary,
    .portal-v2 .portal-manage-appointment > summary {
        padding-left: 12px;
        padding-right: 12px;
    }
}
