/* Shared operational scale. Existing themes, brand and page structure retained. */


/* Client form — match the shared lilac primary action. */
#cform .modalfoot .btn.primary{
  background:#5b55e7!important;
  border-color:#5b55e7!important;
}
#cform .modalfoot .btn.primary:hover{
  background:#4f49d8!important;
  border-color:#4f49d8!important;
}
/* Clienti — compact voucher indicator and notes. */
.client-identity{min-width:0}.client-name-row{display:flex;align-items:center;gap:9px;min-width:0}.client-name-row h3{min-width:0}
.client-voucher-dot{position:relative;display:inline-block;flex:0 0 9px;width:9px;height:9px;border-radius:50%;background:#21b77a;box-shadow:0 0 0 0 rgba(33,183,122,.28);animation:clientVoucherPulse 2.8s ease-in-out infinite;cursor:help}
.client-preference-dot{position:relative;display:inline-block;flex:0 0 9px;width:9px;height:9px;border-radius:50%;background:#f2ad1c;box-shadow:0 0 0 0 rgba(242,173,28,.28);animation:clientPreferencePulse 2.8s ease-in-out infinite;cursor:help}
.client-debt-dot{position:relative;display:inline-block;flex:0 0 9px;width:9px;height:9px;border-radius:50%;background:var(--ds-danger);box-shadow:0 0 0 0 color-mix(in srgb,var(--ds-danger) 28%,transparent);animation:clientDebtPulse 2.8s ease-in-out infinite;cursor:help}
@keyframes clientPreferencePulse{0%,65%,100%{box-shadow:0 0 0 0 rgba(242,173,28,0);transform:scale(1)}78%{box-shadow:0 0 0 5px rgba(242,173,28,.14);transform:scale(1.08)}}
@keyframes clientVoucherPulse{0%,65%,100%{box-shadow:0 0 0 0 rgba(33,183,122,0);transform:scale(1)}78%{box-shadow:0 0 0 5px rgba(33,183,122,.12);transform:scale(1.08)}}
@keyframes clientDebtPulse{0%,65%,100%{box-shadow:0 0 0 0 color-mix(in srgb,var(--ds-danger) 0%,transparent);transform:scale(1)}78%{box-shadow:0 0 0 5px color-mix(in srgb,var(--ds-danger) 14%,transparent);transform:scale(1.08)}}
@media(prefers-reduced-motion:reduce){.client-voucher-dot,.client-preference-dot,.client-debt-dot{animation:none}}

/* Clienti — step 4: visit summary. */
.client-visit-stats{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-top:auto;padding:0 0 3px;color:#7888a3;font-size:12.5px;line-height:1.35;transform:translateY(0)}
.client-card .client-visit-stats{margin-top:auto}
.client-card .client-visit-stats + .client-card-actions{margin-top:0}
.client-visit-stats span:last-child{text-align:right}.client-visit-stats strong{color:#3b4960;font-weight:600}

/* Clienti — step 3: cards only. */
.clients-cards{grid-template-columns:repeat(3,minmax(0,1fr));gap:22px 24px;align-items:stretch}
.client-card{min-width:0;min-height:300px;padding:22px 22px 18px;border:1px solid #dfe5ee;border-radius:17px;background:var(--surface);box-shadow:0 2px 8px rgba(27,39,61,.07)}
.client-card .clienthead{display:flex;align-items:center;gap:14px;min-height:50px}
.client-card .clienthead>div{min-width:0}.client-card .clienthead h3{margin:0 0 3px;font-size:18px;line-height:1.25;letter-spacing:-.25px;color:var(--ink)}
.client-card .clienthead small{font-size:13px;font-style:italic;color:#59667d}
.client-card .client-phone{display:flex;align-items:center;gap:7px}.client-card .client-phone svg{width:16px;height:16px;flex:0 0 16px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.client-card .client-avatar{display:grid;place-items:center;flex:0 0 50px;width:50px;height:50px;border-radius:16px;font-size:15px;font-weight:650}
.client-avatar-0{background:#eee9ff!important;color:var(--violet-text)!important}.client-avatar-1{background:#e0f4ff!important;color:#1872a8!important}.client-avatar-2{background:#e7ebff!important;color:#4f55c9!important}.client-avatar-3{background:#fff1c9!important;color:#b65b16!important}.client-avatar-4{background:#d8f8f1!important;color:#187b72!important}.client-avatar-5{background:#ffe4e7!important;color:#bd3948!important}
.client-card .card-divider{margin:16px 0 13px;border-color:#e7ebf2}
.client-treatment-row{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:30px;margin-bottom:8px}
.client-treatment-row small{font-size:13px;color:#8b9bb4;white-space:nowrap}
.client-treatment-tag{display:inline-flex;align-items:center;justify-content:center;max-width:68%;padding:4px 10px;border:1px solid #e2e8ef;border-radius:9px;background:#f4f7fa;color:#33435b;font-size:12.5px;font-weight:600;line-height:1.2;text-align:center}
.client-card>.sub{margin:6px 0 8px;font-size:13px;line-height:1.45}
.client-card>.badge{align-self:flex-start;margin:4px 0 8px}
.client-card-actions{display:grid!important;grid-template-columns:1.1fr .85fr 1.05fr;gap:8px!important;margin-top:0;padding-top:10px;border-top:1px solid #e7ebf2}
.client-card-actions .btn{width:100%;min-width:0;min-height:40px;padding:8px 10px!important;white-space:nowrap;font-size:13px!important}
.client-card-actions .btn.primary{background:#0d1830;border-color:#0d1830;color:#fff}
.client-booking-icon{width:17px;height:17px;flex:0 0 17px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.client-card-actions .btn.primary:hover{background:#162440;border-color:#162440}
@media(max-width:1200px){.clients-cards{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:800px){.clients-cards{grid-template-columns:1fr}.client-card{min-height:280px}}
@media(max-width:420px){.client-card-actions{grid-template-columns:1fr}.client-treatment-row{align-items:flex-start;flex-direction:column}.client-treatment-tag{max-width:100%}}

/* Clienti — step 2: search,filters and sorting only. */
.clients-searchbar{display:flex;align-items:center;gap:20px;margin:0 0 26px;padding:15px 16px;background:var(--surface);border:1px solid var(--line);border-radius:18px;box-shadow:0 2px 8px rgba(25,35,55,.05)}
.clients-search{position:relative;display:block;flex:1 1 380px;min-width:260px}
.clients-search svg{position:absolute;left:16px;top:50%;width:20px;height:20px;transform:translateY(-50%);fill:none;stroke:#8fa1bd;stroke-width:1.8;stroke-linecap:round;pointer-events:none}
.clients-search input[type=search]{width:100%;min-height:46px!important;padding:10px 16px 10px 47px!important;border:1px solid #dbe3ef;border-radius:12px;background:#f8fbff;color:var(--ink);font-size:14px!important;outline:none}
.clients-search input[type=search]::placeholder{color:#94a4bd}
.clients-search input[type=search]:focus{border-color:#9b83ff;box-shadow:0 0 0 3px rgba(124,87,255,.1)}
.clients-filters{display:flex;align-items:center;justify-content:flex-end;gap:9px;flex:0 0 auto}
.client-filter{display:inline-flex;align-items:center;gap:8px;min-height:40px;padding:8px 14px;border:1px solid #dbe3ef;border-radius:12px;background:var(--surface);color:#40506a;font:inherit;font-size:13px;white-space:nowrap;cursor:pointer}
.client-filter:hover{background:#f8f9ff}
.client-filter.active{border-color:#ded5ff;background:#f5f2ff;color:#6846f5;font-weight:600}
.client-filter.debt-filter.active{border-color:color-mix(in srgb,var(--ds-danger) 35%,transparent);background:var(--ds-danger-bg);color:var(--danger-text)}

/* Scheda cliente — finestra più larga per leggere l'elenco pagamenti,colonne allineate,righe separate da linee sottili; a finestra stretta ogni riga diventa una scheda impilata. */
#modal:has(.client-history){width:min(860px,calc(100vw - 48px));max-width:none;max-height:calc(100dvh - 48px);overflow-y:auto}
@media(max-width:700px){
 #modal:has(.client-history){width:calc(100vw - 24px)}
}
.filter-dot{display:inline-block;width:7px;height:7px;border-radius:50%}.voucher-dot{background:#22b983}.preference-dot{background:#f2ad1c}.debt-dot{background:var(--ds-danger)}
.clients-filter-divider{width:1px;height:32px;margin:0 1px;background:#e3e8f0}
.clients-sort select{width:auto;min-width:150px;min-height:40px!important;padding:8px 12px!important;border:1px solid #dbe3ef!important;border-radius:12px!important;background:var(--surface);color:#40506a;font-size:13px!important;cursor:pointer}
.clients-empty{grid-column:1/-1}
@media(max-width:1200px){.clients-searchbar{align-items:stretch;flex-direction:column}.clients-filters{justify-content:flex-start;flex-wrap:wrap}.clients-search{flex-basis:auto;width:100%}}
@media(max-width:700px){.clients-searchbar{padding:12px;border-radius:14px}.clients-search{min-width:0}.clients-filters{gap:7px}.client-filter{padding:8px 10px}.clients-filter-divider{display:none}.clients-sort{width:100%}.clients-sort select{width:100%}}

/* Clienti — step 1: page heading only. */
.clients-heading{display:flex;align-items:center;justify-content:space-between;gap:20px 28px;flex-wrap:wrap;margin-bottom:26px}
.clients-heading-copy{flex:1 1 540px;min-width:0}
.clients-heading-title{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.clients-heading-title h1{margin:0;font-size:28px;line-height:1.2;letter-spacing:-1px;color:var(--ink)}
.clients-heading-count{display:inline-flex;align-items:center;padding:3px 10px;border:1px solid #e9e3ff;border-radius:999px;background:#f5f2ff;color:var(--violet-text);font-size:13px;font-weight:500;line-height:1.25;white-space:nowrap}
.clients-heading-copy p{margin:7px 0 0;color:#59667d;font-size:16px;line-height:1.5}
.clients-heading .btn.clients-heading-add{display:inline-flex;align-items:center;justify-content:center;gap:9px;flex-shrink:0;min-height:40px;padding:9px 18px;border:1px solid var(--violet);border-radius:12px;background:var(--violet);color:#fff;font-size:15px;font-weight:500;line-height:1.35;box-shadow:0 3px 7px rgba(124,87,255,.18)}
.clients-heading .btn.clients-heading-add:hover{background:var(--violet-hover);border-color:var(--violet-hover);box-shadow:0 4px 10px rgba(124,87,255,.24)}
.clients-heading .btn.clients-heading-add:focus-visible{outline:3px solid #ac95ff;outline-offset:3px}
.clients-heading-add svg{flex-shrink:0}
@media(max-width:700px){.clients-heading{gap:16px;margin-bottom:23px}.clients-heading-copy{flex-basis:100%}.clients-heading-title h1{font-size:26px}.clients-heading-copy p{font-size:14px}}

:root{--muted:#62656c;--line:#dde1e2;--soft:color-mix(in srgb,var(--accent) 22%,white);--control-radius:10px}
body{color:var(--ink)}p,small,.sub,.eyebrow,.card p,.card small,.home-person p,.home-person small,.metric-title,.metric-baseline,.home-intro p,.home-date,.service-bottom span{color:var(--muted)}
.btn,.textbtn,.control-button,.actions button,.card .btn{font-size:14px;min-height:40px;border-radius:var(--control-radius)}.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;white-space:normal;line-height:1.4}.btn:not(.primary){background:var(--surface);border-color:var(--line);color:var(--ink)}.btn:not(.primary):hover{background:var(--soft)}.btn.danger,.textbtn.danger{color:#ac3b32}.textbtn:hover{text-decoration:underline;text-underline-offset:3px}
input:not([type=radio]):not([type=checkbox]):not(.enhanced-native),select:not(.enhanced-native),textarea,.control-button{min-height:46px;line-height:1.4;font-size:16px;border:1px solid var(--line);border-radius:var(--control-radius);background:var(--surface);color:var(--ink);padding:10px 12px;box-sizing:border-box}select:not(.enhanced-native){appearance:auto;width:100%}label{line-height:1.4}.fields .full{grid-column:1/-1}.fields p.full{margin:0}.booking-summary{padding:12px;background:var(--soft);border-radius:10px;color:var(--ink)}
.card,.panel,.home-card,.home-metric{border-color:var(--line)}.card{padding:20px;display:flex;flex-direction:column;align-items:stretch}.card .card-actions{margin-top:auto;padding-top:16px;gap:8px}.card h3{font-size:18px}.card-divider{margin:14px 0;border-color:var(--line)}.clienthead .avatar{height:42px;width:42px}.service-description{min-height:0}.service-bottom{margin:16px 0;justify-content:flex-start;gap:20px}.service-bottom b{font-size:23px}.service-bottom span{font-size:16px}.skill-tags span{border:0;border-radius:5px;background:var(--soft);font-size:14px}.large-avatar{width:44px;height:44px}.archive-heading{margin-top:28px;padding-top:20px}.card .value{font-size:30px;margin:16px 0 6px}.note-preview{margin-bottom:6px}.badge.neutral{background:var(--soft);color:var(--muted)}
aside{padding:22px 16px;scrollbar-width:thin}#nav{gap:3px;margin-top:22px}#nav button{padding:12px 14px;gap:18px;min-height:44px}.sidefoot{margin-top:auto;padding-top:22px}.brand-tagline{font-size:15px}
main{padding:24px 30px 30px}.topline{margin-bottom:22px}.topline h1,.home-intro h1{font-size:32px;line-height:1.2}.topline p,.home-intro p{font-size:16px}.home-intro{margin-bottom:18px}.home-metric{min-height:108px;padding:15px;gap:14px}.metric-icon{width:44px;height:44px}.metric-body strong{font-size:28px}.metric-title{font-size:14px}.home-view #privacy{display:inline-flex}.header-tools .iconbutton{min-width:40px;min-height:40px}.global-search-wrap input{padding-left:42px!important;font-size:14px!important;min-height:40px!important}.home-avatar,.avatar{background:var(--accent);color:var(--brand)}.home-appointment{grid-template-columns:58px 44px minmax(0,1fr) 100px 40px 68px;gap:10px;min-height:78px;padding:12px 0}.row-icon{width:auto;min-height:40px;gap:4px;letter-spacing:0}.row-icon span{font-size:12px}.home-person small{font-size:13px}.home-status{font-size:13px}.home-appointment-list{min-width:0}.calendar-view .home-appointment{margin:0 18px}.new-appointment-split{box-shadow:none}.new-appointment-split .btn{border-radius:10px;min-height:46px}.next-inner{border:1px solid var(--line)}.day-number{min-width:36px;min-height:36px}.day-number{margin-bottom:3px}.weekday{padding:10px;font-size:12px}.settings-help p,.settings-help small{font-size:14px;line-height:1.55}.settings-panel{padding:24px}.settings-panel form>label{margin-top:18px}.settings-help .sub{margin-top:12px}.settings-help .section-label{margin-top:10px}.report-definition{font-size:14px;margin:0 0 18px}.report-navigation{display:flex;gap:8px;flex-wrap:wrap}.report-table-wrap th,.report-table-wrap td{padding:13px 8px!important;font-size:14px}.report-table-wrap th[scope=row]{font-weight:400;text-align:left}.number{text-align:right;font-variant-numeric:tabular-nums}.detailed-report table{width:100%}.close{width:40px;height:40px}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.data-banner{position:sticky;top:0;z-index:30;padding:12px 20px;background:var(--surface);color:var(--ink);border-bottom:1px solid var(--line)}.data-banner .btn{margin-left:10px}#save-status{font-size:13px;color:var(--muted)}.proposal-status{padding:9px;background:var(--soft);border-radius:8px}
@media(max-width:1200px){.home-columns{grid-template-columns:1fr}.home-appointment{grid-template-columns:58px 44px minmax(0,1fr) 100px 40px 68px}.topline{flex-wrap:wrap}.home-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:700px){main{padding:20px 16px}.topline h1,.home-intro h1{font-size:28px}.topline .btn{font-size:14px}.header-tools{gap:4px}.header-tools #privacy{display:inline-flex}.app-header{gap:8px;padding:10px 12px;height:auto}.header-tools .iconbutton{min-width:36px;min-height:40px}.home-metric{padding:12px;gap:8px}.metric-title{font-size:14px}.metric-icon{display:none}.home-appointment{grid-template-columns:48px minmax(0,1fr) 40px 65px;gap:8px}.home-appointment>.home-avatar{display:none}.home-person{grid-column:2;grid-row:1}.home-time{grid-column:1;grid-row:1;font-size:14px}.home-appointment>.row-icon:nth-last-child(2){grid-column:3;grid-row:1}.home-appointment>.row-icon:last-child{grid-column:4;grid-row:1}.home-status{grid-column:2;grid-row:2}.home-person p{font-size:14px}.home-person small{font-size:13px}.agenda-head .control-button{font-size:14px;white-space:normal}.cards{grid-template-columns:1fr}.report-summary{grid-template-columns:1fr}.fields{grid-template-columns:1fr}.fields .full{grid-column:1}.modalfoot{flex-wrap:wrap}.settings-panel{padding:18px}.home-intro>.new-appointment-split{width:100%}.calendar-view .home-appointment{margin:0 12px}.quick-grid button{font-size:14px}.global-search-wrap{min-width:0}aside{padding:18px 16px 10px}}
/* Reception controls: keep frequent actions obvious and small summaries compact. */
.metric-icon{display:grid!important;place-items:center;padding:0!important;flex:0 0 44px;line-height:1}.metric-icon svg{display:block;margin:0;overflow:visible}.home-metrics{grid-template-columns:repeat(4,minmax(0,1fr))}.home-intro{flex-wrap:wrap}.compact-gift{margin-left:auto;min-height:36px!important;font-weight:500}.reception-clock{font-size:13px;margin:5px 0 10px;font-variant-numeric:tabular-nums}.label-line{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:8px}.label-line .new-client-button{font-size:15px;min-height:44px;padding:10px 16px}.availability-hours button,.availability-minutes button{height:auto;min-height:56px;padding:8px 4px}.availability-hours small,.availability-minutes small{display:block;font-size:11px;line-height:1.4;color:inherit}.availability-minutes{grid-template-columns:repeat(3,minmax(0,1fr))!important}.time-picker-grid button:disabled{opacity:.65;text-decoration:line-through;cursor:not-allowed;border-style:dashed}.btn:disabled{opacity:.55;cursor:not-allowed}.booking-summary.unavailable{border:1px solid #b8463f}.team-contact{overflow-wrap:anywhere;font-size:14px}.archive-button{margin-top:16px}
@media(max-width:700px){.home-metrics{grid-template-columns:1fr}.compact-gift{margin-left:0}.label-line{flex-wrap:wrap}.metric-icon{display:grid!important}.availability-hours{grid-template-columns:repeat(4,minmax(0,1fr))!important}}
.home-metric .metric-icon{width:44px!important;height:44px!important;min-width:44px;aspect-ratio:1;flex:0 0 44px}.home-metric .metric-icon svg{width:26px;height:26px;transform:none}.metric-body strong{white-space:nowrap;line-height:1.2}

/* Home KPI cards: slightly larger,matching the supplied reference proportions. */
@media(min-width:1201px){
  .home-metric{min-height:142px;padding:19px 18px;gap:14px}
  .home-metric .metric-icon{width:48px!important;height:48px!important;min-width:48px;flex:0 0 48px}
  .home-metric .metric-icon svg{width:27px;height:27px}
  .metric-body{padding-top:1px}
  .metric-title{font-size:14px}
  .metric-body strong{font-size:30px;margin:4px 0 7px}
  .metric-baseline{font-size:13px}
}

/* Clienti — compact cards after removing notes. */
.client-card{min-height:255px}
.client-treatment-row{margin-bottom:4px}
.client-visit-stats{padding-top:10px}
@media(max-width:800px){.client-card{min-height:245px}}

/* Clienti — top breadcrumb. */
.header-location:has(.header-home-link){display:flex;align-items:center}
.header-location #crumb:has(.header-home-link){display:flex;align-items:center;gap:13px;font-size:14px;line-height:1.2}
.header-home-link{appearance:none;padding:0;border:0;background:transparent;color:#91a0b8;font:inherit;font-weight:500;line-height:1.2;cursor:pointer}
.header-home-link:hover{color:var(--ink)}
.header-crumb-chevron{display:inline-flex;align-items:center;color:#c5cedb;font-size:21px;font-weight:300;line-height:1;transform:translateY(-1px)}
.header-current-page{display:inline-flex;align-items:center;color:var(--ink);font-weight:650;line-height:1.2}

/* Topbar — step 1: refined global search only. */
body:not(.home-view) .global-search-wrap{width:min(35vw,360px);max-width:360px}
body:not(.home-view) .global-search-wrap input{height:36px;padding:7px 14px 7px 42px;border:1px solid #dbe4f0;border-radius:14px;background:#f8fbff;color:var(--ink);font-size:12px;box-shadow:0 1px 2px rgba(30,45,68,.025)}
body:not(.home-view) .global-search-wrap input::placeholder{color:#94a5bf;opacity:1}
body:not(.home-view) .global-search-wrap .search-symbol{margin-left:14px;width:17px;height:17px;color:#8da1bd}
body:not(.home-view) .global-search-wrap .search-symbol svg{width:17px;height:17px;stroke-width:1.7}

/* Topbar — step 2: refined utility icons only. */
body:not(.home-view) .header-tools{gap:9px;align-items:center;padding-left:18px;margin-left:2px;border-left:1px solid #e1e7f0}
body:not(.home-view) .header-tools .iconbutton{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;min-width:32px;min-height:32px;padding:0;border-radius:9px;color:#6f819d}
body:not(.home-view) .header-tools .iconbutton svg{width:20px;height:20px;stroke-width:1.65}
body:not(.home-view) .header-tools .iconbutton:hover{background:#f6f8fc;color:#455772}
body:not(.home-view) #notification-button i{top:3px;right:3px;width:7px;height:7px;background:#ed4965;border:1.5px solid var(--surface)}

/* Clienti — card/list view switcher. */
.clients-view-actions{display:flex;align-items:center;gap:14px;margin-left:auto}
.clients-list{display:flex;flex-direction:column;gap:10px}
.clients-list .client-list-row{display:grid;grid-template-columns:minmax(230px,1.2fr) minmax(210px,1fr) minmax(250px,1.1fr) auto;align-items:center;gap:20px;min-height:82px;padding:14px 18px}
.clients-list .client-list-row .clienthead{min-height:0}
.clients-list .client-list-row .card-divider{display:none}
.clients-list .client-list-row .client-treatment-row{margin:0;justify-content:flex-start}
.clients-list .client-list-row .client-visit-stats{margin:0;padding:0;transform:none}
.clients-list .client-list-row .client-card-actions{display:grid!important;grid-template-columns:repeat(3,auto);min-width:280px;margin:0;padding:0 0 0 16px;border-top:0;border-left:1px solid #e7ebf2}
@media(max-width:1050px){.clients-list .client-list-row{grid-template-columns:1fr 1fr}.clients-list .client-list-row .client-card-actions{grid-column:1/-1;border-left:0;border-top:1px solid #e7ebf2;padding:10px 0 0}.clients-view-actions{gap:9px}}
@media(max-width:700px){.clients-heading{align-items:flex-start}.clients-view-actions{width:100%;margin-left:0;justify-content:space-between}.clients-list .client-list-row{grid-template-columns:1fr}.clients-list .client-list-row .client-card-actions{grid-column:auto;min-width:0}}

/* Clienti — compact density experiment,step 1. */
body:not(.home-view):has(.clients-heading) main{padding:20px 26px 26px}
body:not(.home-view):has(.clients-heading) .clients-heading{margin-bottom:21px}
body:not(.home-view):has(.clients-heading) .clients-searchbar{margin-bottom:22px;padding:12px 14px}
body:not(.home-view):has(.clients-heading) .clients-cards{gap:15px 18px}
body:not(.home-view):has(.clients-heading) .client-card{min-height:238px;padding:18px 18px 15px}
body:not(.home-view):has(.clients-heading) .client-card .clienthead{gap:12px;min-height:46px}
body:not(.home-view):has(.clients-heading) .client-card .clienthead h3{font-size:16.5px}
body:not(.home-view):has(.clients-heading) .client-card .clienthead small{font-size:12px}
body:not(.home-view):has(.clients-heading) .client-card .card-divider{margin:13px 0 11px}
body:not(.home-view):has(.clients-heading) .client-visit-stats{padding-top:7px;font-size:12px}
body:not(.home-view):has(.clients-heading) .client-card-actions{padding-top:8px}

/* Clienti — sorting control aligned to filter pills. */
body:not(.home-view):has(.clients-heading) .clients-sort{
  display:flex;
  align-items:center;
  min-height:40px;
  border:1px solid #dbe3ef;
  border-radius:12px;
  background:var(--surface);
  overflow:hidden;
}
body:not(.home-view):has(.clients-heading) .clients-sort select{
  min-height:38px!important;
  margin:0!important;
  padding:8px 14px!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  box-shadow:none!important;
  line-height:1.2;
}

/* Clienti — compact density experiment: upper section. */
body:not(.home-view):has(.clients-heading) .clients-heading{
  gap:16px 24px;
  margin-bottom:18px;
}
body:not(.home-view):has(.clients-heading) .clients-heading-title{gap:10px}
body:not(.home-view):has(.clients-heading) .clients-heading-title h1{
  font-size:26px;
  letter-spacing:-.8px;
}
body:not(.home-view):has(.clients-heading) .clients-heading-copy p{
  margin-top:5px;
  font-size:13.5px;
  line-height:1.4;
}
body:not(.home-view):has(.clients-heading) .clients-heading-add{
  min-height:38px;
  padding:8px 14px;
}

/* Clienti — compact search/filter bar to match reference density. */
body:not(.home-view):has(.clients-heading) .clients-searchbar{
  gap:16px;
  padding:10px 12px;
  border-radius:16px;
}
body:not(.home-view):has(.clients-heading) .clients-search input[type=search]{
  min-height:38px!important;
  padding-top:7px!important;
  padding-bottom:7px!important;
  font-size:12.5px!important;
}
body:not(.home-view):has(.clients-heading) .clients-search svg{
  width:18px;
  height:18px;
}
body:not(.home-view):has(.clients-heading) .clients-filters{gap:8px}
body:not(.home-view):has(.clients-heading) .client-filter{
  min-height:38px;
  padding:7px 12px;
  font-size:12.5px;
}
body:not(.home-view):has(.clients-heading) .clients-filter-divider{height:28px}
body:not(.home-view):has(.clients-heading) .clients-sort{min-height:38px}
body:not(.home-view):has(.clients-heading) .clients-sort select{
  min-height:36px!important;
  padding:7px 12px!important;
  font-size:12.5px!important;
}

/* Clienti — align the search field with the filter controls. */
body:not(.home-view):has(.clients-heading) .clients-search{
  transform:none;
}

/* Clienti — optical centering inside search field. */
body:not(.home-view):has(.clients-heading) .clients-search input[type=search]{
  transform:translateY(1px);
}
body:not(.home-view):has(.clients-heading) .clients-search svg{
  top:calc(50% + 1px);
  transform:translateY(-50%);
}

/* Clienti — force search icon visible above native search input. */
body:not(.home-view):has(.clients-heading) .clients-search svg{
  display:block!important;
  position:absolute!important;
  left:16px!important;
  top:50%!important;
  z-index:3;
  width:18px!important;
  height:18px!important;
  transform:translateY(-50%)!important;
  fill:none!important;
  stroke:#8fa1bd!important;
  pointer-events:none;
}
body:not(.home-view):has(.clients-heading) .clients-search input[type=search]{
  padding-left:48px!important;
}

/* Clienti — final optical alignment for search icon. */
body:not(.home-view):has(.clients-heading) .clients-search svg{
  top:calc(50% + 1px)!important;
}

/* Clienti — unified optical alignment inside search control. */
body:not(.home-view):has(.clients-heading) .clients-search{
  display:flex;
  align-items:center;
}
body:not(.home-view):has(.clients-heading) .clients-search input[type=search]{
  transform:none!important;
  margin:0!important;
  padding-top:0!important;
  padding-bottom:0!important;
  height:38px!important;
  line-height:38px!important;
}
body:not(.home-view):has(.clients-heading) .clients-search svg{
  top:50%!important;
  transform:translateY(-50%)!important;
}

/* Global white-theme surfaces — approved palette. */
body:not(.dark-mode){
  --page:#f8fafc;
  background:#f8fafc;
}
body:not(.dark-mode) .workspace{
  background:#f8fafc;
}
body:not(.dark-mode) .app-header,body:not(.dark-mode) .clients-searchbar{
  background:#f6f8f9;
}

/* Clienti redesign — step 1: keep one search only. */
body:not(.home-view):has(.clients-heading) .app-header .global-search-wrap{
  display:none;
}

/* Clienti redesign — step 2: remove legacy top header entirely. */
body:not(.home-view):has(.clients-heading) .app-header{
  display:none;
}
body:not(.home-view):has(.clients-heading) .clients-view-actions{
  gap:0;
}

/* Clienti redesign — step 4: flatter,cleaner search/filter toolbar. */
body:not(.home-view):has(.clients-heading) .clients-searchbar{
  padding:10px 14px;
  border:1px solid #e3e9f1;
  border-radius:14px;
  background:#fff;
  box-shadow:0 3px 10px rgba(30,45,68,.035);
}
body:not(.home-view):has(.clients-heading) .clients-search input[type=search]{
  background:#f8fafc!important;
  border-color:#dfe7f0!important;
}

/* Clienti redesign — step 5: card shell and header proportions. */
body:not(.home-view):has(.clients-heading) .clients-cards{
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:16px;
}
body:not(.home-view):has(.clients-heading) .client-card{
  min-height:0;
  padding:16px;
  border:1px solid #e1e7ef;
  border-radius:14px;
  background:#fff;
  box-shadow:0 2px 8px rgba(30,45,68,.035);
}
body:not(.home-view):has(.clients-heading) .client-card .client-avatar{
  width:48px;
  height:48px;
  min-width:48px;
  font-size:16px;
}
body:not(.home-view):has(.clients-heading) .client-card .clienthead{
  gap:12px;
  min-height:48px;
}
body:not(.home-view):has(.clients-heading) .client-card .clienthead h3{
  font-size:16px;
  line-height:1.2;
}
body:not(.home-view):has(.clients-heading) .client-card .client-phone{
  margin-top:4px;
  font-size:11.5px;
}

/* Clienti redesign — step 6: simplify card information hierarchy. */
body:not(.home-view):has(.clients-heading) .client-card .card-divider{
  margin:12px 0 10px;
  border-color:#edf0f5;
}
body:not(.home-view):has(.clients-heading) .client-treatment-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin:0 0 10px;
}
body:not(.home-view):has(.clients-heading) .client-treatment-row small{
  font-family:inherit;
  font-size:11px;
  line-height:1.2;
  color:#59667d;
}
body:not(.home-view):has(.clients-heading) .client-treatment-tag{
  padding:4px 9px;
  border-radius:999px;
  font-family:inherit;
  font-size:11.5px;
  font-weight:600;
  line-height:1.2;
  color:#536176;
}
body:not(.home-view):has(.clients-heading) .client-visit-stats{
  display:flex;
  justify-content:space-between;
  gap:12px;
  margin:0;
  padding:9px 0 0;
  border-top:1px solid #edf0f5;
  color:#59667d;
  font-family:inherit;
  font-size:11px;
  line-height:1.2;
}
body:not(.home-view):has(.clients-heading) .client-visit-stats strong{
  color:#536176;
  font-family:inherit;
  font-size:11.5px;
  font-weight:600;
}

/* Clienti redesign — step 7: stronger primary booking action. */
body:not(.home-view):has(.clients-heading) .client-card-actions{
  display:grid;
  grid-template-columns:auto auto minmax(110px,1fr);
  align-items:center;
  gap:8px;
  margin-top:14px;
}
body:not(.home-view):has(.clients-heading) .client-card-actions .btn{
  min-height:34px;
  padding:7px 10px;
  border-radius:10px;
  font-size:11.5px;
}
body:not(.home-view):has(.clients-heading) .client-card-actions .btn.primary{
  justify-content:center;
  width:100%;
  font-weight:600;
}
body:not(.home-view):has(.clients-heading) .client-card-actions .client-booking-icon{
  width:14px;
  height:14px;
}

/* Clienti — next appointment shown as a compact,useful cue. */
body:not(.dark-mode):has(.clients-heading) .client-next-appointment{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin:0 0 8px;
  color:#8794a7;
  transform:translateY(2px);
}
body:not(.dark-mode):has(.clients-heading) .client-next-appointment small{
  font-size:11px;
}
body:not(.dark-mode):has(.clients-heading) .client-next-appointment strong{
  color:#536176;
  font-size:11.5px;
  font-weight:600;
  text-align:right;
}
body:not(.dark-mode):has(.clients-heading) .client-next-appointment.is-empty strong{
  color:#59667d;
  font-weight:500;
}

/* Clienti — remove divider above visit stats and lower visit row. */
body:not(.home-view):has(.clients-heading) .client-card .client-visit-stats{
  border-top:0!important;
  padding-top:12px!important;
  margin-top:12px!important;
}

/* Clienti — card actions matching approved visual reference. */
body:not(.home-view):has(.clients-heading) .client-card-actions{
  grid-template-columns:minmax(0,1.25fr) minmax(0,1fr) minmax(0,1fr)!important;
  gap:8px;
}
body:not(.home-view):has(.clients-heading) .client-card-actions .btn{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  min-width:0;
  min-height:38px;
  padding:8px 10px;
}
body:not(.home-view):has(.clients-heading) .client-card-actions .client-action-book{
  background:#5b55e7!important;
  border-color:#5b55e7!important;
  color:#fff!important;
}
body:not(.home-view):has(.clients-heading) .client-card-actions .client-action-book:hover{
  background:#4f49d8!important;
  border-color:#4f49d8!important;
}
body:not(.home-view):has(.clients-heading) .client-action-icon,body:not(.home-view):has(.clients-heading) .client-booking-icon{
  width:15px;
  height:15px;
  flex:0 0 15px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.8;
  stroke-linecap:round;
  stroke-linejoin:round;
}

/* Clienti — safe native sort polish only. */
body:not(.home-view):has(.clients-heading) .clients-sort select{
  width:100%;
  text-align:center;
  text-align-last:center;
  color:#536176!important;
  font-size:12.5px!important;
  font-weight:500;
  cursor:pointer;
  outline:none!important;
}
body:not(.home-view):has(.clients-heading) .clients-sort select:focus{
  box-shadow:0 0 0 3px rgba(91,85,231,.10)!important;
}
body:not(.home-view):has(.clients-heading) .clients-sort select option{
  background:#fff;
  color:#253047;
  font-size:13px;
}

/* Clienti — slightly more compact cards. */
body:not(.home-view):has(.clients-heading) .client-card{
  padding-top:14px!important;
  padding-bottom:13px!important;
}
body:not(.home-view):has(.clients-heading) .client-card .card-divider{
  margin-top:10px!important;
  margin-bottom:8px!important;
}
body:not(.home-view):has(.clients-heading) .client-treatment-row{
  margin-bottom:6px!important;
}
body:not(.home-view):has(.clients-heading) .client-card .client-visit-stats{
  margin-top:8px!important;
  padding-top:8px!important;
}
body:not(.home-view):has(.clients-heading) .client-card-actions{
  margin-top:11px!important;
}

/* Clienti — lower only the search field to match filter controls. */
body:not(.home-view):has(.clients-heading) .clients-search{
  min-height:38px!important;
  height:38px!important;
}
body:not(.home-view):has(.clients-heading) .clients-search input[type=search]{
  min-height:38px!important;
  height:38px!important;
  line-height:38px!important;
}

/* Clienti — custom sorting menu,scoped to this control only. */
body:not(.home-view):has(.clients-heading) .clients-sort-custom{
  position:relative;
  display:flex;
  align-items:center;
  overflow:visible;
  flex:0 0 132px;
  width:132px;
  min-width:132px;
  height:38px;
  min-height:38px;
  padding:0;
  margin:0;
  border-radius:12px;
}
.clients-sort-trigger{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  box-sizing:border-box;
  width:100%;
  height:36px;
  min-height:36px;
  margin:0;
  padding:7px 12px;
  border:0;
  border-radius:inherit;
  background:transparent;
  color:#40506a;
  font:inherit;
  font-size:12.5px;
  font-weight:400;
  line-height:normal;
  white-space:nowrap;
  cursor:pointer;
}
.clients-sort-trigger>svg{
  position:static;
  flex:0 0 12px;
  width:12px;
  height:12px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.8;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.clients-sort-trigger[aria-expanded=true]>svg{transform:rotate(180deg)}
.clients-sort-trigger:focus-visible{
  outline:2px solid #8b72f8;
  outline-offset:3px;
}
.clients-sort-menu{
  position:absolute;
  top:calc(100% + 7px);
  right:0;
  z-index:30;
  min-width:100%;
  width:170px;
  padding:5px;
  border:1px solid #e1e7ef;
  border-radius:12px;
  background:#fff;
  box-shadow:0 8px 24px rgba(30,45,68,.12);
}
.clients-sort-menu[hidden]{display:none}
.clients-sort-option{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  width:100%;
  min-height:36px;
  padding:8px 10px;
  border:0;
  border-radius:8px;
  background:transparent;
  color:#536176;
  font:inherit;
  font-size:12.5px;
  font-weight:500;
  line-height:1.2;
  text-align:left;
  cursor:pointer;
}
.clients-sort-option>svg{
  width:15px;
  height:15px;
  flex:0 0 15px;
  visibility:hidden;
  fill:none;
  stroke:currentColor;
  stroke-width:2;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.clients-sort-option[aria-checked=true]{background:#f5f2ff;color:#6846f5}
.clients-sort-option[aria-checked=true]>svg{visibility:visible}
.clients-sort-option:hover,.clients-sort-option:focus-visible{
  background:#f0ecff;
  color:#6846f5;
  outline:none;
}

/* Global light sidebar — palette matched to the approved reference. */
body:not(.dark-mode) aside{
  background:#eef1f5;
  border-right-color:#dfe4eb;
  color:#4b5563;
}
body:not(.dark-mode) aside .brand-lockup .logo,body:not(.dark-mode) aside .brand-name{
  color:#252832;
}
body:not(.dark-mode) aside .brand-bee{
  filter:brightness(0);
  opacity:.82;
}
body:not(.dark-mode) aside .brand-tagline{
  color:#59667d;
}
body:not(.dark-mode) aside #nav button{
  color:#4b5563;
  background:transparent;
}
body:not(.dark-mode) aside #nav button svg{
  color:#667085;
  opacity:1;
}
body:not(.dark-mode) aside #nav button:hover{
  color:#303846;
  background:#eef1f6;
}
body:not(.dark-mode) aside #nav button.active,body:not(.dark-mode) aside #nav button.active:hover{
  color:#6950cc;
  background:#e8e2fc;
  box-shadow:none;
}
body:not(.dark-mode) aside #nav button.active svg{
  color:#6950cc;
}
body:not(.dark-mode) aside #nav button.active::before{
  background:#8b70e7;
}
body:not(.dark-mode) aside .sidefoot{
  border-top-color:#e5eaf1;
}
body:not(.dark-mode) aside .business-button{
  color:#374151;
  background:transparent;
  border:1px solid #e5eaf1;
}
body:not(.dark-mode) aside .business-button:hover{
  background:#eef1f6;
}
body:not(.dark-mode) aside .business-button small{
  color:#59667d;
  opacity:1;
}
body:not(.dark-mode) aside .business-button>svg{
  color:#667283;
  opacity:1;
}
body:not(.dark-mode) aside .business-button .home-avatar{
  background:#e1e6ee;
  color:#526176;
}

/* Keep the studio profile at the bottom of the desktop sidebar. */
@media(min-width:701px){
  body aside>.sidefoot,
  body.home-view aside>.sidefoot{
    margin-top:auto;
    flex-shrink:0;
  }
}

/* Home — shared lilac for the booking and next-appointment primary actions. */
body.home-view .home-intro .new-appointment-split .btn.primary,body.home-view .next-home .next-actions .btn.primary{
  background:#5b55e7!important;
  border-color:#5b55e7!important;
}
body.home-view .home-intro .new-appointment-split .btn.primary:hover,body.home-view .next-home .next-actions .btn.primary:hover{
  background:#4f49d8!important;
  border-color:#4f49d8!important;
}


/* Home — weekly chart selected bar uses a secondary lilac accent. */
body.home-view .weekly-chart .chart-column.selected .chart-bar{
  background:linear-gradient(#8e79cc,#6f58ad)!important;
}

/* Trattamenti redesign — step 1: match Clienti page heading. */
body:not(.home-view):has(.services-heading) .app-header{
  display:none;
}
.services-heading{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:20px;
  margin:0 0 18px;
}
.services-heading-copy h1{
  margin:0;
  color:#111827;
  font-size:26px;
  font-weight:700;
  line-height:1.15;
  letter-spacing:-.02em;
}
.services-heading-copy p{
  margin:7px 0 0;
  color:#59667d;
  font-size:13.5px;
  line-height:1.45;
}

/* Trattamenti redesign — step 2: count badge and lilac primary action. */
.services-heading-title{
  display:flex;
  align-items:center;
  gap:10px;
}
.services-heading-add{
  background:var(--violet)!important;
  border-color:var(--violet)!important;
  color:#fff!important;
  box-shadow:0 4px 10px rgba(124,87,255,.16);
}
.services-heading-add:hover{
  background:var(--violet-hover)!important;
  border-color:var(--violet-hover)!important;
}

/* Trattamenti: compact search,category filters,sorting and view controls. */
.services-searchbar{display:flex;align-items:center;gap:12px;margin:0 0 20px;padding:14px;border:1px solid #e1e7ef;border-radius:14px;background:#fff;box-shadow:0 3px 10px rgba(30,45,68,.035)}
.services-searchbar .services-search{position:relative;display:flex;align-items:center;flex:1 1 300px;min-width:220px;margin:0;font-weight:400}
.services-searchbar svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}
.services-searchbar .services-search>svg{position:absolute;left:13px;color:#93a5bf;pointer-events:none}
.services-searchbar .services-search input[type="search"]{box-sizing:border-box;width:100%;height:38px;min-height:38px;margin:0;padding:0 12px 0 38px;border:1px solid #dfe7f0;border-radius:10px;outline:none;background:#f8fafc;color:#40506a;font-family:var(--font-ui,inherit);font-size:13px;font-weight:400;line-height:normal;box-shadow:none}
.services-searchbar .services-search input::placeholder{color:#7a879b;font-weight:400;opacity:1}
.services-searchbar .services-search input:focus{border-color:#a994ed;box-shadow:0 0 0 2px #ede7ff}
.services-searchbar .services-filters{display:flex;align-items:center;gap:8px;flex:0 1 auto;min-width:0;overflow-x:auto;scrollbar-width:thin}
.services-searchbar .services-filters button{height:38px;min-height:38px;flex:0 0 auto;padding:0 13px;border:1px solid #e1e7ef;border-radius:10px;background:#f8fafc;color:#485870;font:inherit;font-size:13px;font-weight:400;cursor:pointer;white-space:nowrap}
.services-searchbar .services-filters button.active{border-color:#ddd3ff;background:#f5f2ff;color:#714af4;font-weight:600}
.services-searchbar .services-toolbar-actions{display:flex;align-items:center;gap:10px;flex-shrink:0}
.services-searchbar .services-sort{position:relative;color:#40506a;font-size:13px}
.services-searchbar .services-sort summary{display:flex;align-items:center;justify-content:center;gap:5px;height:38px;min-width:174px;box-sizing:border-box;padding:0 12px;border:1px solid #dfe7f0;border-radius:10px;background:#f8fafc;list-style:none;cursor:pointer;white-space:nowrap}
.services-searchbar .services-sort summary::-webkit-details-marker{display:none}
.services-searchbar .services-sort summary>svg{margin-left:12px;width:15px;height:15px}
.services-searchbar .services-sort-menu{position:absolute;top:calc(100% + 7px);right:0;z-index:20;min-width:190px;padding:5px;border:1px solid #e1e7ef;border-radius:12px;background:#fff;box-shadow:0 8px 24px #28324d1a}
.services-searchbar .services-sort-menu button{display:block;width:100%;border:0;border-radius:7px;padding:9px 12px;background:transparent;color:#485870;font:inherit;text-align:left;cursor:pointer}
.services-searchbar .services-sort-menu button[aria-pressed="true"],.services-searchbar .services-sort-menu button:hover{background:#f5f2ff;color:#714af4}
.services-searchbar .services-view-toggle{display:flex;align-items:center;height:38px;box-sizing:border-box;padding:3px;border:1px solid #dfe7f0;border-radius:10px;background:#f1f5f9}
.services-searchbar .services-view-toggle button{display:flex;align-items:center;justify-content:center;width:30px;height:30px;padding:0;border:0;border-radius:7px;background:transparent;color:#73829b;cursor:pointer}
.services-searchbar .services-view-toggle button[aria-pressed="true"]{background:#fff;color:#40506a;box-shadow:0 1px 4px #28324d12}
.services-searchbar button:focus-visible,.services-searchbar summary:focus-visible{outline:2px solid #a994ed;outline-offset:2px}
.services-sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.services-results .services-empty{grid-column:1/-1}
@media(max-width:1150px){.services-searchbar{flex-wrap:wrap}.services-searchbar .services-search{flex:1 1 calc(100% - 300px)}.services-searchbar .services-filters{order:3;flex:1 1 100%}}
@media(max-width:600px){.services-searchbar{gap:10px;padding:12px}.services-searchbar .services-search{flex:1 1 100%;min-width:0}.services-searchbar .services-toolbar-actions{order:4;justify-content:space-between;width:100%}.services-searchbar .services-sort{flex:1}.services-searchbar .services-sort summary{min-width:0}}

/* Trattamenti cards: hierarchy and spacing from the approved reference. */
.services-results .service-card{min-width:0;min-height:286px;display:flex;flex-direction:column;padding:20px;border:1px solid #e1e7ef;border-radius:18px;background:#fff;box-shadow:0 3px 12px #26395604}
.services-results .service-card .service-category{display:inline-flex;align-items:center;width:fit-content;max-width:100%;padding:5px 10px;border:1px solid #f1d1d6;border-radius:8px;background:#fff0f1;color:var(--ds-danger);font-size:11px;font-weight:600;line-height:1.3;letter-spacing:.6px;text-transform:uppercase}
.services-results .service-card h3{margin:14px 0 0;color:#171b2a;font-family:"DM Sans",sans-serif;font-size:17px;font-weight:600;line-height:1.4;letter-spacing:-.2px;overflow-wrap:anywhere}
.services-results .service-card .service-description{margin:8px 0 0;font-size:13px;line-height:1.5;color:#71819d}
.services-results .service-card .service-price-row{display:flex;align-items:center;flex-wrap:wrap;gap:12px;margin:16px 0 0}
.services-results .service-card .service-price{color:#131a2c;font-family:"DM Sans",sans-serif;font-size:24px;font-weight:600;line-height:1.3;letter-spacing:-.6px;white-space:nowrap}
.services-results .service-card .service-price-original{color:#8a94ab;font-size:15px;font-weight:400;white-space:nowrap}
.services-results .service-card .service-card-badges{display:flex;justify-content:space-between;align-items:center;gap:8px}
.services-results .service-card .service-promo-badge{border-color:color-mix(in srgb,var(--ds-success) 35%,transparent);background:var(--ds-success-bg);color:var(--ds-success)}
.services-results .service-card .service-promo-upcoming-badge{border-color:#ddd3ff;background:#f5f1ff;color:var(--violet-text);text-transform:none;letter-spacing:normal}
.services-results .service-card .service-duration{display:inline-flex;align-items:center;gap:6px;padding:3px 10px;border:1px solid #f5df9b;border-radius:999px;background:#fff5d6;color:#8a6417;font-size:13px;font-weight:400;line-height:1.35;white-space:nowrap}
.services-results .service-card .service-duration svg{width:14px;height:14px;flex-shrink:0}
.services-results .service-card .service-team{display:grid;grid-template-columns:minmax(0,.95fr) minmax(0,1.25fr);align-items:center;gap:8px 12px;margin:18px 0 0;padding:14px 0 16px;border-top:1px solid #edf1f7;font-size:13px;line-height:1.5}
.services-results .service-card .service-team dt{flex:0 1 auto;color:#59667d;font-weight:400}
.services-results .service-card .service-team dd{min-width:0;margin:0;display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:6px 8px;text-align:right;color:#40506a}
.services-results .service-card .service-team-names{min-width:0;overflow-wrap:anywhere}
.services-results .service-card .service-team-avatars{display:inline-flex;align-items:center;flex-shrink:0;padding-left:4px}
.services-results .service-card .service-team-avatars .service-team-initial{box-sizing:content-box;margin-left:-4px;border:2px solid #fff}
.services-results .service-card .service-team-initial{display:inline-flex;align-items:center;justify-content:center;flex:0 0 22px;width:22px;height:22px;border-radius:50%;background:#fce8f3;color:#bd4b87;font-size:11px;font-weight:600}
.services-results .service-card .service-team-initial:nth-child(2n){background:#e9e6ff;color:#6950cc}
.services-results .service-card .service-team-empty{color:#8b99af;font-size:12px}
.services-results .service-card .service-card-actions{display:flex;margin-top:auto;padding-top:14px;border-top:1px solid #edf1f7}
.services-results .service-card .service-edit{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;min-height:34px;height:34px;margin:0;padding:0 12px;border:1px solid var(--violet);border-radius:9px;background:var(--violet);color:#fff;font-family:var(--font-ui);font-size:13px;font-weight:500;line-height:1.2;white-space:normal}
.services-results .service-card .service-edit svg{flex:0 0 17px;width:17px;height:17px}
.services-results .service-card .service-edit:hover{background:var(--violet-hover);border-color:var(--violet-hover)}
.services-results .service-card .service-edit:focus-visible{outline:2px solid #a994ed;outline-offset:3px}
.services-results.services-list{grid-template-columns:1fr}
.services-results.services-list .service-card{display:grid;grid-template-columns:minmax(180px,1.4fr) minmax(160px,.8fr) minmax(170px,1fr) minmax(180px,.9fr);align-items:center;gap:20px;min-height:0}
.services-results.services-list .service-card .service-price-row,.services-results.services-list .service-card .service-team,.services-results.services-list .service-card .service-card-actions{margin:0;padding:0;border:0}
.services-results.services-list .service-card .service-team{grid-template-columns:1fr;gap:6px}
.services-results.services-list .service-card .service-team dd{max-width:100%;justify-content:flex-start;text-align:left}
@media(max-width:1150px){.services-results.services-list .service-card{grid-template-columns:minmax(180px,1fr) minmax(160px,1fr)}.services-results.services-list .service-card .service-card-actions{align-self:end}}
@media(max-width:600px){.services-results .service-card{padding:20px;min-height:0}.services-results.services-list .service-card{display:flex;align-items:stretch;gap:0}.services-results.services-list .service-card .service-price-row{margin-top:18px}.services-results.services-list .service-card .service-team{grid-template-columns:minmax(0,.95fr) minmax(0,1.25fr);margin-top:18px;padding:14px 0 16px;border-top:1px solid #edf1f7}.services-results.services-list .service-card .service-team dd{max-width:100%;justify-content:flex-end;text-align:right}.services-results.services-list .service-card .service-card-actions{align-self:stretch;margin-top:auto;padding-top:14px;border-top:1px solid #edf1f7}}

/* Trattamenti — quieter secondary details and a modest desktop scale reduction. */
.services-results .service-card .service-team{font-size:12.5px;font-weight:400}
.services-results .service-card .service-team .service-cabin-label{color:#59667d}
.services-results .service-card .service-team .service-cabin{display:block;font-size:12px;font-weight:400;color:#63738e;overflow-wrap:anywhere}
.services-results .service-card .service-category{font-weight:500;letter-spacing:.4px}
.services-heading .services-heading-add{font-size:13px;font-weight:500}
@media(min-width:901px){#main:has(>.services-heading){zoom:.96}}
/* Up to 900px the actions do not fit beside the title: they go under it, side by side when there is room. */
@media(max-width:900px){.services-heading{flex-wrap:wrap}.services-heading-actions{width:100%}.services-heading-actions>.btn{flex:1 1 auto;white-space:nowrap}}

/* Impostazioni — scoped editor with compact identity,appearance and privacy panels. */
body:not(.home-view):has(.settings-page) .app-header{display:none}
.settings-page{--settings-accent:#7657f6;--settings-soft:#f3efff;--settings-border:#e1e7ef;--settings-muted:#59667d;--settings-ink:#252b3b}
.settings-page .settings-heading{margin:0 0 22px}
.settings-page .settings-heading h1{margin:0;color:#171b2a;font-family:var(--font-heading);font-size:26px;font-weight:700;line-height:1.2;letter-spacing:-.5px}
.settings-page .settings-heading>p{margin:7px 0 0;color:var(--settings-muted);font-size:13.5px;line-height:1.5}
.settings-page .settings-workspace{display:grid;grid-template-columns:minmax(0,1.65fr) minmax(280px,1fr);align-items:start;gap:20px}
.settings-page .settings-editor,.settings-page .settings-side-panels{display:grid;gap:18px;min-width:0}
.settings-page .settings-surface{min-width:0;padding:22px;border:1px solid var(--settings-border);border-radius:16px;background:#fff;box-shadow:0 3px 12px #26395604}
.settings-page .settings-section-heading{display:flex;align-items:center;gap:12px;margin-bottom:20px}
.settings-page .settings-section-icon{display:flex;align-items:center;justify-content:center;flex:0 0 38px;width:38px;height:38px;border-radius:12px;background:var(--settings-soft);color:var(--settings-accent)}
.settings-page .settings-icon-blue{background:#eaf4ff;color:#3285c3}
.settings-page .settings-icon-green{background:#e6f7f0;color:#24977a}
.settings-page h2{margin:0;color:var(--settings-ink);font-family:var(--font-heading);font-size:16px;font-weight:600;line-height:1.4;letter-spacing:-.2px}
.settings-page .settings-section-heading p{margin:3px 0 0;color:var(--settings-muted);font-size:12px;line-height:1.5}
.settings-page .settings-identity-fields{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.settings-page .settings-identity-fields>label{display:block;margin:0;color:#526079;font-size:12px;font-weight:500;line-height:1.5}
.settings-page .settings-identity-fields input{width:100%;min-width:0;height:42px;min-height:42px;margin:7px 0 0;padding:0 12px;border:1px solid var(--settings-border);border-radius:10px;background:#fbfcfe;color:var(--settings-ink);font:400 13px var(--font-ui);box-shadow:none}
.settings-page .settings-identity-fields input:focus{outline:2px solid #e8e0ff;outline-offset:1px;border-color:#ae98f1}
.settings-page h3{margin:0;color:var(--settings-ink);font-family:var(--font-ui);font-size:13px;font-weight:500;line-height:1.4}
.settings-page .settings-privacy-row{display:flex;align-items:center;justify-content:space-between;gap:16px}
.settings-page .settings-privacy-row p{margin:4px 0 0;color:var(--settings-muted);font-size:12px;line-height:1.5}
.settings-page .settings-save-row{display:flex;align-items:center;justify-content:space-between;gap:16px}
.settings-page .settings-save-copy{max-width:330px;margin:0;color:var(--settings-muted);font-size:11.5px;line-height:1.5}
.settings-page .settings-save-button{display:flex;align-items:center;justify-content:center;flex-shrink:0;gap:8px;min-height:40px;padding:10px 16px;border:1px solid var(--violet);border-radius:10px;background:var(--violet);color:#fff;font-size:13px;font-weight:500;box-shadow:0 3px 8px #7c57ff19}
.settings-page .settings-save-button:hover{background:var(--violet-hover);border-color:var(--violet-hover)}
.settings-page .settings-privacy-switch{flex:0 0 40px;width:40px;height:24px;min-height:0;padding:3px;border:0;border-radius:999px;background:#c8d1df;box-shadow:none;cursor:pointer}
.settings-page .settings-privacy-switch>span{display:block;width:18px;height:18px;border-radius:50%;background:#fff;box-shadow:0 1px 3px #26395620;transition:transform .15s}
.settings-page .settings-privacy-switch[aria-checked="true"]{background:var(--violet)}
.settings-page .settings-privacy-switch[aria-checked="true"]>span{transform:translateX(16px)}
.settings-page .settings-fineprint{margin:16px 0 0;padding-top:14px;border-top:1px solid #edf1f7;color:var(--settings-muted);font-size:11.5px;line-height:1.65}
.settings-page .settings-status-label{display:inline-flex;padding:3px 8px;border:1px solid #d4eee2;border-radius:6px;background:#edf9f3;color:var(--ds-success);font-size:11px;font-weight:500;line-height:1.4}
.settings-page .settings-automation>p:not(.settings-fineprint){margin:10px 0 0;color:#63718a;font-size:12px;line-height:1.6}
.settings-page .settings-storage-note{display:flex;align-items:flex-start;gap:8px;padding:0 4px}
.settings-page .settings-storage-note>span{flex-shrink:0;color:#8b79b5;margin-top:2px}
.settings-page .settings-storage-note p{margin:0;color:var(--settings-muted);font-size:11.5px;line-height:1.65}
.settings-page button:focus-visible{outline:2px solid #a994ed;outline-offset:3px}
@media(max-width:1100px){.settings-page .settings-workspace{grid-template-columns:minmax(0,1.5fr) minmax(250px,1fr);gap:16px}.settings-page .settings-surface{padding:18px}}
@media(max-width:850px){.settings-page .settings-workspace{grid-template-columns:1fr}.settings-page .settings-save-row{margin-bottom:4px}}
@media(max-width:540px){.settings-page .settings-identity-fields{grid-template-columns:1fr}.settings-page .settings-save-row{align-items:stretch;flex-direction:column;gap:10px}.settings-page .settings-save-button{width:100%}.settings-page .settings-heading h1{font-size:25px}}
.settings-page .settings-save-button{background:var(--violet)!important;border-color:var(--violet)!important;color:#fff!important}
.settings-page .settings-save-button:hover{background:var(--violet-hover)!important;border-color:var(--violet-hover)!important}

/* Trattamenti — title typography exactly aligned with Clienti. */
.services-heading-copy h1{
  font-size:26px!important;
  font-weight:700!important;
  line-height:1.15!important;
  letter-spacing:-.02em!important;
}

/* Trattamenti — inherit the exact approved Clienti title typography. */
.services-heading-title h1{
  margin:0!important;
  color:var(--ink)!important;
  font-size:26px!important;
  font-weight:700!important;
  line-height:1.2!important;
  letter-spacing:-.8px!important;
}

/* Trattamenti — active count badge aligned with title. */
.services-heading-title{
  display:flex!important;
  align-items:center!important;
  gap:10px!important;
}
.services-heading-count{
  display:inline-flex;
  align-items:center;
  min-height:27px;
  padding:3px 10px;
  border:1px solid #ddd6fe;
  border-radius:999px;
  background:#f5f3ff;
  color:#6d4aff;
  font-size:13px;
  font-weight:500;
  line-height:1.25;
  white-space:nowrap;
}

/* Trattamenti modal redesign — step 1: cleaner layout and proportions. */
#sform .fields{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:18px 22px;
}
#sform .fields label{
  color:#374151;
  font-weight:600;
}
#sform .fields label.full{grid-column:1/-1}
#sform .fields label:nth-child(1),#sform .fields label:nth-child(2){
  grid-column:auto;
}
#sform .fields label:nth-child(3){
  grid-column:1/-1;
  grid-row:4;
}
#sform .fields label:nth-child(4){
  grid-column:1/-1;
  grid-row:2;
}
#sform .fields label:nth-child(5),#sform .fields label:nth-child(6){
  grid-row:3;
}
#sform input,#sform textarea{
  margin-top:7px;
  border-radius:12px!important;
  border-color:#dfe4ec!important;
  background:#fff!important;
}
#sform input{
  min-height:48px!important;
  padding:11px 14px!important;
}
#sform textarea{
  min-height:108px!important;
  padding:13px 14px!important;
  resize:vertical;
}
#sform .checkgroup{
  margin-top:20px;
  padding:18px;
  border:1px solid #e1e6ee;
  border-radius:14px;
  background:#fff;
}
#sform .checkgroup legend{
  padding:0 8px;
  color:#202635;
  font-size:15px;
  font-weight:700;
}
#sform .checkgroup label{
  display:inline-flex;
  align-items:center;
  gap:9px;
  margin:6px 10px 6px 0;
  padding:10px 14px;
  border:1px solid #dfe4ec;
  border-radius:11px;
  background:#fff;
}
#sform .checkgroup label:has(input:checked){
  border-color:#b9a8ff;
  background:#f7f4ff;
}
#sform .checkgroup input{min-height:auto!important;margin:0!important}

/* Trattamenti modal — controlled category selector. */
#sform select{
  width:100%;
  min-height:48px;
  margin-top:7px;
  padding:11px 38px 11px 14px;
  border:1px solid #dfe4ec;
  border-radius:12px;
  background:#fff;
  color:#202635;
  font:inherit;
}
#service-new-category[hidden]{display:none!important}
#service-new-category:not([hidden]){margin-top:9px}

/* Trattamenti modal — custom category dropdown. */
.service-category-picker{position:relative;margin-top:7px}
#service-category-trigger{
  width:100%;
  min-height:48px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:11px 14px;
  border:1px solid #dfe4ec;
  border-radius:12px;
  background:#fff;
  color:#202635;
  font:inherit;
  text-align:left;
  cursor:pointer;
}
#service-category-trigger svg{
  width:18px;height:18px;fill:none;stroke:#7c8799;stroke-width:2;
  stroke-linecap:round;stroke-linejoin:round;
}
.service-category-menu{
  position:absolute;
  z-index:30;
  top:calc(100% + 6px);
  left:0;right:0;
  padding:6px;
  border:1px solid #dfe4ec;
  border-radius:12px;
  background:#fff;
  box-shadow:0 12px 28px rgba(31,41,55,.14);
}
.service-category-menu[hidden]{display:none!important}
.service-category-menu button{
  width:100%;
  min-height:38px;
  padding:8px 11px;
  border:0;
  border-radius:8px;
  background:transparent;
  color:#293244;
  font:inherit;
  text-align:left;
  cursor:pointer;
}
.service-category-menu button:hover{background:#f5f3ff;color:#6547ee}
.service-category-menu button[aria-selected="true"]{background:#f5f3ff;color:#6547ee;font-weight:600}
.service-category-menu .service-category-new{
  margin-top:4px;
  border-top:1px solid #edf0f4;
  border-radius:0 0 8px 8px;
  color:#6547ee;
  font-weight:600;
}

/* Trattamenti modal — new category stays in the category control. */
#service-category-trigger.is-new span{flex:1;min-width:0}
#service-category-trigger.is-new #service-new-category{
  display:block!important;
  width:100%;
  min-height:0!important;
  height:auto!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
  border-radius:0!important;
  outline:0!important;
  box-shadow:none!important;
  background:transparent!important;
  color:#202635;
  font:inherit;
  font-weight:500;
}
#service-category-trigger.is-new #service-new-category::placeholder{color:#9aa0aa}

/* Modals — keep the page behind them completely still. */
body.modal-open{
  overflow:hidden!important;
}

/* Trattamenti modal — price field with fixed euro suffix. */
#sform .service-price-field{
  display:flex;
  align-items:stretch;
  width:100%;
  min-height:48px;
  margin-top:7px;
  border:1px solid #dfe4ec;
  border-radius:12px;
  overflow:hidden;
  background:#fff;
}
#sform .service-price-field input{
  flex:1;
  min-width:0;
  min-height:46px!important;
  margin:0!important;
  padding:11px 14px!important;
  border:0!important;
  border-radius:0!important;
  outline:0;
  box-shadow:none!important;
  appearance:textfield;
  -moz-appearance:textfield;
}
#sform .service-price-field input::-webkit-inner-spin-button,#sform .service-price-field input::-webkit-outer-spin-button{
  -webkit-appearance:none;
  margin:0;
}
#sform .service-price-field span{
  display:flex;
  align-items:center;
  justify-content:center;
  flex:0 0 52px;
  border-left:1px solid #dfe4ec;
  background:#f8fafc;
  color:#46546a;
  font-size:18px;
  font-weight:600;
}
#sform .service-price-field:focus-within{
  border-color:#b9a8ff;
  box-shadow:0 0 0 3px rgba(124,87,255,.10);
}

/* Trattamenti modal — duration field with fixed clock suffix. */
#sform .service-duration-field{
  display:flex;align-items:stretch;width:100%;min-height:48px;margin-top:7px;
  border:1px solid #dfe4ec;border-radius:12px;overflow:hidden;background:#fff;
}
#sform .service-duration-field input{
  flex:1;min-width:0;min-height:46px!important;margin:0!important;padding:11px 14px!important;
  border:0!important;border-radius:0!important;outline:0;box-shadow:none!important;
  appearance:textfield;-moz-appearance:textfield;
}
#sform .service-duration-field input::-webkit-inner-spin-button,#sform .service-duration-field input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}
#sform .service-duration-field span{
  display:flex;align-items:center;justify-content:center;flex:0 0 52px;
  border-left:1px solid #dfe4ec;background:#f8fafc;color:#46546a;
}
#sform .service-duration-field svg{
  width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;
  stroke-linecap:round;stroke-linejoin:round;
}
#sform .service-duration-field:focus-within{
  border-color:#b9a8ff;box-shadow:0 0 0 3px rgba(124,87,255,.10);
}

/* Trattamenti modal — visually balance the euro suffix with the clock icon. */
#sform .service-price-field span{
  font-size:17px!important;
  font-weight:500!important;
  line-height:1!important;
  padding-top:1px;
}

/* Trattamenti — notes no longer change card height. */
.services-results .service-card-actions{
  display:flex!important;
  align-items:stretch;
  gap:8px!important;
}
.services-results .service-card-actions .service-edit{
  flex:1 1 auto;
  min-width:0;
}
.services-results .service-card-actions .service-note{
  flex:0 0 42px;
  width:42px;
  padding:0!important;
  display:flex;
  align-items:center;
  justify-content:center;
  border-color:#dfe4ec!important;
  background:#f8fafc!important;
  color:#56657a!important;
}
.services-results .service-card-actions .service-note svg{
  width:18px;
  height:18px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.8;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.service-note-modal{
  padding:4px 0 8px;
}
.service-note-modal h3{
  margin:0 0 12px;
  color:#202635;
  font-size:15px;
}
.service-note-modal p{
  margin:0;
  color:#56657a;
  line-height:1.65;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
}

/* Trattamenti — fixed card geometry and permanent inline note action. */
.services-results:not(.services-list) .service-card{
  height:298px!important;
  min-height:298px!important;
}
.services-results:not(.services-list) .service-card .service-card-heading{
  flex:0 0 auto;
}
.services-results:not(.services-list) .service-card .service-team{
  margin-top:18px!important;
}
.services-results:not(.services-list) .service-card .service-card-actions{
  margin-top:auto!important;
  flex-direction:row!important;
  flex-wrap:nowrap!important;
  width:100%;
}
.services-results:not(.services-list) .service-card .service-edit{
  width:auto!important;
  flex:1 1 auto!important;
}
.services-results:not(.services-list) .service-card .service-note{
  flex:0 0 42px!important;
  width:42px!important;
  min-width:42px!important;
  height:34px!important;
  min-height:34px!important;
  margin:0!important;
}

/* Trattamenti — keep long/multiple staff names inside the fixed card. */
.services-results:not(.services-list) .service-card .service-team{
  grid-template-columns:minmax(0,.9fr) minmax(0,1.35fr)!important;
}
.services-results:not(.services-list) .service-card .service-team dd{
  min-width:0!important;
  flex-wrap:nowrap!important;
  overflow:hidden;
}
.services-results:not(.services-list) .service-card .service-team-names{
  min-width:0!important;
  max-width:100%;
  overflow:hidden!important;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.services-results:not(.services-list) .service-card .service-team-avatars{
  flex:0 0 auto!important;
  max-width:78px;
  overflow:hidden;
}

/* Trattamenti modal — primary save action follows Esteja lilac. */
#sform .modalfoot .btn.primary{
  background:var(--violet)!important;
  border-color:var(--violet)!important;
  color:#fff!important;
  box-shadow:0 6px 16px rgba(124,87,255,.18);
}
#sform .modalfoot .btn.primary:hover{
  background:var(--violet-hover)!important;
  border-color:var(--violet-hover)!important;
}

/* Save confirmation — soft success green,not warning yellow. */
#toast{
  background:#eaf8f0!important;
  border:1px solid #bfe8cf!important;
  color:#23734a!important;
}

/* Trattamenti — keep many category filters clean without a visible scrollbar. */
.services-searchbar .services-filters{
  overflow-x:auto!important;
  overflow-y:hidden!important;
  scrollbar-width:none!important;
  -ms-overflow-style:none;
  padding-bottom:0!important;
}
.services-searchbar .services-filters::-webkit-scrollbar{
  display:none!important;
  width:0!important;
  height:0!important;
}
.services-searchbar{
  overflow:hidden;
}

/* Trattamenti — prevent filter pills from being vertically clipped. */
.services-searchbar{
  overflow:visible!important;
}
.services-searchbar .services-filters{
  min-height:40px;
  padding:1px 0!important;
  align-items:center!important;
}

/* Treatment and client cards — a quiet lilac outline without layout shifts. */
#services-results .service-card,#main .clients-cards .client-card{
  transition:border-color .18s ease,box-shadow .18s ease;
}
@media(hover:hover) and (pointer:fine){
  #services-results .service-card:hover,#main .clients-cards .client-card:hover{
    border-color:#b5a2f7;
    box-shadow:0 0 0 1px rgba(124,87,255,.10),0 4px 16px rgba(124,87,255,.07);
  }
}
@media(prefers-reduced-motion:reduce){
  #services-results .service-card,#main .clients-cards .client-card{transition:none}
}

/* Lista d'attesa — match the compact Clienti heading and primary action. */
body:not(.home-view):has(.waitlist-heading) .app-header{display:none}
body:not(.home-view):has(.waitlist-heading) #main{padding:20px 26px 26px}
#main .waitlist-heading{
  display:flex;
  align-items:center;
  justify-content:space-between;
  flex-wrap:wrap;
  gap:16px 24px;
  margin:0 0 18px;
}
.waitlist-heading-copy{flex:1 1 540px;min-width:0}
#main .waitlist-heading h1{
  margin:0;
  color:var(--ink);
  font-family:var(--font-heading);
  font-size:26px;
  font-weight:700;
  line-height:1.2;
  letter-spacing:-.8px;
}
#main .waitlist-heading-copy p{
  margin:5px 0 0;
  color:#59667d;
  font-size:13.5px;
  line-height:1.4;
}
#main .waitlist-heading-add{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex-shrink:0;
  gap:9px;
  min-height:38px;
  padding:8px 14px;
  border:1px solid var(--violet);
  border-radius:12px;
  background:var(--violet);
  color:#fff;
  font-size:15px;
  font-weight:500;
  line-height:1.35;
  box-shadow:0 3px 7px rgba(124,87,255,.18);
}
#main .waitlist-heading-add svg{flex-shrink:0}
#main .waitlist-heading-add:hover{
  background:var(--violet-hover);
  border-color:var(--violet-hover);
  box-shadow:0 4px 10px rgba(124,87,255,.24);
}
#main .waitlist-heading-add:focus-visible{outline:3px solid #ac95ff;outline-offset:3px}
@media(max-width:700px){
  #main .waitlist-heading{align-items:flex-start;gap:16px}
  .waitlist-heading-copy{flex-basis:100%}
}

/* Waiting-list counts reflect currently active requests,excluding expired ones. */
#main .waitlist-heading-title{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:10px;
}
#main .waitlist-heading-count,#main .waitlist-heading-priority{
  display:inline-flex;
  align-items:center;
  padding:3px 10px;
  border:1px solid #e9e3ff;
  border-radius:999px;
  background:#f5f2ff;
  color:var(--violet-text);
  font-size:13px;
  font-weight:500;
  line-height:1.25;
  white-space:nowrap;
}
#main .waitlist-heading-priority{
  border-color:#f5df9b;
  background:#fff9e8;
  color:#986116;
}

/* Lista d'attesa — compact filters and search,with results updated in place. */
#main .waitlist-toolbar{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:12px 18px;
  margin:22px 0 20px;
  padding:0 0 12px;
  border-bottom:1px solid #e1e7ef;
}
#main .waitlist-filters{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:6px;
  min-width:0;
}
#main .waitlist-filters button{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  min-height:36px;
  margin:0;
  padding:7px 11px;
  border:1px solid transparent;
  border-radius:9px;
  background:transparent;
  color:#526079;
  font:inherit;
  font-size:13px;
  font-weight:500;
  line-height:1.4;
  white-space:nowrap;
  transition:background-color .16s ease,border-color .16s ease,color .16s ease;
}
#main .waitlist-filters button:hover{background:#f0ecff;color:var(--violet-text)}
#main .waitlist-filters button[aria-pressed="true"]{
  border-color:#ded5ff;
  background:#f5f2ff;
  color:var(--violet-text);
}
#main .waitlist-filter-count{color:#59667d;font-size:12px;font-weight:400}
#main .waitlist-filters button[aria-pressed="true"] .waitlist-filter-count{color:inherit}
#main .waitlist-filter-dot{width:6px;height:6px;flex:0 0 6px;border-radius:50%}
#main .waitlist-filter-dot.priority{background:#f2a51a}
#main .waitlist-filter-dot.expired{background:#ec6780}
#main .waitlist-search{
  display:flex;
  align-items:center;
  gap:8px;
  flex:1 1 250px;
  max-width:330px;
  min-width:0;
  margin:0 0 0 auto;
  padding:0 11px;
  border:1px solid #dfe7f0;
  border-radius:9px;
  background:var(--surface);
}
#main .waitlist-search svg{
  width:17px;height:17px;flex:0 0 17px;
  fill:none;stroke:#91a3be;stroke-width:1.8;stroke-linecap:round;
}
#main .waitlist-search input[type="search"]{
  width:100%;min-width:0;
  height:36px;min-height:36px;
  margin:0;padding:6px 0;
  border:0;border-radius:0;
  background:transparent;
  box-shadow:none;outline:none;
  color:var(--ink);
  font-size:13px;font-weight:400;line-height:1.4;
}
#main .waitlist-search input::placeholder{color:#91a3be;opacity:1}
#main .waitlist-search:focus-within{border-color:#ad96ff;box-shadow:0 0 0 3px rgba(124,87,255,.10)}
#main .waitlist-filters button:focus-visible{outline:2px solid #ac95ff;outline-offset:2px}
#main .waitlist-sr-only{
  position:absolute;width:1px;height:1px;padding:0;margin:-1px;
  overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;
}
#main .waitlist-expired-heading:not(.archive-heading){margin-top:0}
@media(max-width:700px){
  #main .waitlist-toolbar{gap:12px}
  #main .waitlist-search{flex-basis:100%;max-width:none;margin-left:0}
  #main .waitlist-filters{width:100%}
}
@media(prefers-reduced-motion:reduce){#main .waitlist-filters button{transition:none}}

/* Lista d'attesa — compact expired request cards from approved reference. */
#waitlist-results .waitlist-update-card{
  min-height:300px;
  padding:20px;
  display:flex;
  flex-direction:column;
}
.waitlist-update-head{
  display:grid;
  grid-template-columns:42px minmax(0,1fr) auto;
  align-items:start;
  gap:12px;
}
.waitlist-update-head .avatar{
  width:42px;height:42px;
  display:flex;align-items:center;justify-content:center;
  border:1px solid #dfe7f0;border-radius:12px;
  background:#f3f6f9;color:#40506a;
  font-size:13px;font-weight:700;
}
.waitlist-update-title{min-width:0}
.waitlist-update-title h3{margin:0 0 2px!important;font-size:16px!important}
.waitlist-update-title p{margin:0!important;color:#59667d;font-size:13px}
.waitlist-update-head .badge{
  margin:0;
  padding:6px 9px;
  border:1px solid #ffc8cf;
  border-radius:8px;
  background:#fff1f3;
  color:#e43d56;
  font-size:11px;
  font-weight:600;
}
.waitlist-update-details{
  margin:16px 0 18px;
  padding:13px 14px;
  border:1px solid #edf1f7;
  border-radius:14px;
  background:#f8fafc;
}
.waitlist-update-details>div:not(.waitlist-update-note){
  display:flex;align-items:baseline;justify-content:space-between;gap:14px;
  margin:0 0 8px;
  font-size:12.5px;
}
.waitlist-update-details>div:last-child{margin-bottom:0}
.waitlist-update-details span{color:#59667d}
.waitlist-update-details strong{color:#40506a;font-weight:500;text-align:right}
.waitlist-update-details>div:first-child strong{color:#e43d56}
.waitlist-update-note{margin-top:9px}
.waitlist-update-actions{
  margin-top:auto!important;
  padding-top:10px;
  border-top:1px solid #edf1f7;
  display:flex!important;
  flex-wrap:nowrap!important;
  gap:8px!important;
}
.waitlist-update-primary{
  flex:1 1 auto;
  color:#714af4!important;
  border-color:#ddd3ff!important;
  background:#f7f4ff!important;
}
.waitlist-update-remove{
  flex:0 0 auto;
  color:var(--ds-danger)!important;
  border-color:#ffc8cf!important;
  background:#fff5f6!important;
}

/* Lista d'attesa — proper sync icon for Aggiorna data. */
.waitlist-update-primary{
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:9px!important;
}
.waitlist-update-primary .waitlist-refresh-icon{
  display:block!important;
  width:20px!important;
  height:20px!important;
  flex:0 0 20px!important;
  margin:0;
  fill:none;
  stroke:currentColor;
  stroke-width:1.9!important;
  stroke-linecap:round;
  stroke-linejoin:round;
  overflow:visible!important;
}
.waitlist-update-primary span{
  display:inline-block!important;
  line-height:1!important;
}

/* Active requests share the approved compact card,with their own status and actions. */
#waitlist-results .waitlist-card-footer{
  margin-top:auto;
  display:grid;
  gap:8px;
}
#waitlist-results .waitlist-card-footer .btn{
  display:flex;
  align-items:center;
  justify-content:center;
  box-sizing:border-box;
  min-width:0;
  min-height:38px;
  margin:0;
  padding:8px 10px;
  line-height:1.3;
  white-space:normal;
}
#waitlist-results .waitlist-update-actions{
  align-items:stretch;
  margin:0!important;
  padding-top:10px;
}
#waitlist-results .waitlist-update-primary{flex:1 1 0}
#waitlist-results .waitlist-update-remove{flex:0 0 5.5rem}
#waitlist-results .waitlist-update-details{margin-bottom:16px}
#waitlist-results .waitlist-card-active .waitlist-update-details>div:first-child strong{color:#40506a}
#waitlist-results .waitlist-update-head .waitlist-priority-high{
  color:#986116;background:#fff9e8;border-color:#f5df9b;
}
#waitlist-results .waitlist-update-head .waitlist-priority-normal{
  color:#714af4;background:#f7f4ff;border-color:#ddd3ff;
}
#waitlist-results .waitlist-agenda-actions{
  display:flex;flex-wrap:wrap;gap:8px;margin:0;
}
#waitlist-results .waitlist-agenda-actions .btn{
  flex:1 1 0;font-size:13px;font-weight:500;
}
#waitlist-results .waitlist-agenda-button{
  background:var(--violet);border-color:var(--violet);color:#fff;
}
#waitlist-results .waitlist-agenda-button:hover{
  background:var(--violet-hover);border-color:var(--violet-hover);
}
#waitlist-results .waitlist-edit-icon{
  width:18px;height:18px;flex:0 0 18px;fill:none;stroke:currentColor;
  stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;
}
#waitlist-results .waitlist-update-head .badge{max-width:105px}
#waitlist-results .waitlist-update-title h3,#waitlist-results .waitlist-update-title p,#waitlist-results .waitlist-update-details strong{overflow-wrap:anywhere}
#waitlist-results .waitlist-update-actions .btn{
  font-size:13px;font-weight:500;
}
#waitlist-results .waitlist-update-primary span{line-height:1.3!important}
@media(max-width:600px){
  #waitlist-results .waitlist-update-head{grid-template-columns:42px minmax(0,1fr)}
  #waitlist-results .waitlist-update-head .badge{grid-column:2;max-width:none;justify-self:start}
}

/* Lista d'attesa — soft,clear priority and expired badges. */
#waitlist-results .waitlist-update-head .waitlist-expired-badge{
  color:#d9435b!important;
  background:#fff3f5!important;
  border:1px solid #ffc8d0!important;
  box-shadow:none!important;
}
#waitlist-results .waitlist-update-head .waitlist-priority-high{
  color:#a66a12!important;
  background:#fff9e9!important;
  border:1px solid #f3d88a!important;
  box-shadow:none!important;
}
#waitlist-results .waitlist-update-head .waitlist-priority-normal{
  color:#7048ef!important;
  background:#f7f4ff!important;
  border:1px solid #ddd2ff!important;
  box-shadow:none!important;
}
#waitlist-results .waitlist-update-head .waitlist-expired-badge,#waitlist-results .waitlist-update-head .waitlist-priority-high,#waitlist-results .waitlist-update-head .waitlist-priority-normal{
  padding:5px 9px!important;
  border-radius:8px!important;
  font-size:11px!important;
  font-weight:600!important;
  line-height:1.25!important;
}

/* Lista d'attesa — search and filters aligned to the approved Clienti toolbar style. */
#main:has(.waitlist-heading) .waitlist-toolbar{
  gap:10px 16px;
  margin:18px 0 20px;
  padding:10px 12px;
  border:1px solid #e3e9f1;
  border-radius:14px;
  background:#fff;
  box-shadow:0 3px 10px rgba(30,45,68,.035);
}
#main:has(.waitlist-heading) .waitlist-filters{
  gap:8px;
}
#main:has(.waitlist-heading) .waitlist-filters button{
  min-height:38px;
  padding:7px 12px;
  border:1px solid #dfe7f0;
  border-radius:10px;
  background:#fff;
  font-size:12.5px;
}
#main:has(.waitlist-heading) .waitlist-filters button:hover{
  border-color:#d8ccff;
  background:#faf8ff;
  color:#7048ef;
}
#main:has(.waitlist-heading) .waitlist-filters button[aria-pressed="true"]{
  border-color:#d8ccff;
  background:#f6f2ff;
  color:#7048ef;
}
#main:has(.waitlist-heading) .waitlist-search{
  order:-1;
  margin:0 auto 0 0;
  min-height:38px;
  max-width:540px;
  padding:0 12px;
  border:1px solid #dfe7f0;
  border-radius:10px;
  background:#f8fafc;
}
#main:has(.waitlist-heading) .waitlist-search input[type="search"]{
  height:36px;
  min-height:36px;
  font-size:14px;
}
#main:has(.waitlist-heading) .waitlist-search svg{
  width:18px;
  height:18px;
  flex-basis:18px;
}
@media(max-width:700px){
  #main:has(.waitlist-heading) .waitlist-toolbar{padding:10px}
}


/* Lista d'attesa — remove unused vertical space from expired request cards. */
#waitlist-results .waitlist-card-expired{
  min-height:0!important;
  height:auto!important;
  align-self:start;
}
#waitlist-results .waitlist-card-expired .waitlist-card-footer{
  margin-top:0!important;
}
#waitlist-results .waitlist-card-expired .waitlist-update-details{
  margin-bottom:12px!important;
}


/* Lista d'attesa — colored avatars,treatment value and lilac card hover. */
#waitlist-results .waitlist-update-card{
  transition:border-color .18s ease,box-shadow .18s ease;
}
@media(hover:hover) and (pointer:fine){
  #waitlist-results .waitlist-update-card:hover{
    border-color:#b5a2f7;
    box-shadow:0 0 0 1px rgba(124,87,255,.10),0 4px 16px rgba(124,87,255,.07);
  }
}
#waitlist-results .waitlist-update-card .avatar{
  border-color:transparent;
  font-weight:700;
}
#waitlist-results .cards>.waitlist-update-card:nth-child(6n+1) .avatar{
  background:#eef0ff;color:#5d55d9;
}
#waitlist-results .cards>.waitlist-update-card:nth-child(6n+2) .avatar{
  background:#eaf8f2;color:#24845f;
}
#waitlist-results .cards>.waitlist-update-card:nth-child(6n+3) .avatar{
  background:#fff1f4;color:#c94f69;
}
#waitlist-results .cards>.waitlist-update-card:nth-child(6n+4) .avatar{
  background:#fff5e8;color:#b46c18;
}
#waitlist-results .cards>.waitlist-update-card:nth-child(6n+5) .avatar{
  background:#edf6ff;color:#3979b8;
}
#waitlist-results .cards>.waitlist-update-card:nth-child(6n) .avatar{
  background:#f4edff;color:#7b4fc5;
}
#waitlist-results .waitlist-service-price{
  display:inline-flex;
  align-items:center;
  margin-left:5px;
  padding:2px 7px;
  border-radius:7px;
  background:#eaf8f2;
  color:#237a58;
  font-size:11.5px;
  font-weight:600;
  line-height:1.35;
  white-space:nowrap;
}
@media(prefers-reduced-motion:reduce){
  #waitlist-results .waitlist-update-card{transition:none}
}

/* Lista d'attesa — redesigned request modal. */
#modal:has(#wform){
  width:min(700px,calc(100vw - 32px));
  max-height:calc(100dvh - 32px);
  padding:26px 30px 24px;
  border:1px solid #e2e7ef;
  border-radius:24px;
  background:#fff;
  color:#172238;
  box-shadow:0 28px 90px rgba(23,34,56,.24);
  overflow:auto;
}
#modal:has(#wform)::backdrop{background:rgba(27,36,52,.48);backdrop-filter:blur(4px)}
#modal:has(#wform) .modalhead{align-items:center;margin-bottom:2px}
#modal:has(#wform) .modalhead h2{margin:0;color:#101828;font-family:var(--font-heading);font-size:26px;font-weight:700;line-height:1.2;letter-spacing:-.7px}
#modal:has(#wform) .close{display:grid;place-items:center;width:40px;height:40px;padding:0;border:1px solid #dfe4eb;border-radius:50%;background:#fff;color:#172238;font-size:24px;font-weight:500;line-height:1;box-shadow:none}
#modal:has(#wform) .close:hover{background:#f8fafc;border-color:#d2d9e4}
.waitlist-form-subtitle{margin:0 0 20px;color:#7a89a4;font-size:14px;line-height:1.45}
.waitlist-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px 20px}
.waitlist-form-grid>.full{grid-column:1/-1}
.waitlist-form-grid label{min-width:0;color:#26344a;font-size:14px;font-weight:600;line-height:1.35}
.waitlist-label-line{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:8px}
.waitlist-new-client{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:36px;padding:7px 12px;border:1px solid #d8ccff;border-radius:10px;background:#fff;color:#7048ef;font:inherit;font-size:13px;font-weight:600;cursor:pointer}
.waitlist-new-client:hover{background:#f8f5ff;border-color:#bca9ff}
.waitlist-control-shell{position:relative;display:flex;align-items:center;width:100%;min-width:0;margin-top:8px}
.waitlist-control-shell>svg:first-child{position:absolute;left:15px;z-index:2;width:20px;height:20px;fill:none;stroke:var(--violet);stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;pointer-events:none}
.waitlist-control-shell>svg:last-child{position:absolute;right:15px;z-index:2;width:19px;height:19px;fill:none;stroke:#687895;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;pointer-events:none}
#modal:has(#wform) .waitlist-control-shell select,#modal:has(#wform) .waitlist-control-shell input,#modal:has(#wform) .waitlist-control-shell .control-button{width:100%;min-height:48px;margin:0;padding:10px 44px 10px 46px;border:1px solid #dce3ee;border-radius:13px;background:#fff;color:#172238;font-size:15px;font-weight:500;line-height:1.35;box-shadow:none;box-sizing:border-box}
#modal:has(#wform) .waitlist-control-shell select{appearance:none;-webkit-appearance:none}
#modal:has(#wform) .waitlist-control-shell:focus-within select,#modal:has(#wform) .waitlist-control-shell:focus-within input,#modal:has(#wform) .waitlist-control-shell .control-button:focus-visible{border-color:#a991ff;box-shadow:0 0 0 3px rgba(124,87,255,.10);outline:none}
.waitlist-date-control>svg:last-child{display:none}
.waitlist-service-meta{display:grid;grid-template-columns:1fr 1fr;min-height:62px;border:1px solid #edf0f6;border-radius:14px;background:#f8f9fc;overflow:hidden}
.waitlist-service-meta>div{display:flex;align-items:center;gap:12px;min-width:0;padding:12px 18px}
.waitlist-service-meta>div+div{border-left:1px solid #e4e8f0}
.waitlist-service-meta svg{width:22px;height:22px;flex:0 0 22px;fill:none;stroke:var(--violet);stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.waitlist-service-meta span{display:grid;gap:2px}.waitlist-service-meta small{color:#8290aa;font-size:12px;font-weight:500}.waitlist-service-meta strong{color:#26344a;font-size:15px;font-weight:600}#waitlist-service-price{color:#23845f}
#modal:has(#wform) .waitlist-availability{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:0;padding:12px;border:1px solid #e3ddff;border-radius:16px;background:#fbfaff}
#modal:has(#wform) .waitlist-availability legend{grid-column:1/-1;padding:0 5px;color:#26344a;font-size:14px;font-weight:700}
.waitlist-availability-option{position:relative;display:grid!important;grid-template-columns:20px 20px minmax(0,1fr);align-items:center!important;gap:10px!important;min-height:66px;padding:10px 12px;border:1px solid #e1e6ef;border-radius:13px;background:#fff;cursor:pointer}
.waitlist-availability-option:has(input:checked){border-color:#bba8ff;background:#faf8ff;box-shadow:0 0 0 1px rgba(124,87,255,.06)}
#modal:has(#wform) .waitlist-availability-option input{position:absolute;opacity:0;pointer-events:none}
.waitlist-radio-mark{width:18px;height:18px;box-sizing:border-box;border:1.7px solid #8c99ae;border-radius:50%;background:#fff}.waitlist-availability-option:has(input:checked) .waitlist-radio-mark{border:5px solid var(--violet)}
.waitlist-availability-option>svg{width:20px;height:20px;fill:none;stroke:var(--violet);stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.waitlist-availability-option strong{display:block;color:#26344a;font-size:13.5px;font-weight:600}.waitlist-availability-option small{display:block;margin-top:2px;color:#8795ad;font-size:11.5px;font-weight:400;line-height:1.35}
.waitlist-range-fields{display:grid;grid-template-columns:1fr 1fr;gap:18px}
#modal:has(#wform) .waitlist-range-fields input,#modal:has(#wform) .waitlist-range-fields .control-button,#modal:has(#wform) .waitlist-form-grid textarea{width:100%;min-height:48px;margin-top:8px;padding:10px 13px;border:1px solid #dce3ee;border-radius:13px;background:#fff;color:#172238;font-size:15px;box-sizing:border-box}
#modal:has(#wform) .waitlist-form-grid textarea{min-height:88px;resize:vertical}
#modal:has(#wform) .waitlist-range-fields input:focus,#modal:has(#wform) .waitlist-form-grid textarea:focus{border-color:#a991ff;box-shadow:0 0 0 3px rgba(124,87,255,.10);outline:none}
.waitlist-optional{color:#8a97ac;font-weight:400}#modal:has(#wform) .error{margin-top:12px}
#modal:has(#wform) .modalfoot{justify-content:space-between;align-items:center;gap:14px;margin-top:20px;padding-top:16px;border-top:1px solid #edf0f5}
#modal:has(#wform) .modalfoot .btn{min-height:42px;margin:0;padding:9px 17px;border-radius:11px;font-size:14px;font-weight:600}
#modal:has(#wform) .waitlist-cancel{min-width:112px;background:#fff!important;border-color:#dce3ee!important;color:#526079!important}
#modal:has(#wform) .waitlist-submit{min-width:210px;background:var(--violet)!important;border-color:var(--violet)!important;color:#fff!important;box-shadow:0 4px 12px rgba(124,87,255,.18)}
#modal:has(#wform) .waitlist-submit:hover{background:var(--violet-hover)!important;border-color:var(--violet-hover)!important}
/* Waitlist modal — fixed icon/text spacing after compact resize. */
#modal:has(#wform) .waitlist-control-shell>svg:first-child{
  left:18px!important;
  width:18px!important;
  height:18px!important;
}
#modal:has(#wform) .waitlist-control-shell select,#modal:has(#wform) .waitlist-control-shell .control-button{
  padding-left:58px!important;
}
#modal:has(#wform) .waitlist-date-control input[type="date"]{
  padding-left:58px!important;
}

/* Keep enhanced picker labels between the leading icon and a single chevron. */
#modal:has(#wform) .waitlist-control-shell .control-button{
  position:relative;
  min-width:0;
  text-align:left;
  white-space:normal;
}
#modal:has(#wform) .waitlist-control-shell .control-button::after{
  content:"";
  position:absolute;
  right:21px;
  top:50%;
  width:7px;
  height:7px;
  border-right:2px solid #687895;
  border-bottom:2px solid #687895;
  transform:translateY(-70%) rotate(45deg);
  pointer-events:none;
}
#modal:has(#wform) .waitlist-control-shell:has(> .control-button)>svg:last-child:not(:first-child){
  display:none;
}

@media(max-width:700px){#modal:has(#wform){padding:24px 20px;width:min(760px,calc(100% - 18px))}#modal:has(#wform) .modalhead h2{font-size:24px}.waitlist-form-grid{grid-template-columns:1fr}.waitlist-form-grid>.full{grid-column:1}#modal:has(#wform) .waitlist-availability{grid-template-columns:1fr}.waitlist-range-fields{grid-template-columns:1fr}.waitlist-service-meta{grid-template-columns:1fr}.waitlist-service-meta>div+div{border-left:0;border-top:1px solid #e4e8f0}#modal:has(#wform) .modalfoot{align-items:stretch;flex-direction:column-reverse}#modal:has(#wform) .modalfoot .btn{width:100%;min-width:0}}


/* Date picker — Esteja lilac visual language. */
#detail-dialog:has(.date-picker-grid){
  width:min(480px,calc(100vw - 32px));
  padding:26px 28px 28px;
  border:1px solid #e7e1ff;
  border-radius:24px;
  background:#fff;
  color:#172238;
  box-shadow:0 28px 90px rgba(23,34,56,.22);
}
#detail-dialog:has(.date-picker-grid)::backdrop{
  background:rgba(27,36,52,.42);
  backdrop-filter:blur(4px);
}
#detail-dialog:has(.date-picker-grid) .modalhead h2{
  color:#101828;
  font-family:var(--font-heading);
  font-weight:700;
}
#detail-dialog:has(.date-picker-grid) .close{
  border:1px solid #e2e6ee;
  background:#fff;
  color:#172238;
  outline:none;
  box-shadow:none;
}
#detail-dialog:has(.date-picker-grid) .close:hover{
  border-color:#cfc2ff;
  background:#faf8ff;
  color:#6f4df3;
}
#detail-dialog:has(.date-picker-grid) .close:focus-visible{
  outline:3px solid rgba(124,87,255,.20);
  outline-offset:2px;
}
#detail-dialog:has(.date-picker-grid) .picker-month{
  margin:18px 0 16px;
}
#detail-dialog:has(.date-picker-grid) .picker-month strong{
  color:#172238;
  font-size:18px;
  font-weight:700;
}
#detail-dialog:has(.date-picker-grid) .picker-month .iconbutton{
  width:38px;
  height:38px;
  min-width:38px;
  min-height:38px;
  border:1px solid #ded6ff;
  border-radius:11px;
  background:#faf8ff;
  color:var(--violet);
  box-shadow:none;
}
#detail-dialog:has(.date-picker-grid) .picker-month .iconbutton:hover{
  border-color:#bdaeff;
  background:#f2edff;
}
#detail-dialog:has(.date-picker-grid) .date-picker-grid{
  gap:7px;
}
#detail-dialog:has(.date-picker-grid) .date-picker-grid small{
  padding:8px 0;
  color:#8a97ad;
  font-size:12px;
  font-weight:600;
}
#detail-dialog:has(.date-picker-grid) .date-picker-grid button{
  min-height:44px;
  border:1px solid transparent;
  border-radius:11px;
  background:#f8f9fc;
  color:#34435d;
  font-weight:500;
  outline:none;
  box-shadow:none;
}
#detail-dialog:has(.date-picker-grid) .date-picker-grid button:hover{
  border-color:#cfc2ff;
  background:#f5f1ff;
  color:#6848ea;
  outline:none;
}
#detail-dialog:has(.date-picker-grid) .date-picker-grid button.selected{
  border-color:var(--violet);
  background:var(--violet);
  color:#fff;
  font-weight:700;
  box-shadow:0 5px 14px rgba(124,87,255,.22);
}
#detail-dialog:has(.date-picker-grid) .date-picker-grid button:focus-visible{
  outline:3px solid rgba(124,87,255,.18);
  outline-offset:1px;
}


/* Team picker — Esteja lilac visual language. */
#detail-dialog:has(.picker-options){
  width:min(480px,calc(100vw - 32px));
  padding:26px 28px 28px;
  border:1px solid #e7e1ff;
  border-radius:24px;
  background:#fff;
  color:#172238;
  box-shadow:0 28px 90px rgba(23,34,56,.22);
}
#detail-dialog:has(.picker-options)::backdrop{
  background:rgba(27,36,52,.42);
  backdrop-filter:blur(4px);
}
#detail-dialog:has(.picker-options) .modalhead h2{
  color:#101828;
  font-weight:700;
}
#detail-dialog:has(.picker-options) .close{
  border:1px solid #e2e6ee;
  background:#fff;
  color:#172238;
  outline:none;
  box-shadow:none;
}
#detail-dialog:has(.picker-options) .close:hover{
  border-color:#cfc2ff;
  background:#faf8ff;
  color:#6f4df3;
}
#detail-dialog:has(.picker-options) .close:focus-visible{
  outline:3px solid rgba(124,87,255,.18);
  outline-offset:2px;
}
#detail-dialog:has(.picker-options) .picker-options{
  gap:10px;
  margin-top:22px;
}
#detail-dialog:has(.picker-options) .picker-options .btn{
  min-height:48px;
  padding:12px 16px;
  border:1px solid #e1e6ef;
  border-radius:13px;
  background:#fff;
  color:#26344a;
  font-weight:600;
  box-shadow:none;
}
#detail-dialog:has(.picker-options) .picker-options .btn:hover{
  border-color:#cfc2ff;
  background:#f8f5ff;
  color:#6848ea;
}
#detail-dialog:has(.picker-options) .picker-options .btn.primary{
  border-color:var(--violet);
  background:var(--violet);
  color:#fff;
  box-shadow:0 5px 14px rgba(124,87,255,.20);
}
#detail-dialog:has(.picker-options) .picker-options .btn:focus-visible{
  outline:3px solid rgba(124,87,255,.16);
  outline-offset:2px;
}


/* Buoni regalo — approved compact heading and shared lilac palette. */
body:has(.vouchers-heading) .app-header{display:none}
body:has(.vouchers-heading) #main{padding:20px 26px 26px}
#main .vouchers-heading{
  display:flex;align-items:center;justify-content:space-between;
  flex-wrap:wrap;gap:16px 24px;margin-bottom:18px;
}
.vouchers-heading-copy{flex:1 1 540px;min-width:0}
#main .vouchers-heading h1{
  margin:0;font-family:var(--font-heading);font-size:26px;
  font-weight:700;line-height:1.2;letter-spacing:-.8px;color:var(--ink);
}
#main .vouchers-heading-copy p{
  margin:5px 0 0;font-family:var(--font-ui);
  font-size:13.5px;line-height:1.4;color:#59667d;
}
#main .vouchers-heading-add{
  display:inline-flex;align-items:center;justify-content:center;gap:9px;
  flex-shrink:0;min-height:38px;padding:8px 14px;
  border:1px solid var(--violet);border-radius:12px;
  background:var(--violet);color:#fff;font-family:var(--font-ui);
  font-size:15px;font-weight:500;line-height:1.35;
  box-shadow:0 3px 7px rgba(124,87,255,.18);
}
#main .vouchers-heading-add svg{flex-shrink:0}
#main .vouchers-heading-add:hover{background:var(--violet-hover);border-color:var(--violet-hover)}
#main:has(.vouchers-heading) .section-heading h2{
  font-family:var(--font-heading);font-size:18px;font-weight:600;line-height:1.35;
}
#main:has(.vouchers-heading) .count{
  font-family:var(--font-ui);font-size:12px;font-weight:500;line-height:1.3;
}
#main:has(.vouchers-heading) .voucher{font-family:var(--font-ui)}
#main:has(.vouchers-heading) .voucher h3{
  font-family:var(--font-heading);font-size:17px;font-weight:600;line-height:1.35;
}
#main:has(.vouchers-heading) .voucher .value{
  font-family:var(--font-heading);font-size:28px;font-weight:700;line-height:1.2;
}
#main:has(.vouchers-heading) .voucher p,#main:has(.vouchers-heading) .voucher small,#main:has(.vouchers-heading) .archive-heading p{
  font-size:13px;line-height:1.5;
}
#main:has(.vouchers-heading) .voucher .btn{
  min-height:38px;padding:8px 12px;border-radius:11px;
  font-size:13px;font-weight:500;line-height:1.35;
}
#main:has(.vouchers-heading) .voucher .btn.primary{
  background:var(--violet);border-color:var(--violet);color:#fff;
}
#main:has(.vouchers-heading) .voucher .btn.primary:hover{
  background:var(--violet-hover);border-color:var(--violet-hover);
}
#main:has(.vouchers-heading) .voucher .textbtn{color:#7048ef;font-size:13px}
#main:has(.vouchers-heading) .btn:focus-visible{outline:3px solid #ac95ff;outline-offset:3px}
body:not(.dark-mode) #main:has(.vouchers-heading) .voucher{
  background:#fff;border-color:#dfe7f0;
}
body:not(.dark-mode) #main:has(.vouchers-heading) .voucher .value{color:#1b1d2b}
body:not(.dark-mode) #main:has(.vouchers-heading) .voucher p,body:not(.dark-mode) #main:has(.vouchers-heading) .voucher small,body:not(.dark-mode) #main:has(.vouchers-heading) .archive-heading p{color:#59667d}
body:not(.dark-mode) #main:has(.vouchers-heading) .voucher .btn:not(.primary){
  background:#fff;border-color:#dfe3e8;color:#1b1d2b;
}
body:not(.dark-mode) #main:has(.vouchers-heading) .voucher .badge{
  background:#eaf8f2;color:#237a58;font-size:11.5px;font-weight:600;line-height:1.3;
}
body:not(.dark-mode) #main:has(.vouchers-heading) .used-voucher{background:#f8fafc;opacity:1}
body:not(.dark-mode) #main:has(.vouchers-heading) .used-voucher .badge{
  background:#eef1f6;color:#64748b;
}
body:not(.dark-mode) #main:has(.vouchers-heading) .count{
  background:#f6f2ff;border-color:#e5dcff;color:var(--violet-text);
}
body:not(.dark-mode) #main:has(.vouchers-heading) .archive-heading{border-color:#e3e9f1}
@media(max-width:700px){
  #main .vouchers-heading{align-items:flex-start;gap:16px}
  .vouchers-heading-copy{flex-basis:100%}
}


/* Gift vouchers — reference card layout,using Esteja's approved type and colours. */
#main:has(.vouchers-heading) .vouchers-heading{align-items:center;margin-bottom:28px}
#main:has(.vouchers-heading) .vouchers-heading-copy{flex:1 1 480px}
#main:has(.vouchers-heading) .vouchers-heading-copy p{max-width:780px}
.gift-title-line{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.gift-total{padding:3px 10px;border:1px solid #e5dcff;border-radius:999px;background:#f6f2ff;color:var(--violet-text);font-size:12px;line-height:1.35;white-space:nowrap}
.gift-heading-actions,.services-heading-actions{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
/* Impostazioni → Il tuo account: privacy link styled as a button, beside Esci. */
.settings-account-actions{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.settings-account-actions a.btn{display:inline-flex;align-items:center;text-decoration:none}
#main .gift-export,#main .services-export{display:inline-flex;align-items:center;justify-content:center;gap:9px;min-height:38px;padding:8px 14px;border:1px solid #dfe7f0;border-radius:12px;background:var(--surface);color:var(--ink);font-size:13px;font-weight:500;line-height:1.35}
.gift-heading-actions svg,.services-heading-actions svg{flex-shrink:0}
.gift-toolbar{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:28px;padding:10px 14px;border:1px solid #e3e9f1;border-radius:14px;background:var(--surface);box-shadow:0 3px 10px rgba(30,45,68,.035)}
.gift-toolbar .gift-search{position:relative;display:flex;align-items:center;flex:1 1 300px;min-width:220px;margin:0;font-weight:400}
.gift-toolbar .gift-search svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0;position:absolute;left:13px;color:#93a5bf;pointer-events:none}
.gift-toolbar .gift-search input[type="search"]{box-sizing:border-box;width:100%;height:38px;min-height:38px;margin:0;padding:0 12px 0 38px;border:1px solid #dfe7f0;border-radius:10px;outline:none;background:#f8fafc;color:#40506a;font-family:var(--font-ui,inherit);font-size:13px;font-weight:400;line-height:normal;box-shadow:none}
.gift-toolbar .gift-search input[type="search"]::placeholder{color:#7a879b;font-weight:400;opacity:1}
.gift-toolbar .gift-search input[type="search"]:focus{border-color:#a994ed;box-shadow:0 0 0 2px #ede7ff}
.gift-filters{display:flex;align-items:center;flex-wrap:wrap;flex-shrink:0;gap:8px}
.gift-filters button{height:38px;min-height:38px;flex:0 0 auto;padding:0 13px;border:1px solid #e1e7ef;border-radius:10px;background:#f8fafc;color:#485870;font:inherit;font-size:13px;font-weight:400;cursor:pointer;white-space:nowrap}
.gift-filters button:hover{background:#f8f5ff;border-color:#d7caff}
.gift-filters button[aria-pressed="true"]{border-color:#ddd3ff;background:#f5f2ff;color:#714af4;font-weight:600}
.gift-sort{display:flex;align-items:center;flex-shrink:0;gap:10px;margin-left:auto;color:#59667d;font-size:12px}
.gift-sort-menu{position:relative;min-width:170px}
.gift-sort-menu summary{display:flex;align-items:center;justify-content:space-between;gap:14px;min-height:36px;padding:7px 12px;box-sizing:border-box;list-style:none;border:1px solid #dfe7f0;border-radius:10px;background:var(--surface);color:var(--ink);cursor:pointer}
.gift-sort-menu summary::-webkit-details-marker{display:none}
.gift-sort-menu summary svg{width:16px;height:16px;flex-shrink:0;color:#71819d}
.gift-sort-options{position:absolute;right:0;top:calc(100% + 6px);z-index:10;display:grid;gap:3px;min-width:100%;padding:5px;border:1px solid #e3dafa;border-radius:12px;background:var(--surface);box-shadow:0 10px 24px rgba(30,45,68,.12)}
.gift-sort-options button{padding:9px 12px;border:0;border-radius:7px;background:transparent;color:var(--ink);font:inherit;text-align:left;white-space:nowrap;cursor:pointer}
.gift-sort-options button:hover,.gift-sort-options button[aria-pressed="true"]{background:#f6f2ff;color:#7048ef}
.gift-section-heading{margin:0 0 18px}
#main .gift-section-heading h2{display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin:0;font-family:var(--font-heading);font-size:18px;font-weight:600;line-height:1.35;color:var(--ink)}
.gift-section-heading h2 span{padding:3px 8px;border:1px solid #bfead7;border-radius:5px;background:#edfbf4;color:var(--ds-success);font-family:var(--font-ui);font-size:12px;font-weight:500;line-height:1.25}
#main .gift-section-heading p{margin:6px 0 0;color:#59667d;font-size:12.5px;line-height:1.45}
.gift-cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px;align-items:start}
#main:has(.vouchers-heading) .gift-card{display:flex;flex-direction:column;min-width:0;padding:20px;border:1px solid #dfe7f0;border-radius:16px;background:var(--surface);box-shadow:0 2px 8px rgba(30,45,68,.025)}
.gift-card-head{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:10px;min-height:30px;margin-bottom:20px}
.gift-code{display:inline-flex;align-items:center;gap:8px;max-width:100%;min-width:0;padding:7px 10px;border:1px solid #dfe7f0;border-radius:7px;background:#f8fafc;color:#26344a;font-family:var(--font-ui);font-size:12px;font-weight:700;letter-spacing:.7px;line-height:1.2;cursor:pointer}
.gift-code span{min-width:0;overflow-wrap:anywhere;text-align:left}
.gift-code svg{width:14px;height:14px;flex:0 0 14px;color:#92a3bd}
.gift-code:hover{border-color:#c9baff;background:#f8f5ff}
.gift-status{display:inline-flex;align-items:center;gap:5px;padding:4px 9px;border:1px solid;border-radius:999px;font-size:11px;font-weight:500;line-height:1.3;white-space:nowrap}
.gift-status::before{content:"";width:5px;height:5px;flex:0 0 5px;border-radius:50%;background:currentColor}
.gift-status-available{background:#ecfbf4;border-color:#a9e9cb;color:var(--ds-success)}
.gift-status-partial{background:#fffbeb;border-color:#f8dd85;color:#ae650a}
.gift-status-exhausted{background:#f1f4f8;border-color:#dce3ed;color:#71819d}
.gift-balance{display:flex;align-items:baseline;flex-wrap:wrap;gap:10px;min-width:0}
#main .gift-balance strong{font-family:var(--font-heading);font-size:32px;font-weight:700;line-height:1.2;letter-spacing:-.8px;color:var(--ink);overflow-wrap:anywhere}
.gift-balance>span{font-size:12px;color:#59667d;line-height:1.4}
.gift-card-partial .gift-balance>span{color:#b46c18}
#main:has(.vouchers-heading) .gift-card .gift-balance-caption{margin:5px 0 14px;color:#93a4bf;font-size:11.5px;line-height:1.4}
.gift-balance-progress{display:block;appearance:none;-webkit-appearance:none;width:100%;height:5px;border:0;border-radius:999px;overflow:hidden;background:#eff3f8;color:#21b77a}
.gift-balance-progress::-webkit-progress-bar{background:#eff3f8;border-radius:999px}
.gift-balance-progress::-webkit-progress-value{background:#21b77a;border-radius:999px}
.gift-balance-progress::-moz-progress-bar{background:#21b77a;border-radius:999px}
.gift-card-partial .gift-balance-progress{color:#efa30b}
.gift-card-partial .gift-balance-progress::-webkit-progress-value{background:#efa30b}
.gift-card-partial .gift-balance-progress::-moz-progress-bar{background:#efa30b}
.gift-details{display:grid;gap:10px;margin:18px 0 14px;padding-top:14px;border-top:1px solid #edf1f7}
.gift-details>div{display:grid;grid-template-columns:minmax(0,.8fr) minmax(0,1.2fr);align-items:baseline;gap:10px;font-size:12px;line-height:1.4}
.gift-details dt{color:#59667d}
.gift-details dd{margin:0;color:var(--ink);text-align:right;overflow-wrap:anywhere;font-weight:500}
.gift-card-extra{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:10px;margin-bottom:18px}
.gift-scope{padding:4px 7px;border:1px solid #dfd3ff;border-radius:5px;background:#f7f3ff;color:var(--violet-text);font-size:11px;line-height:1.3}
.gift-last-use{font-size:10.5px;line-height:1.4;color:#526079;font-weight:600}
/* Notes stay compact; expanding one voucher never stretches its neighbours. */
.gift-note{min-width:0;margin:0 0 12px;font-family:var(--font-ui)}
.gift-note summary{display:flex;align-items:center;gap:7px;min-width:0;padding:4px 0;list-style:none;color:#738099;font-size:12px;font-weight:400;line-height:1.5;cursor:pointer}
.gift-note summary::-webkit-details-marker{display:none}
.gift-note-label{flex:0 0 auto;color:#73618e;font-weight:500}
.gift-note-preview{flex:1;min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.gift-note summary>svg{width:14px;height:14px;flex:0 0 14px;color:#9987b7;transition:transform .15s ease}
.gift-note summary:hover{color:#605279}
.gift-note summary:focus-visible{outline:2px solid #b5a2f7;outline-offset:3px;border-radius:4px}
.gift-note[open] .gift-note-preview{visibility:hidden}
.gift-note[open] summary>svg{transform:rotate(180deg)}
#main:has(.vouchers-heading) .gift-note .gift-note-full{margin:5px 0 0;padding-left:10px;border-left:2px solid #e6ddfa;color:#69758b;font-size:12px;font-weight:400;line-height:1.55;white-space:pre-wrap;overflow-wrap:anywhere}
@media(prefers-reduced-motion:reduce){.gift-note summary>svg{transition:none}}
.gift-card-actions{display:grid;gap:8px;margin-top:auto;padding-top:12px;border-top:1px solid #edf1f7}
.gift-secondary-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
#main:has(.vouchers-heading) .gift-card .btn{display:flex;align-items:center;justify-content:center;gap:7px;min-width:0;width:100%;min-height:36px;margin:0;padding:8px 10px;font-size:12px;font-weight:500;line-height:1.3;white-space:normal}
#main:has(.vouchers-heading) .gift-card .btn svg{width:16px;height:16px;flex:0 0 16px}
body:not(.dark-mode) #main:has(.vouchers-heading) .gift-secondary-actions .btn{background:#f8fafc;color:#40506a;border-color:#dfe7f0}
#main:has(.vouchers-heading) .gift-card .gift-redeem{min-height:38px;background:var(--violet);border-color:var(--violet);color:#fff}
#main:has(.vouchers-heading) .gift-card .gift-redeem:hover{background:var(--violet-hover);border-color:var(--violet-hover)}
#main:has(.vouchers-heading) .gift-card .gift-restore{display:flex;align-items:center;justify-content:center;gap:6px;min-height:28px;padding:4px;margin:0;color:#8292ac;font-size:11px;line-height:1.3}
.gift-restore svg{width:14px;height:14px;flex-shrink:0}
.gift-create-card{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;min-width:0;min-height:320px;padding:28px 20px;border:2px dashed #ced8e6;border-radius:16px;background:transparent;color:#59667d;font-family:var(--font-ui);font-size:12.5px;line-height:1.6;text-align:center;cursor:pointer}
.gift-create-icon{display:grid;place-items:center;width:56px;height:56px;margin-bottom:3px;border:1px solid #dfe7f0;border-radius:50%;background:var(--surface);color:var(--violet)}
.gift-create-icon svg{width:25px;height:25px}
.gift-create-card strong{font-family:var(--font-heading);font-size:16px;font-weight:600;color:var(--ink)}
.gift-create-link{display:flex;align-items:center;gap:6px;margin-top:8px;color:var(--violet-text);font-weight:500}
.gift-create-card:hover{border-color:#b5a2f7;background:rgba(124,87,255,.025)}
.gift-archive{margin-top:30px;padding-top:24px;border-top:1px solid #dfe7f0}
.gift-archive .gift-section-heading h2 span{background:#f1f4f8;border-color:#dce3ed;color:#71819d}
.gift-empty{padding:28px;text-align:center;color:#71819d}
.gift-filters button:focus-visible,.gift-sort-menu summary:focus-visible,.gift-sort-options button:focus-visible,.gift-code:focus-visible,.gift-create-card:focus-visible{outline:3px solid #ac95ff;outline-offset:3px}

@media(max-width:1250px){.gift-cards{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:1400px){.gift-toolbar{flex-wrap:wrap}.gift-toolbar .gift-search{flex:1 1 calc(100% - 260px)}.gift-filters{order:3;flex:1 1 100%}}
@media(max-width:750px){.gift-cards{grid-template-columns:minmax(0,1fr)}.gift-create-card{min-height:220px}.gift-heading-actions{width:100%}.gift-heading-actions>.btn{flex:1}.gift-toolbar .gift-search{flex:1 1 100%;min-width:0}.gift-sort{margin-left:0}.gift-toolbar{gap:14px}.gift-title-line{gap:8px}.gift-card-head{margin-bottom:16px}}

/* Voucher dialogs: shared lilac palette and typography,isolated from other forms. */
#modal:has(#vform,#redeem-form,.gift-info-status,.gift-restore-copy){background:#fff;color:#252532;border-color:#e1e5ef;font-family:var(--font-ui,'DM Sans',sans-serif);font-size:14px;line-height:1.55}
#modal:has(#vform,#redeem-form,.gift-info-status,.gift-restore-copy) .modalhead h2{color:#20202c;font-family:var(--font-heading,'Manrope',sans-serif);font-size:24px;font-weight:700;line-height:1.3;letter-spacing:-.5px}
#modal:has(#vform,#redeem-form,.gift-info-status,.gift-restore-copy) h3{color:#303044;font-family:var(--font-heading,'Manrope',sans-serif);font-size:16px;font-weight:650;line-height:1.4}
#modal:has(#vform,#redeem-form,.gift-info-status,.gift-restore-copy) p,#modal:has(#vform,#redeem-form,.gift-info-status,.gift-restore-copy) label,#modal:has(#vform,#redeem-form,.gift-info-status,.gift-restore-copy) .minirow{font-family:var(--font-ui,'DM Sans',sans-serif);font-size:14px;line-height:1.55}
#modal:has(#vform,#redeem-form,.gift-info-status,.gift-restore-copy) label{color:#555e73;font-weight:500}
#modal:has(#vform,#redeem-form,.gift-info-status,.gift-restore-copy) .sub,#modal:has(#vform,#redeem-form,.gift-info-status,.gift-restore-copy) .minirow>span{color:#738099}
#modal:has(#vform,#redeem-form,.gift-info-status,.gift-restore-copy) strong{font-weight:600}
#modal:has(#vform,#redeem-form,.gift-info-status,.gift-restore-copy) input,#modal:has(#vform,#redeem-form,.gift-info-status,.gift-restore-copy) select,#modal:has(#vform,#redeem-form,.gift-info-status,.gift-restore-copy) textarea,#modal:has(#vform,#redeem-form,.gift-info-status,.gift-restore-copy) .control-button{background:#fff;color:#30364a;border-color:#dfe4ef;font-family:var(--font-ui,'DM Sans',sans-serif);font-size:14px;font-weight:400}
#modal:has(#vform,#redeem-form,.gift-info-status,.gift-restore-copy) .btn{font-family:var(--font-ui,'DM Sans',sans-serif);font-size:14px;font-weight:600;border-radius:11px}
#modal:has(#vform,#redeem-form,.gift-info-status,.gift-restore-copy) .btn:not(.primary){background:#fff;border-color:#dfe4ef;color:#555e73}
#modal:has(#vform,#redeem-form,.gift-info-status,.gift-restore-copy) .btn:not(.primary):hover{background:#f8f6ff;border-color:#d6cbfc;color:#6848d8}
#modal:has(#vform,#redeem-form,.gift-info-status,.gift-restore-copy) .btn.primary{background:var(--violet)!important;border-color:var(--violet)!important;color:#fff!important;box-shadow:0 4px 12px rgb(118 87 246 / 14%)}
#modal:has(#vform,#redeem-form,.gift-info-status,.gift-restore-copy) .btn.primary:hover{background:var(--violet-hover)!important;border-color:var(--violet-hover)!important}
#modal:has(#vform,#redeem-form,.gift-info-status,.gift-restore-copy) .new-client-button,#modal:has(#vform,#redeem-form,.gift-info-status,.gift-restore-copy) .label-line .textbtn{background:#f4f0ff!important;border-color:#ded4ff!important;color:#7050dd!important;box-shadow:none}
#modal:has(#vform,#redeem-form,.gift-info-status,.gift-restore-copy) .close{background:#f5f2ff;color:#7657dc;border-color:#e4dcff}
#modal:has(#vform,#redeem-form,.gift-info-status,.gift-restore-copy) :is(button,input,select,textarea,summary):focus-visible{outline:2px solid #a58aef!important;outline-offset:3px;box-shadow:none}
#modal:has(#vform,#redeem-form,.gift-info-status,.gift-restore-copy) :is(input,select,textarea):focus,#modal:has(#vform,#redeem-form,.gift-info-status,.gift-restore-copy) .control-button:focus-visible{border-color:#a58aef!important;box-shadow:0 0 0 3px rgb(118 87 246 / 10%)}
#modal:has(#vform,#redeem-form,.gift-info-status,.gift-restore-copy) .gift-info-status{background:#f1ecff;color:#7050d6;border:1px solid #e0d5ff;font-family:var(--font-ui,'DM Sans',sans-serif);font-size:12px;font-weight:600}

/* Complete voucher interaction colors without changing form layouts. */
#modal:has(#vform,#redeem-form,.gift-info-status,.gift-restore-copy){
  --brand:var(--violet);
  --accent:#eee8ff;
  --ds-brand:var(--violet);
  --ds-line-strong:#cfc1fb;
  accent-color:var(--violet);
}
#modal:has(#vform,#redeem-form,.gift-info-status,.gift-restore-copy) :is(input,textarea)::placeholder{color:#8b94a8;opacity:1}
#modal:has(#vform,#redeem-form,.gift-info-status,.gift-restore-copy) :is(input,select,textarea,.control-button):hover:not(:focus):not(:disabled){border-color:#cfc1eb}
#modal:has(#vform,#redeem-form,.gift-info-status,.gift-restore-copy) select option{font-family:var(--font-ui,'DM Sans',sans-serif);background:#fff;color:#30364a;font-weight:400}
#modal:has(#vform,#redeem-form,.gift-info-status,.gift-restore-copy) .label-line .btn.primary.new-client-button,#modal:has(#vform,#redeem-form,.gift-info-status,.gift-restore-copy) .label-line .textbtn{background:#f4f0ff!important;border-color:#ded4ff!important;color:#7050dd!important;box-shadow:none}
#modal:has(#vform,#redeem-form,.gift-info-status,.gift-restore-copy) .label-line .btn.primary.new-client-button:hover,#modal:has(#vform,#redeem-form,.gift-info-status,.gift-restore-copy) .label-line .textbtn:hover{background:#ebe3ff!important;border-color:#cdbdf8!important;color:#6242c5!important;box-shadow:none}
#modal:has(#vform,#redeem-form,.gift-info-status,.gift-restore-copy) .close:hover{background:#ece5ff;color:#6848d8;border-color:#d7c9fa}
#modal:has(#vform,#redeem-form,.gift-info-status,.gift-restore-copy) :is(.btn,.close,.textbtn):focus-visible{outline-color:#a58aef}
#modal:has(#vform,#redeem-form,.gift-info-status,.gift-restore-copy) .minirow{border-color:#e8eaf2}
#modal:has(#vform,#redeem-form,.gift-info-status,.gift-restore-copy) .gift-restore-copy{color:#596278;font-weight:400}
#modal:has(#vform,#redeem-form,.gift-info-status,.gift-restore-copy) .error{color:#a34257;font-size:13px;font-weight:500}
#modal:has(#vform,#redeem-form,.gift-info-status,.gift-restore-copy) .btn.primary:disabled{opacity:.55;box-shadow:none;cursor:not-allowed}

/* Optional voucher expiry,matching the existing compact presentation. */
.gift-expiry{margin:0 0 12px;font-family:var(--font-ui);font-size:11.5px;line-height:1.5;color:#ad5967;font-weight:500}
.gift-expiry strong{font-weight:600}
.gift-expiry.is-expired{color:#a45363}
.gift-status-expired{background:#fff0f2;border:1px solid #f1d7dd;color:#a45363}
.gift-card-expired .gift-balance>span{color:#a45363}
.gift-card-expired .gift-balance-progress{color:#bd9ba6}
.gift-card-expired .gift-balance-progress::-webkit-progress-value{background:#bd9ba6}
.gift-card-expired .gift-balance-progress::-moz-progress-bar{background:#bd9ba6}
#vform .gift-expiry-field small{display:block;margin-top:6px;font-size:12px;font-weight:400;line-height:1.5;color:#738099}
#modal:has(#vform) .gift-expiry-field .label-line .gift-clear-expiry{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;min-height:36px;max-width:100%;padding:8px 14px;border:1px solid #ded4ff;border-radius:10px;font-size:13px;font-weight:500;line-height:1.4;white-space:normal;text-align:center;box-sizing:border-box}
#vform .gift-expiry-field .label-line{gap:10px 16px}

/* Voucher cards share the quiet lilac hover used for clients and treatments. */
body #main:has(.vouchers-heading) .gift-card{transition:border-color .18s ease,box-shadow .18s ease}
@media(any-hover:hover) and (any-pointer:fine){
  body #main:has(.vouchers-heading) .gift-card:hover{
    border-color:#b5a2f7;
    box-shadow:0 0 0 1px rgba(124,87,255,.10),0 4px 16px rgba(124,87,255,.07);
  }
}
@media(prefers-reduced-motion:reduce){
  body #main:has(.vouchers-heading) .gift-card{transition:none}
}

/* Team — match the approved compact white and lilac pages. */
body:has(.team-heading) .app-header{display:none}
body:has(.team-heading) #main{padding:20px 26px 26px}
#main .team-heading{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:16px 24px;margin-bottom:22px}
.team-heading-copy{flex:1 1 460px;min-width:0}
#main .team-heading h1{margin:0;font-family:var(--font-heading);font-size:26px;font-weight:700;line-height:1.2;letter-spacing:-.8px;color:var(--ink)}
#main .team-heading-copy p{margin:5px 0 0;font-family:var(--font-ui);font-size:13.5px;line-height:1.4;color:#59667d}
#main:has(.team-heading) .team-cards{gap:18px;align-items:start}
#main:has(.team-heading) .team-cards .card{min-width:0;padding:20px;border:1px solid #dfe7f0;border-radius:16px;background:#fff;box-shadow:0 2px 8px rgba(30,45,68,.025);font-family:var(--font-ui);transition:border-color .18s ease,box-shadow .18s ease}
#main:has(.team-heading) .team-card .avatar{width:44px;height:44px;background:#eee8ff;color:var(--violet-text);font-size:17px;font-weight:600}
#main:has(.team-heading) .team-cards h3{margin:12px 0 5px;font-family:var(--font-heading);font-size:17px;font-weight:600;line-height:1.35;letter-spacing:-.3px;color:#252532}
#main:has(.team-heading) .team-cards p,#main:has(.team-heading) .team-cards small{font-size:13px;font-weight:400;line-height:1.5;color:#71819d}
#main:has(.team-heading) .team-card .team-contact{margin:12px 0 0;overflow-wrap:anywhere}
#main:has(.team-heading) .team-card .card-divider{margin:16px 0;border-color:#e8edf5;background:#e8edf5}
#main:has(.team-heading) .team-card .skill-tags{gap:6px;margin-top:9px}
#main:has(.team-heading) .team-card .skill-tags span{padding:5px 8px;border:1px solid #e6eaf2;border-radius:7px;background:#f8fafc;color:#59667d;font-size:12px;font-weight:400;line-height:1.4;overflow-wrap:anywhere}
#main:has(.team-heading) .team-card .actions{gap:8px;margin-top:16px}
#main:has(.team-heading) .team-cards :is(.btn,.textbtn){min-height:36px;padding:8px 12px;border:1px solid #dfe4ef;border-radius:10px;font-family:var(--font-ui);font-size:13px;font-weight:500;line-height:1.35;white-space:normal}
#main:has(.team-heading) .team-cards .team-edit{background:var(--violet);border-color:var(--violet);color:#fff}
#main:has(.team-heading) .team-cards .team-edit:hover{background:var(--violet-hover);border-color:var(--violet-hover)}
#main:has(.team-heading) .team-cards .danger{background:#fff4f5;border-color:#f0dce1;color:#a45363}
#main:has(.team-heading) .team-cards .danger:hover{background:#fce8ec;border-color:#e5bec9}
#main:has(.team-heading) .team-cards .used-voucher{opacity:1;background:#f8fafc}
#main:has(.team-heading) .team-cards .used-voucher .btn{background:#f4f0ff;border-color:#ded4ff;color:#7050dd}
#main:has(.team-heading) .archive-heading h2{font-family:var(--font-heading);font-size:18px;font-weight:600;line-height:1.35}
#main:has(.team-heading) :is(.btn,.textbtn):focus-visible{outline:2px solid #ac95ff;outline-offset:3px}
#modal:has(#tform){font-family:var(--font-ui);color:var(--ink);background:var(--surface);border-color:#e1e5ef}
#modal:has(#tform) .modalhead h2{font-family:var(--font-heading);font-size:24px;font-weight:700;line-height:1.3;letter-spacing:-.5px}
#modal:has(#tform) :is(label,input,select,textarea,p){font-family:var(--font-ui);font-size:14px;line-height:1.5}
#modal:has(#tform) label{font-weight:500}
#modal:has(#tform) .sub{color:#738099;font-weight:400}
#modal:has(#tform) .modalfoot .btn{font-size:14px;font-weight:500;border-radius:11px}
#modal:has(#tform) .modalfoot .btn.primary{background:var(--violet);border-color:var(--violet);color:#fff}
#modal:has(#tform) .modalfoot .btn.primary:hover{background:var(--violet-hover);border-color:var(--violet-hover)}
#modal:has(#tform) input{accent-color:var(--violet)}
#modal:has(#tform) :is(input,button):focus-visible{outline:2px solid #ac95ff;outline-offset:2px}
@media(any-hover:hover) and (any-pointer:fine){body #main:has(.team-heading) .team-cards .team-card:hover{border-color:#b5a2f7;box-shadow:0 0 0 1px rgba(124,87,255,.10),0 4px 16px rgba(124,87,255,.07)}}
@media(prefers-reduced-motion:reduce){#main:has(.team-heading) .team-cards .card{transition:none}}
@media(max-width:700px){#main .team-heading{gap:14px}.team-heading-copy{flex-basis:100%}}

/* Team reference layout: compact identity,contact rows and aligned actions. */
#main .team-title-row{display:flex;align-items:center;flex-wrap:wrap;gap:10px 12px}
#main .team-count,#main .team-status{display:inline-flex;align-items:center;justify-content:center;padding:3px 9px;border:1px solid #c9efdf;border-radius:20px;background:#effbf5;color:#2b8063;font-family:var(--font-ui);font-size:12px;font-weight:500;line-height:1.5;white-space:nowrap}
#main:has(.team-heading) .team-active-cards{grid-template-columns:repeat(3,minmax(0,1fr));align-items:stretch}
#main:has(.team-heading) .team-card{display:flex;flex-direction:column;min-width:0}
#main:has(.team-heading) .team-profile{display:flex;align-items:flex-start;gap:12px;min-width:0}
#main:has(.team-heading) .team-profile .avatar{flex:0 0 46px;width:46px;height:46px;border:1px solid #e4dbff;border-radius:15px}
#main:has(.team-heading) .team-identity{flex:1;min-width:0}
#main:has(.team-heading) .team-profile h3{margin:0 0 4px;overflow-wrap:anywhere}
#main:has(.team-heading) .team-profile .team-role{display:inline-block;max-width:100%;margin:0;padding:2px 7px;border-radius:6px;background:#f2f5f9;color:#59667d;font-size:12px;line-height:1.4;overflow-wrap:anywhere}
#main:has(.team-heading) .team-status{flex:none;margin-top:1px;padding:2px 8px;font-size:11px}
#main:has(.team-heading) .team-contacts{display:grid;gap:9px;margin:18px 0;padding:16px 0;border-top:1px solid #edf0f6;border-bottom:1px solid #edf0f6}
#main:has(.team-heading) .team-card .team-contact{display:flex;align-items:flex-start;gap:10px;margin:0;min-width:0;color:#59667d;font-size:13px;line-height:1.5}
#main:has(.team-heading) .team-contact svg{flex:0 0 17px;width:17px;height:17px;margin-top:1px;color:#99a9bf}
#main:has(.team-heading) .team-contact span{min-width:0;overflow-wrap:anywhere}
#main:has(.team-heading) .team-contact.is-missing{color:#59667d;font-style:italic}
#main:has(.team-heading) .team-skills{flex:1;min-width:0}
#main:has(.team-heading) .team-skills-heading{display:flex;justify-content:space-between;align-items:baseline;flex-wrap:wrap;gap:4px 10px}
#main:has(.team-heading) .team-skills-heading h4{margin:0;color:#526079;font-family:var(--font-ui);font-size:12.5px;line-height:1.5;font-weight:600}
#main:has(.team-heading) .team-skills-heading>span{color:#59667d;font-size:10px;line-height:1.5;text-transform:uppercase;letter-spacing:.3px}
#main:has(.team-heading) .team-card .skill-tags{display:flex;flex-wrap:wrap;align-items:flex-start;gap:6px;margin-top:12px}
#main:has(.team-heading) .team-card .skill-tags>span{background:#f2f5f9;border:0;padding:5px 9px;border-radius:8px;font-size:12px;line-height:1.4}
#main:has(.team-heading) .team-skills-empty{width:100%;box-sizing:border-box;margin:0;padding:15px 12px;border:1px dashed #dfe6f0;border-radius:12px;background:#fafbfe;text-align:center;font-size:12px;line-height:1.5}
#main:has(.team-heading) .team-card .team-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:22px;padding-top:14px;border-top:1px solid #edf0f6}
#main:has(.team-heading) .team-actions :is(.btn,.textbtn){display:flex;align-items:center;justify-content:center;width:100%;min-width:0;padding:8px 6px;font-size:12px;text-align:center}
@media(max-width:1200px){#main:has(.team-heading) .team-active-cards{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:820px){#main:has(.team-heading) .team-active-cards{grid-template-columns:minmax(0,1fr)}}


/* Team — Esteja lilac confirmation actions. */
#modal:has(.team-archive-confirm) .team-archive-submit{
  background:var(--violet)!important;
  border-color:var(--violet)!important;
  color:#fff!important;
  box-shadow:0 5px 14px rgba(124,87,255,.18);
}
#modal:has(.team-archive-confirm) .team-archive-submit:hover{
  background:var(--violet-hover)!important;
  border-color:var(--violet-hover)!important;
}
#modal:has(.team-archive-confirm) .team-archive-cancel{
  background:#fff!important;
  border-color:#d9ceff!important;
  color:#6848ea!important;
}
#modal:has(.team-archive-confirm) .team-archive-cancel:hover{
  background:#f8f5ff!important;
  border-color:#c8b7ff!important;
}


/* Team — operator notes. */
#main:has(.team-heading) .team-card .team-actions{
  grid-template-columns:minmax(0,1fr) 38px minmax(0,1fr);
}
#main:has(.team-heading) .team-actions .team-note-button{
  width:38px;
  min-width:38px;
  height:36px;
  min-height:36px;
  padding:0;
  color:var(--violet-text);
  background:#f7f4ff;
  border-color:#ddd3ff;
}
#main:has(.team-heading) .team-actions .team-note-button:hover{
  background:#eee9ff;
  border-color:#c9baff;
}
#main:has(.team-heading) .team-actions .team-note-button svg{
  display:block;
  flex:0 0 18px;
}
#modal:has(#tform) .team-note-field textarea{
  min-height:96px;
  resize:vertical;
}
#modal:has(#tform) #team-shifts-days{margin-top:4px}
#modal:has(#tform) .team-shift-row{padding:12px 0}
#modal:has(#tform) .team-shift-day{display:flex;align-items:center;gap:10px;margin:0;font-size:14px;font-weight:400}
#modal:has(#tform) .team-shift-times{grid-template-columns:repeat(2,minmax(130px,160px));gap:14px}
@media(max-width:620px){
  #modal:has(#tform) .team-shift-times{grid-template-columns:1fr 1fr}
}
/* Date/time picker popup (#detail-dialog): same accent as the "Nuovo appuntamento" wizard,site-wide. */
.control-button:hover{border-color:var(--violet);background:#f3efff}
.control-button:focus-visible{outline-color:var(--violet)}
.date-picker-grid button:hover,.time-picker-grid button:hover{outline-color:var(--violet)}
.date-picker-grid .selected,.time-picker-grid .selected{background:var(--violet)}
.chosen-time{color:var(--violet-text)}
#modal:has(.team-note-view){
  width:min(500px,calc(100% - 30px));
}
#modal:has(.team-note-view) .team-note-view{
  padding:4px 2px 8px;
}
#modal:has(.team-note-view) .team-note-view p{
  margin:0;
  padding:16px 18px;
  border:1px solid #e4e8f0;
  border-radius:13px;
  background:#f8fafc;
  color:#34435c;
  font-family:var(--font-ui);
  font-size:14px;
  line-height:1.65;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
}


/* Team — distinct role badge; keep equal-height cards. */
#main:has(.team-heading) .team-profile .team-role{
  background:#fff7df;
  border:1px solid #f1d88f;
  color:var(--ds-warning);
  font-weight:500;
}
#main:has(.team-heading) .team-active-cards{
  align-items:stretch;
}
#main:has(.team-heading) .team-card{
  align-self:stretch;
}
#main:has(.team-heading) .team-skills{
  flex:1;
}


/* Team — compact treatment preview with full-list modal. */
#main:has(.team-heading) .team-card .skill-tags>span{
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
#main:has(.team-heading) .team-skills-more{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:38px;
  min-height:30px;
  padding:5px 10px;
  border:1px solid #ddd2ff;
  border-radius:9px;
  background:#f3efff;
  color:#6d4ee8;
  font-family:var(--font-ui);
  font-size:12px;
  font-weight:700;
  line-height:1.3;
  cursor:pointer;
}
#main:has(.team-heading) .team-skills-more:hover{
  border-color:#c6b5ff;
  background:#ece5ff;
}
#modal:has(.team-skills-dialog){
  width:min(520px,calc(100% - 30px));
}
#modal:has(.team-skills-dialog) .team-skills-dialog{
  padding:2px 0 8px;
}
#modal:has(.team-skills-dialog) .team-skills-dialog-person{
  margin:0 0 14px;
  color:#7c89a0;
  font-size:13px;
}
#modal:has(.team-skills-dialog) .team-skills-dialog-tags{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}
#modal:has(.team-skills-dialog) .team-skills-dialog-tags span{
  display:inline-flex;
  align-items:center;
  max-width:100%;
  padding:7px 10px;
  border-radius:9px;
  background:#f2f5f9;
  color:#59667d;
  font-size:13px;
  line-height:1.4;
  overflow-wrap:anywhere;
}


/* Team — reassignment warning uses Esteja colors. */
#modal:has(.team-reassign-warning) .team-reassign-ok{
  background:var(--violet)!important;
  border-color:var(--violet)!important;
  color:#fff!important;
  box-shadow:0 5px 14px rgba(124,87,255,.18);
}
#modal:has(.team-reassign-warning) .team-reassign-ok:hover{
  background:var(--violet-hover)!important;
  border-color:var(--violet-hover)!important;
}
#modal:has(.team-reassign-warning) .close{
  border:1px solid #ddd2ff;
  background:#fff;
  color:#172238;
  outline:none;
  box-shadow:none;
}
#modal:has(.team-reassign-warning) .close:hover{
  border-color:#bfaeff;
  background:#faf8ff;
  color:#6848ea;
}
#modal:has(.team-reassign-warning) .close:focus-visible{
  outline:3px solid rgba(124,87,255,.16);
  outline-offset:2px;
}


/* Team — contract/probation expiry warning. */
#main:has(.team-heading) .team-name-row{
  display:flex;
  align-items:center;
  gap:8px;
  min-width:0;
}
#main:has(.team-heading) .team-name-row h3{
  min-width:0;
}
#main:has(.team-heading) .team-contract-dot{
  position:relative;
  display:inline-block;
  flex:0 0 9px;
  width:9px;
  height:9px;
  border-radius:50%;
  background:#ef4764;
  box-shadow:0 0 0 0 rgba(239,71,100,.28);
  animation:teamContractPulse 2.8s ease-in-out infinite;
  cursor:help;
}
@keyframes teamContractPulse{
  0%,65%,100%{box-shadow:0 0 0 0 rgba(239,71,100,0);transform:scale(1)}
  78%{box-shadow:0 0 0 5px rgba(239,71,100,.14);transform:scale(1.08)}
}
@media(prefers-reduced-motion:reduce){
  #main:has(.team-heading) .team-contract-dot{animation:none}
}


/* Team — full-width contract date and expiry summary badge. */
#modal:has(#tform) .fields label:has(input[name="contractEnd"]){
  grid-column:1 / -1;
}
#modal:has(#tform) .fields label:has(input[name="contractEnd"]) input{
  width:100%;
}
#main:has(.team-heading) .team-expiry-count{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:3px 9px;
  border:1px solid #ffc7d1;
  border-radius:20px;
  background:#fff1f4;
  color:#cf415c;
  font-family:var(--font-ui);
  font-size:12px;
  font-weight:600;
  line-height:1.5;
  white-space:nowrap;
}


/* Keep expired contracts distinct from the ten-day warning. */
#main:has(.team-heading) .team-contract-dot.is-expired{
  animation:none;
  box-shadow:none;
}
#main:has(.team-heading) .team-status:is(.is-expiring,.is-expired),#main:has(.team-heading) .team-expiry-count.is-expired{
  border-color:#ffc7d1;
  background:#fff1f4;
  color:#b9324b;
}
#main:has(.team-heading) .team-status.is-expired{
  max-width:120px;
  white-space:normal;
  text-align:center;
}
#main:has(.team-heading) .team-add-card{display:flex;align-items:center;justify-content:center;gap:12px;min-height:360px;border:1.5px dashed #d4dced;border-radius:16px;background:#fff;color:#53627c;text-align:center;cursor:pointer}
#main:has(.team-heading) .team-add-card:hover{border-color:var(--violet);background:#fcfaff}
#main:has(.team-heading) .team-add-card .team-add-icon{display:grid;place-items:center;width:56px;height:56px;border-radius:16px;background:#eee8ff;color:var(--violet)}
#main:has(.team-heading) .team-add-card .team-add-icon svg{width:26px;height:26px}
#main:has(.team-heading) .team-add-card strong{font-family:var(--font-heading);font-size:18px;font-weight:600;color:#53627c}
#main:has(.team-heading) .team-add-card>span:last-child{font-size:14px;color:#59667d}
#main:has(.team-heading) .team-status.is-expired{background:#f2f3f5;border-color:#e1e3e7;color:#a0a5ae}
#main:has(.team-heading) .team-contract-dot.is-expired{background:#b7bbc2;box-shadow:0 0 0 3px #eef0f2}
@media(max-width:900px){#main:has(.team-heading) .team-add-card{min-height:260px}}

/* Team filter: custom Esteja menu,without the native browser select. */
#main:has(.team-heading) .team-filter-control{position:relative;flex-shrink:0}
#main:has(.team-heading) .team-filter-button{display:flex;align-items:center;gap:9px;width:220px;height:40px;padding:0 12px;border:1px solid #dfe7f0;border-radius:10px;background:#fff;color:#53627c;font-family:var(--font-ui);font-size:13px;font-weight:500;text-align:left}
#main:has(.team-heading) .team-filter-button:hover,#main:has(.team-heading) .team-filter-button[aria-expanded="true"]{border-color:var(--violet);background:#fcfaff}
#main:has(.team-heading) .team-filter-button svg{color:var(--violet);flex:0 0 auto}
#main:has(.team-heading) .team-filter-button span:nth-child(2){flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#main:has(.team-heading) .team-filter-chevron{font-size:18px;line-height:1;color:#71819d;transform:translateY(-2px)}
#main:has(.team-heading) .team-filter-menu{position:absolute;top:calc(100% + 8px);right:0;z-index:30;width:250px;padding:6px;border:1px solid #dfe7f0;border-radius:12px;background:#fff;box-shadow:0 14px 32px rgba(40,35,70,.16)}
#main:has(.team-heading) .team-filter-menu[hidden]{display:none}
#main:has(.team-heading) .team-filter-menu button{display:block;width:100%;min-height:38px;padding:8px 11px;border:0;border-radius:8px;background:transparent;color:#53627c;font-family:var(--font-ui);font-size:13px;font-weight:500;text-align:left}
#main:has(.team-heading) .team-filter-menu button:hover,#main:has(.team-heading) .team-filter-menu button.is-selected{background:#f0ebff;color:var(--violet-text)}
@media(max-width:900px){#main:has(.team-heading) .team-filter-control{width:100%}#main:has(.team-heading) .team-filter-button{width:100%}#main:has(.team-heading) .team-filter-menu{left:0;right:auto;width:100%}}

/* Team editor — collaborator details and weekly shifts,matching the approved reference. */
#modal:has(#tform.team-editor){
 --team-editor-accent:var(--violet);--team-editor-soft:#f5f1ff;--team-editor-line:#dfe7f0;--team-editor-muted:#71819d;
 width:min(1360px,calc(100vw - 48px));height:min(960px,calc(100dvh - 48px));max-height:calc(100dvh - 48px);max-width:none;
 margin:auto;padding:0;overflow:hidden;border:1px solid var(--team-editor-line);border-radius:22px;background:var(--surface);color:var(--ink);
}
#modal:has(#tform.team-editor)::backdrop{background:rgba(27,36,52,.42);backdrop-filter:blur(4px)}
#modal:has(#tform.team-editor) #modalbody{height:100%;display:flex;flex-direction:column;min-height:0}
#modal:has(#tform.team-editor) #modalbody>.modalhead{flex-shrink:0;min-height:108px;margin:0;padding:24px 32px;gap:20px;border-bottom:1px solid var(--team-editor-line)}
#modal:has(#tform.team-editor) .modalhead h2{display:flex;align-items:center;gap:20px;min-width:0;font-family:var(--font-ui);font-size:21px;line-height:1.3;color:var(--ink)}
#modal:has(#tform.team-editor) .team-editor-avatar{position:relative;display:grid;place-items:center;flex:0 0 56px;width:56px;height:56px;border:1px solid #e7e1ff;border-radius:var(--ds-radius-lg);background:var(--team-editor-soft);color:var(--violet-text);font-size:22px;font-weight:600}
#modal:has(#tform.team-editor) .team-editor-avatar i{position:absolute;right:-4px;bottom:-4px;width:16px;height:16px;border:3px solid var(--surface);border-radius:50%;background:var(--ds-success)}
#modal:has(#tform.team-editor) .team-editor-avatar i.is-expired{background:var(--muted)}
#modal:has(#tform.team-editor) .team-editor-heading-copy{display:block;min-width:0}
#modal:has(#tform.team-editor) .team-editor-heading-line{display:flex;align-items:center;flex-wrap:wrap;gap:12px}
#modal:has(#tform.team-editor) #team-editor-name{overflow-wrap:anywhere}
#modal:has(#tform.team-editor) #team-editor-role{padding:4px 12px;border:1px solid color-mix(in srgb,var(--ds-warning) 25%,var(--ds-warning-bg));border-radius:var(--ds-radius-pill);background:var(--ds-warning-bg);color:var(--ds-warning);font-size:13px;font-weight:500}
#modal:has(#tform.team-editor) .team-editor-subtitle{display:block;margin-top:6px;color:var(--team-editor-muted);font-size:14px;font-weight:400;line-height:1.5}
#modal:has(#tform.team-editor) .modalhead>.close{display:flex;align-items:center;justify-content:center;flex-shrink:0;padding:0;line-height:1;width:34px;height:34px;background:transparent;color:#8b99af;border:0;border-radius:var(--ds-radius-sm);font-size:26px}
#modal:has(#tform.team-editor) .modalhead>.close:hover{background:var(--team-editor-soft);color:var(--violet-text)}
#modal #tform.team-editor{display:flex;flex:1;flex-direction:column;min-height:0;margin:0}
#modal #tform.team-editor .team-editor-body{display:grid;grid-template-columns:minmax(0,5fr) minmax(0,7fr);flex:1;min-height:0}
#modal #tform.team-editor .team-editor-left,#modal #tform.team-editor .team-editor-right{min-width:0;min-height:0;padding:32px;overflow-y:auto;scrollbar-width:thin;scrollbar-color:var(--team-editor-line) transparent}
#modal #tform.team-editor .team-editor-left{background:#f8fafc;border-right:1px solid var(--team-editor-line)}
#modal #tform.team-editor .team-editor-data{padding:22px;border:1px solid var(--team-editor-line);border-radius:var(--ds-radius-lg);background:var(--surface);box-shadow:var(--ds-shadow-sm)}
#modal #tform.team-editor .team-editor-data h3,#modal #tform.team-editor .team-editor-shifts-heading h3{margin:0 0 20px;color:#8b99af;font-family:var(--font-ui);font-size:13px;font-weight:600;line-height:1.4;text-transform:uppercase;letter-spacing:.025em}
#modal #tform.team-editor .team-editor-data .fields{grid-template-columns:repeat(2,minmax(0,1fr));gap:20px 16px}
#modal #tform.team-editor .team-editor-data label{min-width:0;font-size:14px;font-weight:500;color:#34435d}
#modal #tform.team-editor .team-editor-data label>small{font-size:12px;font-weight:400;color:#8b99af}
#modal #tform.team-editor .team-editor-data input,#modal #tform.team-editor .team-editor-data textarea,#modal #tform.team-editor .control-button{min-width:0;border:1px solid var(--team-editor-line);border-radius:var(--ds-radius-md);background:#f8fafc;color:var(--ink);font-family:var(--font-ui);font-size:14px;font-weight:400;box-shadow:none}
#modal #tform.team-editor .team-editor-data input{min-height:44px;padding:10px 14px}
#modal #tform.team-editor .team-editor-data textarea{min-height:66px;padding:10px 14px;line-height:1.5}
#modal #tform.team-editor .team-editor-data input::placeholder,#modal #tform.team-editor .team-editor-data textarea::placeholder{color:#8b99af}
#modal #tform.team-editor .team-editor-data .control-button{display:block;min-height:44px;padding:10px 14px;margin-top:7px;width:100%;text-align:left}
#modal #tform.team-editor .control-button:hover{border-color:var(--team-editor-accent);background:var(--team-editor-soft)}
#modal #tform.team-editor .team-editor-data input:focus,#modal #tform.team-editor .team-editor-data textarea:focus,#modal #tform.team-editor .control-button:focus-visible{outline:none;border-color:var(--team-editor-accent);background:var(--team-editor-soft);box-shadow:0 0 0 3px rgba(124,87,255,.12)}
#modal #tform.team-editor .team-editor-date-field{position:relative;display:block;margin-top:7px}
#modal #tform.team-editor .team-editor-date-field>svg{position:absolute;left:14px;top:50%;transform:translateY(-50%);color:#8b99af;pointer-events:none}
#modal #tform.team-editor .team-editor-date-field .control-button{margin-top:0;padding-left:42px}
#modal #tform.team-editor .team-editor-skills{margin-top:32px}
#modal #tform.team-editor .team-editor-skills-heading{display:flex;align-items:flex-start;gap:16px;margin-bottom:18px}
#modal #tform.team-editor .team-editor-skills-heading>div{flex:1;min-width:0}
#modal #tform.team-editor .team-editor-skills h3{margin:0;font:600 17px/1.4 var(--font-ui);color:var(--ink)}
#modal #tform.team-editor .team-editor-skills-heading p{margin:2px 0 0;color:var(--team-editor-muted);font-size:13px;line-height:1.5}
#modal #tform.team-editor .team-editor-count{flex-shrink:0;max-width:108px;margin-top:4px;padding:5px 10px;border:1px solid #e7e1ff;border-radius:var(--ds-radius-sm);background:var(--team-editor-soft);color:var(--violet-text);font-size:13px;line-height:1.4}
#modal #tform.team-editor input[type="checkbox"]{width:19px;height:19px;min-height:0;margin:0;flex-shrink:0;accent-color:var(--team-editor-accent);cursor:pointer}
#modal #tform.team-editor .team-editor-all{display:flex;align-items:center;gap:16px;padding:18px 16px;margin-bottom:20px;border:1px solid #e7e1ff;border-radius:var(--ds-radius-lg);background:var(--team-editor-soft);box-shadow:var(--ds-shadow-sm);cursor:pointer}
#modal #tform.team-editor .team-editor-all strong{display:block;color:var(--ink);font-size:14px;font-weight:600;line-height:1.5}
#modal #tform.team-editor .team-editor-all small{display:block;margin-top:8px;color:var(--team-editor-muted);font-size:12px;font-weight:400;line-height:1.5}
#modal #tform.team-editor .team-editor-services{display:grid;gap:12px}
#modal #tform.team-editor .team-editor-service{display:flex;align-items:center;gap:14px;min-height:60px;padding:13px 16px;border:1px solid var(--team-editor-line);border-radius:var(--ds-radius-lg);background:var(--surface);color:var(--ink);font-size:16px;font-weight:400;line-height:1.4;box-shadow:var(--ds-shadow-sm);cursor:pointer}
#modal #tform.team-editor .team-editor-service>span{flex:1;min-width:0;overflow-wrap:anywhere}
#modal #tform.team-editor .team-editor-service>small{flex-shrink:0;max-width:68px;padding:3px 8px;border-radius:5px;background:#f2f5f9;color:#8b99af;font-size:12px;font-weight:500;text-align:center}
#modal #tform.team-editor .team-editor-service:hover{border-color:var(--team-editor-accent)}
#modal #tform.team-editor .team-editor-skills-help{margin:16px 0 0;font-size:12px;line-height:1.6;color:var(--team-editor-muted)}
#modal #tform.team-editor .team-editor-shifts-switch{position:relative;display:flex;align-items:flex-start;gap:16px;padding:24px 22px;border:1px solid #e7e1ff;border-radius:20px;background:var(--team-editor-soft);cursor:pointer}
#modal #tform.team-editor .team-editor-clock{display:grid;place-items:center;flex:0 0 48px;width:48px;height:48px;border:1px solid #e7e1ff;border-radius:var(--ds-radius-lg);background:var(--surface);color:var(--violet-text)}
#modal #tform.team-editor .team-editor-switch-copy{min-width:0;flex:1;font-weight:400}
#modal #tform.team-editor .team-editor-switch-copy>strong{display:block;color:var(--ink);font-size:16px;line-height:1.4;font-weight:600}
#modal #tform.team-editor .team-editor-switch-copy>span{display:block;margin-top:5px;color:#53627c;font-size:14px;line-height:1.6}
#modal #tform.team-editor .team-editor-switch-copy b{font-weight:500;color:var(--ink)}
#modal #tform.team-editor #team-shifts-enable{position:absolute;right:22px;top:24px;width:52px;height:30px;opacity:0}
#modal #tform.team-editor .team-editor-toggle{position:relative;display:block;flex:0 0 52px;width:52px;height:30px;margin-top:2px;border-radius:var(--ds-radius-pill);background:var(--team-editor-line);transition:background-color .18s ease}
#modal #tform.team-editor .team-editor-toggle::after{content:'';position:absolute;top:3px;left:3px;width:24px;height:24px;border-radius:50%;background:var(--surface);box-shadow:var(--ds-shadow-sm);transition:transform .18s ease}
#modal #tform.team-editor #team-shifts-enable:checked+.team-editor-toggle{background:var(--team-editor-accent)}
#modal #tform.team-editor #team-shifts-enable:checked+.team-editor-toggle::after{transform:translateX(22px)}
#modal #tform.team-editor #team-shifts-enable:focus-visible+.team-editor-toggle{outline:2px solid var(--team-editor-accent);outline-offset:3px}
#modal #tform.team-editor .team-editor-shifts-heading{display:flex;align-items:center;justify-content:space-between;gap:14px;margin:30px 0 24px;padding-bottom:8px;border-bottom:1px solid var(--team-editor-line)}
#modal #tform.team-editor .team-editor-shifts-heading h3{margin:0}
#modal #tform.team-editor .team-editor-copy{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:38px;padding:8px 12px;border:1px solid #e7e1ff;border-radius:var(--ds-radius-md);background:var(--team-editor-soft);color:var(--violet-text);font:500 13px/1.4 var(--font-ui);cursor:pointer}
#modal #tform.team-editor #team-shifts-days{display:grid;gap:18px}
#modal #tform.team-editor .team-shift-row{min-width:0;padding:18px;border:1px solid var(--team-editor-line);border-radius:var(--ds-radius-lg);background:var(--surface);box-shadow:var(--ds-shadow-sm)}
#modal #tform.team-editor .team-editor-day-top{display:flex;align-items:center;justify-content:space-between;gap:14px}
#modal #tform.team-editor .team-shift-day{display:flex;align-items:center;gap:14px;min-width:0;color:var(--ink);font-size:16px;font-weight:600;line-height:1.4;cursor:pointer}
#modal #tform.team-editor .team-shift-times{display:flex;align-items:center;gap:12px;margin:0;min-width:0}
#modal #tform.team-editor .team-shift-times>label{display:flex;align-items:center;gap:9px;color:var(--team-editor-muted);font-size:13px;font-weight:400;white-space:nowrap}
#modal #tform.team-editor .team-shift-times .control-button{width:92px;min-height:38px;margin:0;padding:8px 10px;font-weight:500;white-space:nowrap;text-align:center}
#modal #tform.team-editor .team-editor-day-footer{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:10px;margin-top:12px;padding-top:9px;border-top:1px solid #eef0f2}
#modal #tform.team-editor .team-editor-pause-add{display:inline-flex;align-items:center;gap:6px;padding:0;border:0;background:transparent;color:var(--violet-text);font:400 14px/1.5 var(--font-ui);cursor:pointer}
#modal #tform.team-editor .team-editor-pause-add svg{width:16px;height:16px}
#modal #tform.team-editor .team-editor-service-hours,#modal #tform.team-editor .team-editor-day-off{margin-left:auto;color:#8b99af;font-size:12px;white-space:nowrap}
#modal #tform.team-editor .team-editor-pause-chip{display:inline-flex;align-items:center;gap:8px;max-width:100%;padding:3px 8px;border:1px solid color-mix(in srgb,var(--ds-warning) 25%,var(--ds-warning-bg));border-radius:var(--ds-radius-sm);background:var(--ds-warning-bg)}
#modal #tform.team-editor .team-editor-pause-chip button{display:inline-flex;align-items:center;gap:7px;padding:0;border:0;background:transparent;color:var(--ds-warning);font:400 13px/1.5 var(--font-ui)}
#modal #tform.team-editor .team-editor-pause-chip .team-editor-pause-remove{width:18px;height:18px;justify-content:center;font-size:18px}
#modal #tform.team-editor .team-editor-pause-editor{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto;align-items:end;gap:12px;margin-top:12px;padding-top:12px;border-top:1px solid var(--team-editor-line)}
#modal #tform.team-editor .team-editor-pause-editor label{min-width:0;color:var(--team-editor-muted);font-size:12px;font-weight:400}
#modal #tform.team-editor .team-editor-pause-editor .control-button{display:block;width:100%;min-height:38px;margin-top:6px;padding:8px;font-size:13px;white-space:nowrap}
#modal #tform.team-editor .team-editor-pause-done{min-height:38px;padding:8px 12px;border:1px solid #e7e1ff;border-radius:var(--ds-radius-md);background:var(--team-editor-soft);color:var(--violet-text);font-size:13px}
#modal #tform.team-editor .team-editor-pause-clear{grid-column:1/-1;justify-self:start;padding:0;border:0;background:transparent;color:var(--ds-danger);font-size:12px}
#modal #tform.team-editor .team-shift-row.is-off{background:#f8fafc;box-shadow:none}
#modal #tform.team-editor .team-shift-row.is-off .team-shift-day{color:#8b99af}
#modal #tform.team-editor #team-shifts-error:empty,#modal #tform.team-editor #formerror:empty{display:none}
#modal #tform.team-editor .team-editor-footer{flex-shrink:0;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:12px;min-height:84px;padding:20px 32px;border-top:1px solid var(--team-editor-line);background:#f8fafc}
#modal #tform.team-editor .team-editor-footer #formerror{grid-column:1/-1;grid-row:1;margin:0;font-size:13px}
#modal #tform.team-editor .team-editor-remove{display:inline-flex;align-items:center;justify-self:start;gap:9px;padding:0;border:0;background:transparent;color:var(--ds-danger);font:400 14px/1.4 var(--font-ui)}
#modal #tform.team-editor .team-editor-actions{grid-column:2;display:flex;align-items:center;gap:20px}
#modal #tform.team-editor .team-editor-cancel{padding:0 12px;border-color:transparent;background:transparent;color:#53627c;box-shadow:none}
#modal #tform.team-editor .team-editor-save{display:inline-flex;align-items:center;justify-content:center;gap:12px;min-height:46px;padding:12px 24px;border:1px solid var(--team-editor-accent);border-radius:var(--ds-radius-lg);background:var(--team-editor-accent);color:#fff;font-size:14px;box-shadow:var(--ds-shadow-sm)}
#modal #tform.team-editor .team-editor-save:hover{background:var(--violet-hover);border-color:var(--violet-hover);filter:none}
#modal #tform.team-editor button,#modal #tform.team-editor .team-editor-service,#modal #tform.team-editor .team-shift-row{transition:background-color .16s ease,border-color .16s ease,box-shadow .16s ease}
#modal #tform.team-editor button:focus-visible,#modal:has(#tform.team-editor) .close:focus-visible{outline:2px solid var(--team-editor-accent);outline-offset:3px}
#modal #tform.team-editor .team-editor-copy:hover,#modal #tform.team-editor .team-editor-pause-done:hover{border-color:var(--team-editor-accent)}
#modal #tform.team-editor .team-editor-pause-editor:not([hidden]){animation:team-editor-reveal .16s ease-out}
@keyframes team-editor-reveal{from{opacity:0;transform:translateY(-3px)}to{opacity:1;transform:translateY(0)}}
@media(max-width:1100px){
 #modal #tform.team-editor .team-editor-left,#modal #tform.team-editor .team-editor-right{padding:24px}
 #modal #tform.team-editor .team-editor-day-top{flex-wrap:wrap}
 #modal #tform.team-editor .team-shift-times{margin-left:auto}
 #modal #tform.team-editor .team-editor-shifts-heading{align-items:flex-start;flex-direction:column}
 #modal #tform.team-editor .team-editor-clock{display:none}
}
@media(max-width:800px){
 #modal:has(#tform.team-editor){width:calc(100vw - 24px);height:calc(100dvh - 24px);max-height:calc(100dvh - 24px);border-radius:var(--ds-radius-lg)}
 #modal:has(#tform.team-editor) #modalbody>.modalhead{padding:18px 20px;min-height:90px}
 #modal:has(#tform.team-editor) .modalhead h2{gap:12px;font-size:18px}
 #modal:has(#tform.team-editor) .team-editor-avatar{flex-basis:44px;width:44px;height:44px;font-size:18px}
 #modal:has(#tform.team-editor) .team-editor-subtitle{font-size:12px}
 #modal #tform.team-editor .team-editor-body{display:block;overflow-y:auto}
 #modal #tform.team-editor .team-editor-left,#modal #tform.team-editor .team-editor-right{overflow:visible;padding:20px}
 #modal #tform.team-editor .team-editor-left{border-right:0;border-bottom:1px solid var(--team-editor-line)}
 #modal #tform.team-editor .team-editor-footer{padding:16px 20px;gap:12px}
 #modal #tform.team-editor .team-editor-actions{gap:8px}
 #modal #tform.team-editor .team-editor-save{padding:10px 16px}
 #modal #tform.team-editor .team-editor-remove{font-size:12px}
 #modal #tform.team-editor .team-editor-shifts-heading{align-items:center;flex-direction:row;flex-wrap:wrap}
}
@media(max-width:480px){
 #modal:has(#tform.team-editor) .team-editor-subtitle{display:none}
 #modal #tform.team-editor .team-editor-data{padding:16px}
 #modal #tform.team-editor .team-editor-data .fields{grid-template-columns:minmax(0,1fr);gap:14px}
 #modal #tform.team-editor .team-editor-shifts-switch{padding:18px 16px;gap:12px}
 #modal #tform.team-editor #team-shifts-enable{right:16px;top:18px}
 #modal #tform.team-editor .team-editor-switch-copy>strong{font-size:14px}
 #modal #tform.team-editor .team-editor-switch-copy>span{font-size:12px}
 #modal #tform.team-editor .team-shift-row{padding:14px}
 #modal #tform.team-editor .team-shift-times{width:100%;justify-content:space-between;margin-top:10px;gap:8px}
 #modal #tform.team-editor .team-shift-times>label{gap:6px;font-size:12px}
 #modal #tform.team-editor .team-shift-times .control-button{width:78px;font-size:13px}
 #modal #tform.team-editor .team-editor-footer{padding:12px 16px}
 #modal #tform.team-editor .team-editor-remove{grid-column:1/-1}
 #modal #tform.team-editor .team-editor-actions{grid-column:1/-1;justify-content:flex-end}
 #modal #tform.team-editor .team-editor-pause-editor{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
 #modal #tform.team-editor .team-editor-pause-done{grid-column:1/-1}
}
@media(prefers-reduced-motion:reduce){#modal #tform.team-editor *,#modal #tform.team-editor *::after{animation:none!important;transition:none!important}}

#detail-dialog:has(.team-shift-picker){border:1px solid #e7e1ff;background:var(--surface);color:var(--ink);border-radius:var(--ds-radius-xl)}
#detail-dialog:has(.team-shift-picker) .chosen-time{color:var(--violet-text)}
#detail-dialog:has(.team-shift-picker) .time-picker-grid button{border:1px solid #e7e1ff;border-radius:var(--ds-radius-md);background:#f5f1ff;color:var(--violet-text);font-family:var(--font-ui)}
#detail-dialog:has(.team-shift-picker) .time-picker-grid button:hover{border-color:var(--violet);outline:none}
#detail-dialog:has(.team-shift-picker) .time-picker-grid button.selected{border-color:var(--violet);background:var(--violet);color:#fff}
#detail-dialog:has(.team-shift-picker) .btn,#detail-dialog:has(.team-shift-picker) .close{border:1px solid #e7e1ff;background:#f5f1ff;color:var(--violet-text);box-shadow:none}
#detail-dialog:has(.team-shift-picker) .btn:hover,#detail-dialog:has(.team-shift-picker) .close:hover{border-color:var(--violet);background:#f5f1ff}
#detail-dialog:has(.team-shift-picker) .btn.primary,#detail-dialog:has(.team-shift-picker) .btn.primary:hover{border-color:var(--violet);background:var(--violet);color:#fff;filter:none}
#detail-dialog:has(.team-shift-picker) button:focus-visible{outline:2px solid var(--violet);outline-offset:2px}

/* Client editor — shared layout for creating and editing client records. */
#modal:has(#cform.client-editor){
 --client-editor-accent:var(--violet);--client-editor-soft:#f5f1ff;--client-editor-line:#dfe7f0;--client-editor-muted:#59667d;
 width:min(980px,calc(100vw - 48px));height:min(720px,calc(100dvh - 48px));max-height:calc(100dvh - 48px);max-width:none;margin:auto;padding:0;overflow:hidden;
 border:1px solid var(--client-editor-line);border-radius:var(--ds-radius-xl);background:var(--surface);color:var(--ink);font-family:var(--font-ui);
}
#modal:has(#cform.client-editor)::backdrop{background:rgba(27,36,52,.42);backdrop-filter:blur(4px)}
#modal:has(#cform.client-editor) #modalbody{display:flex;flex-direction:column;height:100%;min-height:0}
#modal:has(#cform.client-editor) #modalbody>.modalhead{flex-shrink:0;min-height:92px;margin:0;padding:20px 29px;gap:18px;border-bottom:1px solid var(--client-editor-line)}
#modal:has(#cform.client-editor) .modalhead h2{display:flex;align-items:center;gap:16px;min-width:0;font:600 20px/1.3 var(--font-ui);letter-spacing:-.5px;color:var(--ink)}
#modal:has(#cform.client-editor) .client-editor-avatar{display:grid;place-items:center;flex:0 0 46px;width:46px;height:46px;border:1px solid #e7e1ff;border-radius:var(--ds-radius-xl);background:var(--client-editor-soft);color:var(--violet-text);box-shadow:var(--ds-shadow-sm)}
#modal:has(#cform.client-editor) .client-editor-heading-copy{display:block;min-width:0}
#modal:has(#cform.client-editor) .client-editor-title-line{display:flex;align-items:center;flex-wrap:wrap;gap:13px}
#modal:has(#cform.client-editor) .client-editor-status{padding:4px 12px;border:1px solid color-mix(in srgb,var(--ds-success) 22%,var(--ds-success-bg));border-radius:var(--ds-radius-pill);background:var(--ds-success-bg);color:var(--ds-success);font-size:13px;font-weight:500;letter-spacing:0}
#modal:has(#cform.client-editor) .client-editor-subtitle{display:block;margin-top:6px;color:var(--client-editor-muted);font-size:14px;font-weight:400;line-height:1.5;letter-spacing:0}
#modal:has(#cform.client-editor) .modalhead>.close{display:flex;align-items:center;justify-content:center;flex-shrink:0;width:36px;height:36px;padding:0;border:1px solid var(--client-editor-line);border-radius:50%;background:var(--surface);color:#8b99af;box-shadow:var(--ds-shadow-sm);font-size:22px;line-height:1}
#modal:has(#cform.client-editor) .modalhead>.close:hover{background:var(--client-editor-soft);color:var(--violet-text);border-color:#e7e1ff}
#modal #cform.client-editor{display:flex;flex:1;flex-direction:column;min-height:0;margin:0;font-family:var(--font-ui)}
#modal #cform.client-editor .client-editor-body{display:flex;flex-direction:column;flex:1;min-height:0;padding:22px 29px 26px;overflow-y:auto;scrollbar-width:thin;scrollbar-color:var(--client-editor-line) transparent}
#modal #cform.client-editor .client-editor-section-heading{display:flex;align-items:center;justify-content:space-between;gap:15px;margin-bottom:15px}
#modal #cform.client-editor .client-editor-section-heading h3{display:flex;align-items:center;gap:9px;margin:0;color:#59667d;font:600 13px/1.5 var(--font-ui);text-transform:uppercase;letter-spacing:.025em}
#modal #cform.client-editor .client-editor-section-heading h3 svg{flex-shrink:0;color:var(--client-editor-accent)}
#modal #cform.client-editor .client-editor-section-heading>span{color:#59667d;font-size:12px;white-space:nowrap}
#modal #cform.client-editor .client-editor-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:15px 18px}
#modal #cform.client-editor label{display:block;min-width:0;margin:0;font:500 13px/1.5 var(--font-ui);color:#34435d}
#modal #cform.client-editor .client-editor-label{display:flex;align-items:baseline;gap:4px;min-height:21px;margin-bottom:6px}
#modal #cform.client-editor .client-editor-label>small{margin-left:auto;color:#59667d;font-size:12px;font-weight:400;text-align:right}
#modal #cform.client-editor .client-editor-required{color:var(--ds-danger)}
#modal #cform.client-editor input:not([type=checkbox]),#modal #cform.client-editor textarea{display:block;width:100%;min-width:0;min-height:44px;margin:0;padding:9px 13px;border:1px solid #71819d;border-radius:var(--ds-radius-lg);background:var(--surface);color:var(--ink);font:400 14px/1.5 var(--font-ui);box-shadow:none}
#modal #cform.client-editor input::placeholder,#modal #cform.client-editor textarea::placeholder{color:#8b99af}
#modal #cform.client-editor input:not([type=checkbox]):focus,#modal #cform.client-editor textarea:focus{outline:none;border-color:var(--client-editor-accent);box-shadow:0 0 0 3px rgba(124,87,255,.12)}
#modal #cform.client-editor .client-editor-habit{display:flex;align-items:center;gap:13px;margin-top:16px;padding:15px 16px;border:1px solid var(--client-editor-line);border-radius:var(--ds-radius-xl);background:#f8fafc}
#modal #cform.client-editor .client-editor-habit-icon{display:grid;place-items:center;flex:0 0 38px;width:38px;height:38px;border-radius:var(--ds-radius-md);background:var(--client-editor-soft);color:var(--client-editor-accent)}
#modal #cform.client-editor .client-editor-habit>div{min-width:0}
#modal #cform.client-editor .client-editor-habit-title{display:flex;align-items:center;flex-wrap:wrap;gap:9px}
#modal #cform.client-editor .client-editor-habit-title strong{font-size:14px;font-weight:600;color:var(--ink)}
#modal #cform.client-editor .client-editor-habit-title>span{max-width:100%;padding:3px 10px;border:1px solid var(--client-editor-line);border-radius:var(--ds-radius-pill);background:var(--surface);color:#53627c;font-size:12px;line-height:1.5;overflow-wrap:anywhere}
#modal #cform.client-editor .client-editor-habit p{margin:5px 0 0;color:var(--client-editor-muted);font-size:13px;line-height:1.5}
#modal #cform.client-editor #client-debt-fields{min-width:0;margin:16px 0 0;padding:14px 0 0;border:0;border-top:1px solid #e7e1ff}
#modal #cform.client-editor .client-editor-contacts{flex-shrink:0}
#modal #cform.client-editor .client-editor-preferences{display:flex;flex-direction:column;flex:1;min-height:180px;margin-top:24px}
#modal #cform.client-editor .client-editor-preferences>label{display:flex;flex-direction:column;flex:1;min-height:140px}
#modal #cform.client-editor .client-editor-preferences .client-editor-section-heading{flex-shrink:0;margin-bottom:11px}
#modal #cform.client-editor .client-editor-preferences h3{color:#34435d}
#modal #cform.client-editor .client-editor-preferences textarea{flex:1;min-height:140px;border-color:var(--client-editor-line);resize:vertical;font-size:13px}
#modal #cform.client-editor .client-editor-footer{flex-shrink:0;padding:15px 29px;border-top:1px solid var(--client-editor-line);background:#f8fafc}
#modal #cform.client-editor #formerror{margin:0 0 11px;font-size:13px}
#modal #cform.client-editor #formerror:empty{display:none}
#modal #cform.client-editor .client-editor-actions{display:flex;align-items:center;justify-content:flex-end;gap:15px}
#modal #cform.client-editor .client-editor-actions .btn{display:inline-flex;align-items:center;justify-content:center;gap:11px;min-height:42px;padding:9px 18px;border-radius:var(--ds-radius-lg);font:500 13px/1.4 var(--font-ui)}
#modal #cform.client-editor .client-editor-cancel{border:1px solid var(--client-editor-line);background:var(--surface);color:#53627c;box-shadow:none}
#modal #cform.client-editor .client-editor-save{border:1px solid var(--client-editor-accent);background:var(--client-editor-accent);color:#fff;box-shadow:var(--ds-shadow-sm)}
#modal #cform.client-editor .client-editor-save:hover{background:var(--violet-hover);border-color:var(--violet-hover);filter:none}
#modal #cform.client-editor .client-editor-cancel:hover{background:var(--client-editor-soft);border-color:#ddd3ff}
#modal #cform.client-editor button,#modal:has(#cform.client-editor) .close{transition:background-color .16s ease,border-color .16s ease,box-shadow .16s ease}
#modal #cform.client-editor button:focus-visible,#modal:has(#cform.client-editor) .close:focus-visible{outline:2px solid var(--client-editor-accent);outline-offset:3px}
@media(max-width:800px){
 #modal:has(#cform.client-editor){width:calc(100vw - 24px);height:min(720px,calc(100dvh - 24px));max-height:calc(100dvh - 24px)}
 #modal:has(#cform.client-editor) #modalbody>.modalhead{padding:22px;gap:15px;min-height:94px}
 #modal:has(#cform.client-editor) .modalhead h2{gap:13px;font-size:19px}
 #modal:has(#cform.client-editor) .client-editor-avatar{flex-basis:44px;width:44px;height:44px}
 #modal:has(#cform.client-editor) .client-editor-subtitle{font-size:13px}
 #modal #cform.client-editor .client-editor-body{padding:22px}
 #modal #cform.client-editor .client-editor-label{flex-wrap:wrap}
 #modal #cform.client-editor .client-editor-label>small{width:100%;margin-left:0;text-align:left;font-size:12px}
 #modal #cform.client-editor .client-editor-footer{padding:16px 22px}
}
@media(max-width:540px){
 #modal:has(#cform.client-editor) #modalbody>.modalhead{padding:16px}
 #modal:has(#cform.client-editor) .modalhead h2{gap:9px;font-size:16px}
 #modal:has(#cform.client-editor) .client-editor-avatar{display:none}
 #modal:has(#cform.client-editor) .client-editor-subtitle{font-size:12px}
 #modal:has(#cform.client-editor) .client-editor-status{font-size:11px}
 #modal:has(#cform.client-editor) .modalhead>.close{width:35px;height:35px}
 #modal #cform.client-editor .client-editor-body{padding:20px 16px}
 #modal #cform.client-editor .client-editor-section-heading{align-items:flex-start;gap:10px;flex-wrap:wrap}
 #modal #cform.client-editor .client-editor-section-heading h3{font-size:12px}
 #modal #cform.client-editor .client-editor-section-heading>span{font-size:11px}
 #modal #cform.client-editor .client-editor-fields{grid-template-columns:minmax(0,1fr);gap:16px}
 #modal #cform.client-editor .client-editor-label{flex-wrap:nowrap}
 #modal #cform.client-editor .client-editor-label>small{width:auto;margin-left:auto;text-align:right;font-size:11px}
 #modal #cform.client-editor input:not([type=checkbox]){min-height:46px;font-size:16px}
 #modal #cform.client-editor .client-editor-habit{padding:15px;gap:11px;align-items:flex-start}
 #modal #cform.client-editor .client-editor-habit p{font-size:12px}
 #modal #cform.client-editor .client-editor-preferences{margin-top:24px}
 #modal #cform.client-editor .client-editor-footer{padding:15px 16px}
 #modal #cform.client-editor .client-editor-actions{gap:9px}
 #modal #cform.client-editor .client-editor-actions .btn{min-height:44px;padding:9px 15px;font-size:13px}
}
@media(prefers-reduced-motion:reduce){#modal #cform.client-editor *,#modal #cform.client-editor *::after,#modal:has(#cform.client-editor) .close{transition:none!important}}

/* Team time off belongs to collaborator details,before the operator notes. */
#modal #tform.team-editor .team-editor-timeoff{min-width:0;padding-top:16px;border-top:1px solid var(--team-editor-line)}
#modal #tform.team-editor .team-editor-timeoff-heading{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px;margin-bottom:14px}
#modal #tform.team-editor .team-editor-timeoff-heading h3{margin:0}
#modal #tform.team-editor .team-editor-timeoff #team-timeoff-list{display:grid;gap:12px}
#modal #tform.team-editor .team-editor-timeoff #team-timeoff-empty{margin:0}
#modal #tform.team-editor .team-editor-timeoff .team-editor-day-top{flex-wrap:wrap;margin-bottom:12px}
#modal #tform.team-editor .team-editor-timeoff .team-shift-times{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));width:100%;gap:12px;margin:0}
#modal #tform.team-editor .team-editor-timeoff .team-shift-times>label{display:block;min-width:0;white-space:normal}
#modal #tform.team-editor .team-editor-timeoff .team-shift-times .control-button{width:100%;min-height:44px;margin-top:6px;padding:10px;text-align:left;white-space:normal}
#modal #tform.team-editor .team-editor-timeoff .team-timeoff-overlap{white-space:normal;margin:10px 0}
#modal #tform.team-editor .team-editor-timeoff .team-editor-remove{margin-top:12px}
#modal #tform.team-editor .team-editor-timeoff #team-timeoff-error:empty{display:none}

/* Team cards: highlight a current time-off period. */
#main:has(.team-heading) .team-status.is-on-leave{background:var(--ds-warning-bg);border-color:color-mix(in srgb,var(--ds-warning) 25%,var(--ds-warning-bg));color:var(--ds-warning)}

/* Scheda cliente: composizione del riepilogo,confinata al dettaglio cliente. */
#modal:has(.client-history-redesign){
 --client-history-accent:var(--violet);--client-history-soft:#f5f1ff;--client-history-line:#dfe7f0;--client-history-muted:#71819d;
 width:min(1060px,calc(100vw - 48px));height:min(800px,calc(100dvh - 48px));max-width:none;max-height:calc(100dvh - 48px);margin:auto;padding:0;overflow:hidden;
 border:1px solid var(--client-history-line);border-radius:var(--ds-radius-xl);background:var(--surface);color:var(--ink);font-family:var(--font-ui);
}
#modal:has(.client-history-redesign)::backdrop{background:rgba(27,36,52,.42);backdrop-filter:blur(4px)}
#modal:has(.client-history-redesign) #modalbody{height:100%;min-height:0}
#modal .client-history-redesign{display:flex;flex-direction:column;height:100%;min-height:0;font:400 13px/1.5 var(--font-ui)}
#modal .client-history-header{display:flex;flex-shrink:0;align-items:flex-start;justify-content:flex-start;gap:16px;padding:20px 26px;border-bottom:1px solid var(--client-history-line);background:var(--surface)}
#modal .client-history-avatar{width:52px;height:52px;border-radius:var(--ds-radius-xl);background:var(--client-history-accent);color:var(--surface);font:700 22px/1 var(--font-ui);box-shadow:var(--ds-shadow-sm)}
#modal .client-history-identity{flex:1;min-width:0}
#modal .client-history-identity h2{margin:0 0 8px;font:700 25px/1.2 var(--font-heading);letter-spacing:-1px;overflow-wrap:anywhere;color:var(--ink)}
#modal .client-history-contacts{display:flex;flex-wrap:wrap;gap:5px 18px;margin-bottom:10px;color:var(--client-history-muted);overflow-wrap:anywhere}
#modal .client-history-contacts strong{font-weight:500;color:var(--ink)}
#modal .client-history-redesign .btn{min-height:34px;border-radius:var(--ds-radius-lg);font:500 13px/1.4 var(--font-ui);padding:7px 13px}
#modal .client-history-redesign .btn.primary{background:var(--client-history-accent);border-color:var(--client-history-accent);color:var(--surface)}
#modal .client-history-redesign .btn.primary:hover{background:var(--violet-hover);border-color:var(--violet-hover)}
#modal .client-history-redesign .btn:not(.primary){border-color:var(--client-history-line);box-shadow:var(--ds-shadow-sm)}
#modal .client-history-header>.close{display:grid;place-items:center;flex-shrink:0;width:40px;height:40px;margin:0;padding:0;border:1px solid var(--client-history-line);border-radius:50%;background:var(--surface);color:var(--client-history-muted);font-size:26px;line-height:1}
#modal .client-history-header>.close:hover{background:var(--client-history-soft);color:var(--violet-text)}
#modal .client-history-body{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:22px 26px 26px;background:var(--ds-surface-soft);scrollbar-width:thin;scrollbar-color:var(--client-history-line) transparent}
#modal .client-history-body>section+section{margin-top:24px}
#modal .client-history-heading{display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin-bottom:14px}
#modal .client-history-heading h3{margin:0;font:700 17px/1.4 var(--font-heading);letter-spacing:-.5px;color:var(--ink)}
#modal .client-history-heading .badge{font-size:12px;font-weight:500;border-radius:var(--ds-radius-sm)}
#modal .client-history-heading .count{margin:0;font-size:12px}
#modal .client-history-heading>small{margin-left:auto;font-size:12px;color:var(--client-history-muted)}
#modal .client-history-metrics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
#modal .client-history-metric{min-width:0;padding:15px 18px;border:1px solid var(--client-history-line);border-radius:var(--ds-radius-xl);background:var(--surface);box-shadow:var(--ds-shadow-sm)}
#modal .client-history-metric>span{display:block;color:var(--violet-text);font-size:12px;font-weight:500;letter-spacing:.025em;text-transform:uppercase}
#modal .client-history-metric>strong{display:block;margin:9px 0 2px;color:var(--ink);font:700 27px/1.25 var(--font-heading);letter-spacing:-1px;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
#modal .client-history-metric>small{color:var(--client-history-muted);font-size:12px}
#modal .client-history-metric.is-highlight{border-color:#e7e1ff;background:var(--surface)}
#modal .client-history-metric.is-highlight>span{color:var(--violet-text)}
#modal .client-history-table-wrap{overflow:hidden;border:1px solid var(--client-history-line);border-radius:var(--ds-radius-xl);background:var(--surface)}
#modal .client-history-table{width:100%;table-layout:fixed;border-collapse:collapse;font-size:13px}
#modal .client-history-table th{padding:12px 10px;background:var(--ds-surface-soft);color:var(--client-history-muted);font-size:11px;font-weight:600;letter-spacing:.025em;text-transform:uppercase;text-align:left}
#modal .client-history-table th:nth-child(1){width:19%}
#modal .client-history-table th:nth-child(2){width:21%}
#modal .client-history-table th:nth-child(3){width:13%}
#modal .client-history-table th:nth-child(4){width:11%}
#modal .client-history-table th:nth-child(5){width:8%}
#modal .client-history-table th:nth-child(6){width:11%}
#modal .client-history-table th:nth-child(7){width:17%;text-align:right}
#modal .client-history-table td{padding:13px 10px;border-top:1px solid var(--client-history-line);color:var(--ink);vertical-align:middle;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}
#modal .client-history-table th:first-child,#modal .client-history-table td:first-child{padding-left:22px}
#modal .client-history-table th:last-child,#modal .client-history-table td:last-child{padding-right:22px;text-align:right}
#modal .client-history-table td>strong{font-weight:500}
#modal .client-history-table td>small{display:block;color:var(--client-history-muted);font-size:12px}
#modal .client-history-price s{color:var(--client-history-muted);font-size:11px;margin-right:4px}
#modal .client-history-price .is-promo{color:var(--violet-text)}
#modal .client-history-operator{display:flex;align-items:center;gap:7px}
#modal .client-history-operator .avatar{width:26px;height:26px;font-size:10px}
#modal .client-history-status{display:inline-flex;align-items:center;justify-content:center;gap:5px;padding:4px 9px;border:1px solid var(--client-history-line);border-radius:var(--ds-radius-pill);font-size:11px;font-weight:500;line-height:1.4;text-align:center}
#modal .client-history-status svg{flex-shrink:0}
#modal .client-history-status.scheduled{color:var(--ds-info);background:var(--ds-info-bg);border-color:color-mix(in srgb,var(--ds-info) 22%,var(--ds-info-bg))}
#modal .client-history-status.done{color:var(--ds-success);background:var(--ds-success-bg);border-color:color-mix(in srgb,var(--ds-success) 22%,var(--ds-success-bg))}
#modal .client-history-status.progress{color:var(--ds-warning);background:var(--ds-warning-bg);border-color:color-mix(in srgb,var(--ds-warning) 22%,var(--ds-warning-bg))}
#modal .client-history-status.cancel{color:var(--danger-text);background:var(--ds-danger-bg);border-color:color-mix(in srgb,var(--ds-danger) 22%,var(--ds-danger-bg))}
#modal .client-history-table .is-cancelled td:not(:last-child){color:var(--client-history-muted);text-decoration:line-through}
#modal .client-history-show-all{display:block;margin:10px auto 0;color:var(--violet-text)}
#modal .client-history-credit-card{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:18px;border:1px solid var(--client-history-line);border-radius:var(--ds-radius-xl);background:var(--surface)}
#modal .client-history-credit-card>div{min-width:0}
#modal .client-history-credit-card span{color:var(--client-history-muted);font-size:12px}
#modal .client-history-credit-card strong{display:block;margin:5px 0;font:700 25px/1.3 var(--font-heading);font-variant-numeric:tabular-nums}
#modal .client-history-credit-card strong.is-debt{color:var(--ds-danger)}
#modal .client-history-credit-card p{margin:0;color:var(--client-history-muted);font-size:13px;white-space:pre-wrap;overflow-wrap:anywhere}
#modal .client-history-credit-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:9px;flex-shrink:0}
#modal .client-history-credit-help{margin:10px 0 20px;color:var(--client-history-muted);font-size:12px}
#modal .client-history-redesign h4{margin:0 0 12px;font-size:14px;font-weight:600}
#modal .client-history-credit-log,#modal .client-history-vouchers{padding:0 20px;border:1px solid var(--client-history-line);border-radius:var(--ds-radius-lg);background:var(--surface)}
#modal .client-history-credit-event{display:flex;align-items:center;gap:10px;padding:12px 0;border-bottom:1px solid var(--client-history-line)}
#modal .client-history-credit-event:last-child{border-bottom:0}
#modal .client-history-event-icon{display:grid;place-items:center;flex-shrink:0;width:34px;height:34px;border-radius:var(--ds-radius-md);background:var(--client-history-soft);color:var(--client-history-accent)}
#modal .client-history-event-icon.is-settled{background:var(--ds-success-bg);color:var(--ds-success)}
#modal .client-history-credit-event>div{min-width:0;overflow-wrap:anywhere}
#modal .client-history-credit-event strong{font-size:13px;font-weight:500}
#modal .client-history-credit-event small{display:block;color:var(--client-history-muted);font-size:12px}
#modal .client-history-event-amount{margin-left:auto;text-align:right;flex-shrink:0;font-variant-numeric:tabular-nums}
#modal .client-history-event-amount.is-granted>strong{color:var(--ds-danger)}
#modal .client-history-event-amount.is-settled>strong{color:var(--ds-success)}
#modal .client-history-empty{padding:18px 0;margin:0;color:var(--client-history-muted);font-size:13px}
#modal .client-history-table-wrap>.client-history-empty{padding:22px}
#modal .client-history-note{margin:0 0 22px;color:var(--client-history-muted);white-space:pre-wrap;overflow-wrap:anywhere}
#modal .client-history-footer{position:static;display:flex;flex-shrink:0;align-items:center;justify-content:space-between;gap:16px;margin:0;padding:12px 26px;border-top:1px solid var(--client-history-line);background:var(--surface);color:var(--client-history-muted);text-align:left;font-size:12px}
#modal .client-history-footer>div{display:flex;gap:12px}
#modal .client-history-credit-summary{flex:1}
#modal .client-history-credit-symbol{display:grid;place-items:center;flex-shrink:0;width:42px;height:42px;border-radius:var(--ds-radius-lg);background:var(--client-history-soft);color:var(--violet-text)}
#modal .client-history-credit-actions{max-width:400px}
#modal .client-history-credit-form{width:100%;margin:12px 0 0;padding:15px;border:1px solid var(--client-history-accent);border-radius:var(--ds-radius-xl);background:var(--surface);box-shadow:var(--ds-shadow-sm)}
#modal .client-history-credit-form-head{display:flex;align-items:center;gap:10px;margin-bottom:12px}
#modal .client-history-credit-form-head>span{display:grid;place-items:center;flex-shrink:0;width:32px;height:32px;background:var(--client-history-soft);color:var(--violet-text);border-radius:var(--ds-radius-md)}
#modal .client-history-credit-form-head h4{margin:0 0 3px;font-size:15px;font-weight:600}
#modal .client-history-credit-form-head p{margin:0;color:var(--client-history-muted);font-size:12px}
#modal .client-history-credit-fields{display:grid;grid-template-columns:minmax(140px,.65fr) minmax(0,1.35fr);gap:12px;margin-bottom:12px}
#modal .client-history-credit-fields label{min-width:0;margin:0;font:500 12px/1.5 var(--font-ui);color:var(--ink)}
#modal .client-history-credit-fields label>small{font-size:11px;font-weight:400;color:var(--client-history-muted)}
#modal .client-history-credit-fields input{display:block;min-width:0;width:100%;height:38px;min-height:38px;margin:5px 0 0;padding:8px 10px;border:1px solid var(--client-history-line);border-radius:var(--ds-radius-md);background:var(--surface);color:var(--ink);font:400 13px/1.4 var(--font-ui)}
#modal .client-history-credit-input{position:relative;display:block}
#modal .client-history-credit-input>span{position:absolute;left:13px;top:50%;transform:translateY(-50%);color:var(--violet-text);font-size:18px}
#modal .client-history-credit-input input{padding-left:34px;font-size:17px;font-weight:600;font-variant-numeric:tabular-nums}
#modal .client-history-credit-fields input:focus{outline:2px solid var(--client-history-accent);outline-offset:2px}
#modal .client-history-credit-fields input[aria-invalid=true]{border-color:var(--ds-danger)}
#modal .client-history-credit-preview{display:flex;align-items:center;gap:18px;padding:10px 14px;border-radius:var(--ds-radius-lg);background:var(--client-history-soft);color:var(--violet-text)}
#modal .client-history-credit-preview>div{flex:1;min-width:0}
#modal .client-history-credit-preview>div:last-child{text-align:right}
#modal .client-history-credit-preview>svg{flex-shrink:0}
#modal .client-history-credit-preview span{display:block;font-size:11px;color:var(--client-history-muted)}
#modal .client-history-credit-preview strong{display:block;margin-top:3px;font:700 20px/1.3 var(--font-heading);font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
#modal .client-history-credit-preview>div:first-child strong{color:var(--ink)}
#modal .client-history-credit-form.is-settlement{border-color:var(--ds-success)}
#modal .client-history-credit-form.is-settlement .client-history-credit-form-head>span,#modal .client-history-credit-form.is-settlement .client-history-credit-preview{background:var(--ds-success-bg);color:var(--ds-success)}
#modal .client-history-credit-settle-note{margin:10px 0 0;color:var(--client-history-muted);font-size:12px}
#modal .client-history-credit-form-actions{display:flex;justify-content:flex-end;flex-wrap:wrap;gap:8px;margin-top:12px}
#modal #client-history-credit-error{margin:10px 0 0;font-size:12px;color:var(--ds-danger)}
#modal #client-history-credit-error:empty{display:none}
@media(max-width:900px){
 #modal .client-history-header{padding:22px;gap:16px}
 #modal .client-history-body{padding:24px 22px}
 #modal .client-history-footer{padding:14px 22px}
 #modal .client-history-table thead{display:none}
 #modal .client-history-table tbody{display:block}
 #modal .client-history-table tr{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 20px;padding:18px 22px;border-top:1px solid var(--client-history-line)}
 #modal .client-history-table tbody:first-of-type tr:first-child{border-top:0}
 #modal .client-history-table td,#modal .client-history-table td:first-child,#modal .client-history-table td:last-child{display:block;padding:0;border:0;text-align:left}
 #modal .client-history-table td::before{content:attr(data-label);display:block;margin-bottom:3px;color:var(--client-history-muted);font-size:10px;text-transform:uppercase}
 #modal .client-history-table td:nth-child(2){grid-column:1/-1;grid-row:1;font-weight:600}
 #modal .client-history-credit-card{align-items:flex-start;flex-direction:column}
 #modal .client-history-credit-symbol{display:none}
 #modal .client-history-credit-actions{justify-content:flex-start;flex-shrink:1}
}
@media(max-width:600px){
 #modal:has(.client-history-redesign){width:calc(100vw - 20px);height:calc(100dvh - 24px);max-height:calc(100dvh - 24px)}
 #modal .client-history-header{gap:12px;padding:18px 16px}
 #modal .client-history-avatar{width:42px;height:42px;font-size:18px;border-radius:var(--ds-radius-lg)}
 #modal .client-history-identity h2{font-size:22px;letter-spacing:-.5px}
 #modal .client-history-contacts{font-size:12px;gap:4px 10px}
 #modal .client-history-header>.close{width:30px;height:30px;font-size:22px}
 #modal .client-history-body{padding:22px 16px}
 #modal .client-history-heading h3{font-size:17px}
 #modal .client-history-heading>small{width:100%;margin-left:0}
 #modal .client-history-metrics{grid-template-columns:1fr;gap:10px}
 #modal .client-history-metric{padding:14px 18px}
 #modal .client-history-metric>strong{font-size:27px;margin-top:4px}
 #modal .client-history-footer{padding:12px 16px}
 #modal .client-history-footer>span{display:none}
 #modal .client-history-footer>div{width:100%;justify-content:flex-end;gap:8px}
 #modal .client-history-credit-card{padding:18px}
 #modal .client-history-credit-log,#modal .client-history-vouchers{padding:0 14px}
 #modal .client-history-credit-fields{grid-template-columns:1fr;gap:12px}
 #modal .client-history-credit-form{padding:16px}
 #modal .client-history-credit-preview{gap:12px;padding:12px}
 #modal .client-history-credit-preview strong{font-size:20px}
 #modal .client-history-credit-form-actions .btn{flex:1}
}
@media print{
 body:has(.client-history-redesign){height:auto!important;overflow:visible!important}
 body:has(.client-history-redesign)>:not(#modal){display:none!important}
 #modal:has(.client-history-redesign){position:static!important;inset:auto!important;width:100%!important;height:auto!important;max-height:none!important;margin:0!important;border:0!important;box-shadow:none!important;overflow:visible!important}
 #modal:has(.client-history-redesign)::backdrop{display:none}
 #modal:has(.client-history-redesign) #modalbody,#modal .client-history-redesign,#modal .client-history-body{display:block!important;height:auto!important;max-height:none!important;overflow:visible!important}
 #modal .client-history-redesign button,#modal .client-history-footer{display:none!important}
 #modal #client-history-credit-panel{display:none!important}
 #modal #client-history-extra[hidden]{display:block!important}
 #modal .client-history-redesign .client-history-metrics{grid-template-columns:repeat(3,minmax(0,1fr))}
 #modal .client-history-table tr,#modal .client-history-credit-event,#modal .client-history-credit-card{break-inside:avoid}
}

/* Lista d'attesa — removal confirmation in the shared lilac palette. */
#modal:has(.waitlist-remove-confirmation){background:var(--surface);color:var(--ink);border-color:#dfe7f0}
#modal:has(.waitlist-remove-confirmation) .modalhead h2{color:var(--ink)}
#modal:has(.waitlist-remove-confirmation) #modalbody>p{color:#71819d}
#modal:has(.waitlist-remove-confirmation) :is(.close,.btn){background:#f5f1ff;border-color:#ddd3ff;color:var(--violet-text)}
#modal:has(.waitlist-remove-confirmation) :is(.close,.btn):hover{background:#ebe3ff;border-color:#cdbdf8;color:#6848ea}
#modal:has(.waitlist-remove-confirmation) .btn.primary{background:var(--violet);border-color:var(--violet);color:#fff}
#modal:has(.waitlist-remove-confirmation) .btn.primary:hover{background:var(--violet-hover);border-color:var(--violet-hover);color:#fff}
#modal:has(.waitlist-remove-confirmation) button:focus-visible{outline:2px solid var(--violet);outline-offset:3px}

/* Voucher editor — reference layout,preserving the existing form controls. */
#modal:has(#vform.gift-voucher-editor){width:min(680px,calc(100vw - 32px));max-width:none;max-height:calc(100dvh - 40px);padding:0;overflow:hidden;border:1px solid var(--ds-line);border-radius:var(--ds-radius-xl);background:var(--surface)}
#modal[open]:has(#vform.gift-voucher-editor){display:flex;flex-direction:column}
#modal:has(#vform.gift-voucher-editor) #modalbody{display:flex;flex-direction:column;min-height:0;max-height:inherit;width:100%}
#modal:has(#vform.gift-voucher-editor) .modalhead{flex-shrink:0;align-items:flex-start;gap:20px;margin:0;padding:26px 30px 22px;border-bottom:1px solid var(--ds-line)}
#modal:has(#vform.gift-voucher-editor) .modalhead h2{margin:0;font-family:var(--font-heading);font-size:25px;line-height:1.3;letter-spacing:-.6px;color:var(--ink)}
#modal:has(#vform.gift-voucher-editor) .gift-voucher-heading p{margin:7px 0 0;color:#59667d;font:400 14px/1.5 var(--font-ui)}
#modal:has(#vform.gift-voucher-editor) .close{display:flex;align-items:center;justify-content:center;flex:0 0 38px;width:38px;height:38px;padding:0;border:0;border-radius:50%;background:#f5f1ff;color:var(--violet-text);font-size:25px;line-height:1}
#modal #vform.gift-voucher-editor{display:flex;flex-direction:column;min-height:0;overflow:hidden;margin:0}
#modal #vform .gift-voucher-body{min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:26px 30px 24px;scrollbar-width:thin}
#modal #vform.gift-voucher-editor .fields{display:grid;grid-template-columns:minmax(0,1fr);gap:24px}
#modal #vform.gift-voucher-editor .fields>label{display:block;margin:0;color:#34435d;font:500 15px/1.45 var(--font-ui)}
#modal #vform.gift-voucher-editor .label-line{justify-content:flex-start;flex-wrap:wrap;gap:5px;margin:0 0 8px}
#modal #vform.gift-voucher-editor .label-line>button{margin-left:auto}
#modal #vform.gift-voucher-editor .gift-voucher-optional{display:inline;margin:0;color:#59667d;font-size:12px;font-weight:400}
#modal #vform.gift-voucher-editor :is(input:not([type=radio]):not([type=checkbox]):not(.enhanced-native),select:not(.enhanced-native),textarea,.control-button){box-sizing:border-box;width:100%;min-height:46px;margin-top:8px;padding:11px 15px;border:1px solid #dfe7f0;border-radius:var(--ds-radius-lg);background:var(--surface);color:var(--ink);font:400 14px/1.5 var(--font-ui);box-shadow:var(--ds-shadow-sm)}
#modal #vform.gift-voucher-editor .control-button{text-align:left}
#modal #vform.gift-voucher-editor :is(input,textarea)::placeholder{color:#8b99af}
#modal #vform.gift-voucher-editor textarea{display:block;min-height:96px;resize:vertical}
#modal #vform.gift-voucher-editor .label-line :is(.new-client-button,.gift-clear-expiry){display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:32px;padding:6px 11px;border-radius:var(--ds-radius-md);font-size:12px;line-height:1.4;font-weight:500}
#modal #vform.gift-voucher-editor .new-client-button svg{width:16px;height:16px}
#modal #vform.gift-voucher-editor .gift-voucher-amount{position:relative}
#modal #vform.gift-voucher-editor .gift-voucher-amount input{padding-right:44px;font-weight:600}
#modal #vform.gift-voucher-editor .gift-voucher-amount input[type="number"]{-moz-appearance:textfield;appearance:textfield}
#modal #vform.gift-voucher-editor .gift-voucher-amount input[type="number"]::-webkit-inner-spin-button,#modal #vform.gift-voucher-editor .gift-voucher-amount input[type="number"]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}
#modal #vform.gift-voucher-editor .gift-voucher-amount>span{position:absolute;right:15px;top:calc(50% + 4px);transform:translateY(-50%);color:#8b99af;pointer-events:none;line-height:1}
#modal #vform.gift-voucher-editor .gift-voucher-presets{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}
#modal #vform.gift-voucher-editor .gift-voucher-presets button{min-height:28px;padding:4px 11px;border:1px solid transparent;border-radius:var(--ds-radius-md);background:#f1f5f9;color:#53627c;font:500 12px/1.5 var(--font-ui)}
#modal #vform.gift-voucher-editor .gift-voucher-presets button:hover:not(:disabled),#modal #vform.gift-voucher-editor .gift-voucher-presets button[aria-pressed=true]{background:#f5f1ff;border-color:#ddd3ff;color:var(--violet-text)}
#modal #vform.gift-voucher-editor .gift-voucher-presets button:disabled{opacity:.45;cursor:not-allowed}
#modal #vform.gift-voucher-editor .gift-voucher-scope>.label-line{color:#34435d;font-size:15px;font-weight:500}
#modal #vform.gift-voucher-editor .gift-voucher-scope-option{display:flex;align-items:center;gap:13px;min-height:66px;margin:10px 0 0;padding:13px 15px;border:1px solid #dfe7f0;border-radius:var(--ds-radius-lg);background:var(--surface);cursor:pointer}
#modal #vform.gift-voucher-editor .gift-voucher-scope-option:has(input:checked){border-color:#ddd3ff;background:#f5f1ff}
#modal #vform.gift-voucher-editor .gift-voucher-scope-option input{flex:0 0 17px;width:17px;height:17px;min-height:0;margin:0;padding:0;accent-color:var(--violet)}
#modal #vform.gift-voucher-editor .gift-voucher-scope-option strong{display:block;color:var(--ink);font-size:14px;font-weight:600;line-height:1.4}
#modal #vform.gift-voucher-editor .gift-voucher-scope-option small{display:block;margin-top:3px;color:#59667d;font-size:12px;font-weight:400;line-height:1.5}
#modal #vform.gift-voucher-editor #voucher-services-list{margin:12px 0 0;padding:14px;border:1px solid #dfe7f0;border-radius:var(--ds-radius-lg)}
#modal #vform.gift-voucher-editor #voucher-services-error:empty{display:none}
#modal #vform.gift-voucher-editor .gift-expiry-field .control-button{margin-top:0}
#modal #vform.gift-voucher-editor #voucher-expiry-help{margin-top:8px;color:#8b99af;font-size:12px;line-height:1.5}
#modal #vform.gift-voucher-editor .gift-voucher-body>.sub{margin:16px 0 0;font-size:12px;color:#71819d}
#modal #vform.gift-voucher-editor #formerror:empty{display:none}
#modal #vform.gift-voucher-editor>.modalfoot{flex-shrink:0;margin:0;padding:16px 30px;gap:10px;border-top:1px solid var(--ds-line);background:var(--surface)}
#modal #vform.gift-voucher-editor>.modalfoot .btn{min-height:42px;padding:9px 18px}
@media(max-width:600px){
 #modal:has(#vform.gift-voucher-editor){width:calc(100vw - 20px);max-height:calc(100dvh - 20px)}
 #modal:has(#vform.gift-voucher-editor) .modalhead{padding:20px;gap:12px}
 #modal:has(#vform.gift-voucher-editor) .modalhead h2{font-size:21px}
 #modal #vform .gift-voucher-body{padding:20px}
 #modal #vform.gift-voucher-editor .fields{gap:20px}
 #modal #vform.gift-voucher-editor>.modalfoot{padding:14px 20px}
}

/* New treatment editor: reference layout,existing controls and palette. */
#modal:has(#sform.service-editor){width:min(760px,calc(100vw - 32px));max-height:calc(100dvh - 40px);padding:0;overflow:hidden;border-radius:var(--ds-radius-xl);background:var(--surface)}
#modal[open]:has(#sform.service-editor){display:flex;flex-direction:column}
#modal:has(#sform.service-editor) #modalbody{display:flex;flex-direction:column;min-height:0;max-height:inherit}
#modal:has(#sform.service-editor) .modalhead{flex-shrink:0;align-items:flex-start;gap:20px;margin:0;padding:30px 34px 24px}
#modal .service-editor-heading h2{margin:0;font-family:var(--font-heading);font-size:27px;font-weight:700;line-height:1.25;letter-spacing:-.8px}
#modal .service-editor-heading p{margin:5px 0 0;color:#59667d;font-size:14px;line-height:1.5}
#modal:has(#sform.service-editor) .modalhead .close{flex:0 0 42px;width:42px;height:42px;border:1px solid #ddd3ff;border-radius:50%;background:#fff;color:#46546a;font-size:22px}
#modal #sform.service-editor{display:flex;flex-direction:column;min-height:0;overflow:hidden}
#modal #sform.service-editor .service-editor-body{min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:10px 34px 24px}
#modal #sform.service-editor .fields{grid-template-columns:repeat(2,minmax(0,1fr));gap:24px 20px}
#modal #sform.service-editor .fields>label{grid-column:auto;grid-row:auto;color:#46546a;font-size:14px;font-weight:600}
#modal #sform.service-editor .fields>label.full{grid-column:1/-1}
#modal #sform.service-editor .service-editor-body>.fields>label:nth-child(-n+2){grid-column:auto}
#modal #sform.service-editor input:not([type=checkbox]):not(.enhanced-native),#modal #sform.service-editor textarea{border-color:#dfe7f0!important;color:var(--ds-ink);font-size:16px;font-weight:400}
#modal #sform.service-editor input::placeholder,#modal #sform.service-editor textarea::placeholder{color:#8b99af;opacity:1}
#modal #sform.service-editor textarea{min-height:96px!important}
#modal #sform.service-editor #service-category-trigger,#modal #sform.service-editor .control-button{min-height:48px;border:1px solid #dfe7f0;border-radius:12px;background:#fff;color:var(--ds-ink);font-size:16px;font-weight:400}
#modal #sform.service-editor .control-button{width:100%;margin-top:7px;padding:11px 14px}
#modal #sform.service-editor .service-price-field,#modal #sform.service-editor .service-duration-field{border-color:#dfe7f0}
#modal #sform.service-editor .service-price-field>span,#modal #sform.service-editor .service-duration-field>span{flex-basis:48px;background:#f8fafc;color:#71819d;border-left-color:#dfe7f0}
#modal #sform.service-editor .service-promo,#modal #sform.service-editor .checkgroup{min-width:0;margin:20px 0 0;padding:18px 24px 24px;border:1px solid #dfe7f0;border-radius:18px;background:#fff}
#modal #sform.service-editor legend{padding:0 9px;color:var(--ds-ink);font-size:14px;font-weight:600}
#modal #sform.service-editor .service-promo{gap:18px}
#modal #sform.service-editor .service-promo>.sub{margin:0;color:#59667d;font-size:14px}
#modal #sform.service-editor .service-editor-body>.sub{color:#71819d;font-size:12px}
#modal #sform.service-editor>.modalfoot{flex-shrink:0;gap:14px;margin:0;padding:22px 34px 26px;border-top:1px solid var(--ds-line);background:#f8fafc}
#modal #sform.service-editor>.modalfoot .btn{min-height:44px;padding:11px 24px;border-radius:var(--ds-radius-lg)}
#modal #sform.service-editor>.modalfoot .btn.primary{background:var(--violet)!important;border-color:var(--violet)!important;color:#fff!important}
#modal #sform.service-editor>.modalfoot .btn.primary:hover{background:var(--violet-hover)!important;border-color:var(--violet-hover)!important}
@media(max-width:600px){
 #modal:has(#sform.service-editor){width:calc(100vw - 20px);max-height:calc(100dvh - 20px)}
 #modal:has(#sform.service-editor) .modalhead{padding:22px 20px 18px}
 #modal .service-editor-heading h2{font-size:23px}
 #modal #sform.service-editor .service-editor-body{padding:6px 20px 20px}
 #modal #sform.service-editor .fields{grid-template-columns:minmax(0,1fr);gap:18px}
 #modal #sform.service-editor .service-promo,#modal #sform.service-editor .checkgroup{padding:14px 16px 18px}
 #modal #sform.service-editor>.modalfoot{gap:10px;padding:16px 20px 20px}
 #modal #sform.service-editor>.modalfoot .btn{padding:10px 16px}
}

/* Shared page creation action,matching the gift voucher heading button. */
:is(#main,#modal) :is(.clients-heading-add,.services-heading-add,.waitlist-heading-add,.vouchers-heading-add,.team-heading-add,.home-intro .new-appointment-split>.btn.primary,.cal-heading-actions>.cal-primary,.booking-schedule-primary,.storage-reload-actions>.btn.primary,.services-export-footer>.btn.primary),.data-banner .btn{
 display:inline-flex;align-items:center;justify-content:center;gap:9px;flex-shrink:0;
 min-height:38px;padding:8px 14px;border:1px solid var(--violet)!important;border-radius:12px;
 background:var(--violet)!important;color:#fff!important;font-family:var(--font-ui);
 font-size:15px;font-weight:500;line-height:1.35;letter-spacing:normal;
 box-shadow:0 3px 7px rgba(124,87,255,.18);filter:none;
}
:is(#main,#modal) :is(.clients-heading-add,.services-heading-add,.waitlist-heading-add,.vouchers-heading-add,.team-heading-add,.home-intro .new-appointment-split>.btn.primary,.cal-heading-actions>.cal-primary,.booking-schedule-primary,.storage-reload-actions>.btn.primary,.services-export-footer>.btn.primary):hover,.data-banner .btn:hover{background:var(--violet-hover)!important;border-color:var(--violet-hover)!important;box-shadow:0 3px 7px rgba(124,87,255,.18);filter:none}
:is(#main,#modal) :is(.clients-heading-add,.services-heading-add,.waitlist-heading-add,.vouchers-heading-add,.team-heading-add,.home-intro .new-appointment-split>.btn.primary,.cal-heading-actions>.cal-primary,.booking-schedule-primary,.storage-reload-actions>.btn.primary,.services-export-footer>.btn.primary):focus-visible,.data-banner .btn:focus-visible{outline:3px solid #ac95ff;outline-offset:3px}
:is(#main,#modal) :is(.clients-heading-add,.services-heading-add,.waitlist-heading-add,.vouchers-heading-add,.team-heading-add,.home-intro .new-appointment-split>.btn.primary,.cal-heading-actions>.cal-primary,.booking-schedule-primary)>svg{flex:0 0 18px;width:18px;height:18px;stroke-width:1.7}
#main .home-intro .new-appointment-split{overflow:visible;border-radius:12px;box-shadow:none}
@media(max-width:380px){
 #main .cal-heading-actions>.cal-primary{width:38px;min-width:38px;padding:8px}
}

/* Existing treatment identity,using the actual saved ID. */
#modal .service-editor-meta{display:flex;align-items:center;flex-wrap:wrap;gap:12px 24px;margin-bottom:10px;color:#46546a;font-family:var(--font-ui);font-size:14px;line-height:1.4}
#modal .service-editor-meta>span{overflow-wrap:anywhere;min-width:0}
#modal .service-editor-meta>strong{font-weight:600}

/* Expired waiting request: match the treatment card primary action. */
#waitlist-results .waitlist-card-expired .waitlist-update-primary{
 background:var(--violet)!important;border:1px solid var(--violet)!important;color:#fff!important;
 border-radius:9px;font-family:var(--font-ui);font-size:13px;font-weight:500;box-shadow:none;
}
#waitlist-results .waitlist-card-expired .waitlist-update-primary:hover{background:var(--violet-hover)!important;border-color:var(--violet-hover)!important;filter:none}
#waitlist-results .waitlist-card-expired .waitlist-update-primary:focus-visible{outline:2px solid #a994ed;outline-offset:3px}

/* Saved client preferences,between accounting and appointment history. */
#modal .client-history-preferences{padding:16px 18px;border:1px solid var(--client-history-line);border-radius:var(--ds-radius-xl);background:var(--surface);box-shadow:var(--ds-shadow-sm)}
#modal .client-history-preferences .client-history-heading{flex-wrap:nowrap;align-items:center;margin-bottom:10px}
#modal .client-history-preferences-icon{display:grid;place-items:center;flex:0 0 32px;width:32px;height:32px;border-radius:var(--ds-radius-md);background:var(--ds-warning-bg);color:var(--ds-warning)}
#modal .client-history-preferences p{margin:0;color:var(--ink);font:400 13px/1.65 var(--font-ui);white-space:pre-wrap;overflow-wrap:anywhere}

/* Trattamenti — "Esporta il listino in PDF": same frame as the treatment note dialog,
   two choice cards in the primary violet (#7c57ff) and lilac tints already used by the site. */
#modal:has(.services-export){width:min(640px,calc(100vw - 32px));padding:0;overflow:hidden;border-radius:var(--ds-radius-xl);background:var(--surface)}
#modal:has(.services-export) .modalhead{align-items:flex-start;gap:14px;margin:0;padding:26px 30px 6px}
#modal:has(.services-export) .close{flex:0 0 38px;width:38px;height:38px;border:1px solid #dfe7f0;border-radius:50%;background:var(--surface);color:#8b99af;font-size:23px}
#modal .services-export-mark{display:grid;place-items:center;flex:0 0 44px;width:44px;height:44px;border:1px solid #ece8fe;border-radius:var(--ds-radius-lg);background:#f3efff;color:#7c57ff}
#modal .services-export-heading{flex:1;min-width:0}
#modal .services-export-heading h2{margin:2px 0 4px;font:700 22px/1.25 var(--font-heading);letter-spacing:-.6px;color:var(--ink)}
#modal .services-export-heading p{margin:0;color:#59667d;font:400 13px/1.5 var(--font-ui)}
#modal .services-export-body{padding:20px 30px 24px}
#modal .services-export-label{margin:0 0 10px;color:#59667d;font:600 12px/1.4 var(--font-ui);letter-spacing:.6px;text-transform:uppercase}
#modal .services-export-choices{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
#modal .services-export-choice{position:relative;display:grid;gap:8px;padding:16px;border:1px solid #dfe7f0;border-radius:var(--ds-radius-lg);background:var(--surface);cursor:pointer;transition:border-color .16s,background-color .16s}
#modal .services-export-choice:hover{border-color:#ac95ff}
#modal .services-export-choice:has(input:checked){border:2px solid var(--violet);padding:15px;background:#f8f5ff}
#modal .services-export-choice:has(input:focus-visible){outline:3px solid #ac95ff;outline-offset:2px}
#modal .services-export-choice input{position:absolute;opacity:0;pointer-events:none}
#modal .services-export-choice-head{display:flex;align-items:center;gap:10px}
#modal .services-export-choice-icon{display:grid;place-items:center;flex:0 0 28px;height:28px;border-radius:var(--ds-radius-sm);background:#f3efff;color:var(--violet)}
#modal .services-export-choice strong{flex:1;min-width:0;font:700 14px/1.35 var(--font-heading);color:var(--ink)}
#modal .services-export-check{display:grid;place-items:center;flex:0 0 22px;height:22px;border:1.5px solid #c8cfdb;border-radius:50%;color:transparent}
#modal .services-export-choice:has(input:checked) .services-export-check{border-color:var(--violet);background:var(--violet);color:#fff}
#modal .services-export-choice small{color:#59667d;font:400 13px/1.45 var(--font-ui)}
#modal .services-export-info{display:flex;align-items:center;gap:10px;margin:16px 0 0;padding:13px 16px;border:1px solid #dfe7f0;border-radius:var(--ds-radius-lg);background:#f8fafc;color:#46546a;font:400 13px/1.45 var(--font-ui)}
#modal .services-export-info svg{flex-shrink:0;color:var(--violet)}
#modal .services-export-info span{flex:1;min-width:0}
#modal .services-export-info small{color:#59667d;font-size:12px;white-space:nowrap}
#modal .services-export-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:20px 30px;border-top:1px solid #dfe7f0;background:#f8fafc}
#modal .services-export-footer .btn{display:inline-flex;align-items:center;gap:8px;min-height:42px;padding:9px 18px;border-radius:var(--ds-radius-lg);font-size:13px;font-weight:500}
#modal .services-export-footer .btn svg{width:16px;height:16px}
@media(max-width:560px){#modal:has(.services-export) .modalhead{padding:20px 20px 4px}#modal .services-export-body{padding:16px 20px 20px}#modal .services-export-choices{grid-template-columns:minmax(0,1fr)}#modal .services-export-info{flex-wrap:wrap}#modal .services-export-footer{padding:16px 20px}}
/* Treatment note detail: existing service data and shared Esteja palette. */
#modal:has(.service-note-detail){width:min(640px,calc(100vw - 32px));max-height:calc(100dvh - 40px);padding:0;overflow:hidden;border-radius:var(--ds-radius-xl);background:var(--surface)}
#modal[open]:has(.service-note-detail){display:flex;flex-direction:column}
#modal:has(.service-note-detail) #modalbody{display:flex;flex-direction:column;min-height:0;max-height:inherit}
#modal:has(.service-note-detail) .modalhead{flex-shrink:0;align-items:flex-start;gap:16px;margin:0;padding:26px 30px 20px;border-bottom:1px solid #dfe7f0}
#modal .service-note-heading{min-width:0;flex:1}
#modal .service-note-heading h2{margin:10px 0 8px;font:700 25px/1.25 var(--font-heading);letter-spacing:-.7px}
#modal .service-note-badges{display:flex;flex-wrap:wrap;gap:8px;font:500 11px/1.4 var(--font-ui)}
#modal .service-note-badges>span{padding:3px 10px;border:1px solid;border-radius:var(--ds-radius-sm)}
#modal .service-note-category{background:#fff0f1;color:var(--ds-danger);border-color:#f1d1d6!important;text-transform:uppercase;letter-spacing:.4px}
#modal .service-note-listed{background:var(--ds-success-bg);color:var(--ds-success);border-color:var(--ds-success-bg)!important}
#modal .service-note-summary{display:flex;align-items:center;flex-wrap:wrap;gap:8px 16px;color:#46546a;font:400 13px/1.5 var(--font-ui);overflow-wrap:anywhere}
#modal .service-note-summary>span{display:inline-flex;align-items:center;gap:5px}
#modal .service-note-summary svg{width:14px;height:14px;color:#8b99af}
#modal .service-note-summary strong{font-weight:600}
#modal:has(.service-note-detail) .close{flex:0 0 38px;width:38px;height:38px;border:1px solid #dfe7f0;border-radius:50%;background:var(--surface);color:#8b99af;font-size:23px}
#modal .service-note-detail{display:flex;flex-direction:column;min-height:0;overflow:hidden}
#modal .service-note-body{min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:24px 30px}
#modal .service-note-content{padding:22px;border:1px solid #ddd3ff;border-radius:var(--ds-radius-xl);background:#f5f1ff}
#modal .service-note-content h3{display:flex;align-items:center;gap:9px;margin:0 0 14px;color:var(--violet-text);font:600 11px/1.5 var(--font-ui);letter-spacing:.35px;text-transform:uppercase}
#modal .service-note-content h3>span{display:grid;place-items:center;flex:0 0 30px;width:30px;height:30px;border-radius:var(--ds-radius-sm);background:var(--surface)}
#modal .service-note-text{margin:0;padding:16px;border:1px solid #e7e1ff;border-radius:var(--ds-radius-lg);background:var(--surface);color:#46546a;font:400 14px/1.65 var(--font-ui);white-space:pre-wrap;overflow-wrap:anywhere}
#modal .service-note-details{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin-top:22px}
#modal .service-note-details>section{min-width:0;padding:14px;border:1px solid #dfe7f0;border-radius:var(--ds-radius-xl);background:#f8fafc}
#modal .service-note-details h3{margin:0 0 9px;color:#8b99af;font:500 10px/1.5 var(--font-ui);text-transform:uppercase;letter-spacing:.35px}
#modal .service-note-details p{margin:0;color:#46546a;font:400 12px/1.5 var(--font-ui);overflow-wrap:anywhere}
#modal .service-note-members{display:flex;flex-wrap:wrap;gap:6px}
#modal .service-note-members>span{padding:3px 8px;border:1px solid #dfe7f0;border-radius:var(--ds-radius-sm);background:var(--surface);color:#46546a;font:400 12px/1.5 var(--font-ui);overflow-wrap:anywhere}
#modal .service-note-footer{display:flex;flex-shrink:0;align-items:center;justify-content:space-between;gap:12px;padding:20px 30px;border-top:1px solid #dfe7f0;background:#f8fafc}
#modal .service-note-footer .btn{min-height:42px;padding:9px 18px;border-radius:var(--ds-radius-lg);font-size:13px;font-weight:500}
#modal .service-note-footer .btn.primary{background:var(--violet);border-color:var(--violet);color:#fff}
#modal .service-note-footer .btn.primary:hover{background:var(--violet-hover);border-color:var(--violet-hover)}
@media(max-width:600px){
 #modal:has(.service-note-detail){width:calc(100vw - 20px);max-height:calc(100dvh - 20px)}
 #modal:has(.service-note-detail) .modalhead{padding:20px}
 #modal .service-note-body{padding:20px}
 #modal .service-note-content{padding:16px}
 #modal .service-note-details{grid-template-columns:minmax(0,1fr)}
 #modal .service-note-footer{padding:16px 20px}
}

/* Gift beneficiary: reuse the category dropdown inside the form. */
#modal #vform.gift-voucher-editor .gift-client-picker{margin-top:8px}
#modal #vform.gift-voucher-editor .gift-client-picker>.control-button{margin-top:0}
#modal #vform.gift-voucher-editor .gift-client-picker>.service-category-menu{max-height:none;overflow:visible}
#modal #vform.gift-voucher-editor .gift-client-picker .service-category-menu button[aria-pressed="true"]{background:#f5f3ff;color:#6547ee;font-weight:600}
#modal #vform.gift-voucher-editor .gift-client-picker .service-category-menu button:focus-visible{outline:2px solid var(--violet);outline-offset:-2px}

/* Beneficiary search stays visible while the matching client list scrolls. */
#modal #vform.gift-voucher-editor .gift-client-field{min-width:0;font-size:15px;font-weight:600}
#modal #vform.gift-voucher-editor .gift-client-search{padding:4px 4px 8px}
#modal #vform.gift-voucher-editor .gift-client-search input{min-height:38px;margin:0;padding:8px 11px;font-size:13px}
#modal #vform.gift-voucher-editor .gift-client-results{max-height:220px;overflow-y:auto;overscroll-behavior:contain}
#modal #vform.gift-voucher-editor .gift-client-results button[hidden]{display:none}
#modal #vform.gift-voucher-editor .gift-client-empty{margin:0;padding:12px;color:#71819d;font-size:13px;font-weight:400}

/* Trattamenti — compact list rows; the card grid keeps its existing layout. */
.services-results.services-list{gap:12px}
.services-results.services-list .service-card{
  display:grid;grid-template-columns:minmax(0,1fr) minmax(120px,.7fr) minmax(0,1.2fr) 234px;
  grid-template-areas:"heading price team actions";align-items:center;gap:12px 16px;
  height:auto;min-height:0;padding:16px 18px;
}
.services-results.services-list .service-card>div,.services-results.services-list .service-card>dl{min-width:0}
.services-results.services-list .service-card .service-card-heading{grid-area:heading}
.services-results.services-list .service-card .service-card-badges{justify-content:flex-start;flex-wrap:wrap;gap:6px}
.services-results.services-list .service-card h3{margin-top:8px;font-size:16px}
.services-results.services-list .service-card .service-price-row{grid-area:price;gap:6px 10px;margin:0;padding:0}
.services-results.services-list .service-card .service-price{font-size:20px}
.services-results.services-list .service-card .service-price-original{font-size:13px}
.services-results.services-list .service-card .service-team{
  grid-area:team;grid-template-columns:auto minmax(0,1fr);align-items:start;gap:6px 10px;margin:0;padding:0;border:0;
}
.services-results.services-list .service-card .service-team dd{justify-content:flex-start;text-align:left}
.services-results.services-list .service-card .service-team-avatars{flex-wrap:wrap;max-width:100%}
.services-results.services-list .service-card .service-card-actions{
  grid-area:actions;align-self:center;align-items:center;flex-direction:row;flex-wrap:nowrap;
  width:100%;margin:0;padding:0;border:0;
}
.services-results.services-list .service-card .service-edit{
  flex:1 1 auto;width:auto;min-width:0;height:36px;min-height:36px;padding:0 10px;white-space:nowrap;
}
.services-results.services-list .service-card .service-note{
  flex:0 0 36px;width:36px;min-width:36px;height:36px;min-height:36px;margin:0;border-radius:9px;
}
@media(max-width:1199px){
  .services-results.services-list .service-card{
    grid-template-columns:minmax(0,1fr) 234px;grid-template-areas:"heading price" "team actions";
  }
  .services-results.services-list .service-card .service-price-row{justify-content:flex-end}
}
@media(max-width:600px){
  .services-results.services-list .service-card{
    grid-template-columns:minmax(0,1fr) minmax(100px,.7fr);
    grid-template-areas:"heading price" "team team" "actions actions";gap:12px;padding:14px;
  }
  .services-results.services-list .service-card .service-card-actions{justify-self:end;width:min(100%,234px)}
}

/* Every time/date picker confirms in the app's lilac,not the theme's dark brand. */
#detail-dialog:has(.time-picker-grid,.date-picker-grid) .btn.primary,#detail-dialog:has(.time-picker-grid,.date-picker-grid) .btn.primary:hover{border-color:var(--violet);background:var(--violet);color:#fff;filter:none}
#detail-dialog:has(.time-picker-grid,.date-picker-grid) .btn.primary:hover{background:var(--violet-hover);border-color:var(--violet-hover)}
#detail-dialog:has(.time-picker-grid,.date-picker-grid) .btn:not(.primary){border-color:#e7e1ff;background:#f5f1ff;color:var(--violet-text)}
