* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); }
a { text-decoration: none; }
button, input, select, textarea { font: inherit; }
.sidebar { position: fixed; inset: 0 auto 0 0; color: white; display: flex; flex-direction: column; z-index: 20; }
.brand { display: flex; align-items: center; color: white; }
.brand span:last-child { display: flex; flex-direction: column; }
.brand-logo { height: auto; }
.sidebar nav { display: flex; flex-direction: column; overflow-y: auto; }
.sidebar nav a { display: flex; align-items: center; line-height: 1.25; }
.sidebar nav a.nav-primary { padding-block: 10px; white-space: nowrap; }
.sidebar nav.nav-planning a:not(.nav-billing-link) { color: var(--billing-accent); }
.sidebar-user { margin-top: auto; border-top: 1px solid #659ba2; display: flex; justify-content: space-between; }
.app-main { min-height: 100vh; }
.public-main { min-height: 100vh; }
.mobile-header { display: none; }
.page-head { display: flex; justify-content: space-between; }
.page-head h1 { font: 600 clamp(32px, 4vw, 52px)/1.02 Georgia, serif; }
.page-head p { margin: 0; }
.head-actions { display: flex; flex-wrap: wrap; }
.button { border: 1px solid var(--forest); background: transparent; cursor: pointer; display: inline-flex; justify-content: center; align-items: center; text-align: center; }
.link-button { border: 0; padding: 0; background: none; cursor: pointer; }
.panel { border: 1px solid var(--line); margin-bottom: 22px; }
.panel.flush { padding: 0; overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.panel-head h2 { font: 600 24px Georgia, serif; }
.panel-head > span, .panel-head a:not(.button) { color: var(--muted); }
.timeline-row { display: grid; align-items: center; border-top: 1px solid var(--line); color: var(--ink); }
.timeline-row time small { display: block; font-weight: 400; color: var(--muted); }
.timeline-row div { display: flex; flex-direction: column; gap: 4px; }
.timeline-row div span { color: var(--muted); }
.status { min-width: 44px; text-align: center; }
.empty { text-align: center; }
.muted { color: var(--muted); }
.toolbar, .month-nav { display: flex; align-items: center; flex-wrap: wrap; margin: -12px 0 20px; }
.calendar-board-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; margin: -12px 0 20px; }
.calendar-board-toolbar .month-nav { margin: 0; }
.calendar-period-picker { flex: 1 1 260px; justify-content: flex-end; }
.calendar-summary-toolbar, .report-toolbar { display: flex; align-items: center; justify-content: space-between; margin: -12px 0 20px; }
.calendar-summary-toolbar .month-nav, .report-toolbar .month-nav { margin: 0; }
.calendar-summary-toolbar .month-nav, .calendar-summary-toolbar .head-actions { flex-wrap: nowrap; }
.calendar-summary-toolbar .month-nav { min-width: 0; }
.calendar-summary-toolbar .month-nav { flex: 1 1 560px; }
.calendar-summary-toolbar .head-actions { flex: 0 0 auto; }
.calendar-summary-toolbar .button { white-space: nowrap; }
.calendar-summary-toolbar { flex-wrap: wrap; }
.calendar-summary-filter-type { min-width: 130px; }
.calendar-summary-entity-filter { flex: 0 0 340px; width: 340px; max-width: 100%; }
.calendar-summary-toolbar .calendar-summary-filter-type { flex: 0 0 130px; width: 130px; min-width: 130px; }
.calendar-summary-toolbar .calendar-summary-entity-filter { width: auto; }
.calendar-summary-entity-filter .client-combobox { width: 100%; }
.calendar-summary-toolbar .client-combobox-input { padding-right: 44px; }
.month-nav input, .month-nav select, .filter-bar input, .filter-bar select { padding: 9px 12px; border: 1px solid var(--line); }
.client-combobox { position: relative; width: min(100%, 380px); }
.client-combobox::after { content: ""; position: absolute; right: 13px; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.client-combobox-input { width: 100%; min-width: 0; padding-right: 36px; background: var(--white); }
.client-combobox-input::-webkit-search-cancel-button { margin-right: 17px; }
.client-select-native { position: absolute !important; width: 1px !important; height: 1px !important; margin: -1px !important; padding: 0 !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; border: 0 !important; }
.client-combobox-options { position: absolute; z-index: 40; left: 0; right: 0; max-height: 280px; overflow-y: auto; border: 1px solid #b8c4c1; background: var(--white); }
.client-combobox-option { width: 100%; min-height: var(--control-min-height); border: 0; padding: 10px 11px; background: transparent; color: var(--ink); line-height: 1.25; text-align: left; cursor: pointer; display: flex; align-items: center; }
.client-combobox-empty { display: block; padding: 12px 10px; color: var(--muted); font-size: 12px; }
.filter-bar .client-combobox { min-width: min(300px, 100%); }
.quick-fields .client-combobox { width: 100%; }
.client-list-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; margin: -12px 0 20px; }
.client-directory-filter, .client-list-options, .view-switch { display: flex; align-items: center; gap: 8px; }
.billing-client-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; margin-bottom: 20px; }
.billing-client-toolbar .client-combobox, .client-list-toolbar .client-combobox { flex: 0 0 380px; max-width: 100%; }
.client-list-options .button { min-width: 145px; }
.card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card-grid > .empty { grid-column: 1 / -1; }
.client-directory-results.list-view { grid-template-columns: 1fr; }
.client-directory-results.list-view .person-card { grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; padding: 14px 16px; }
.client-directory-results.list-view .avatar { width: 36px; height: 36px; font-size: 11px; }
.client-directory-results.list-view .person-main { display: grid; grid-template-columns: minmax(180px, 1.2fr) minmax(190px, 1.5fr) minmax(120px, .8fr) minmax(125px, .7fr); align-items: center; gap: 12px 22px; }
.client-directory-results.list-view .person-main h2 { margin: 0; }
.client-directory-results.list-view .detail-line { margin-top: 0; }
.client-directory-results.list-view .card-actions { flex-direction: row; align-items: center; }
.client-directory-results.list-view .client-invoice-email { grid-column: span 2; }
.client-directory-results .client-invoice-email { overflow-wrap: anywhere; }
.client-directory-results .client-invoice-email small { white-space: nowrap; }
.client-directory-results .client-invoice-email.is-missing { color: #8a5b10; }
.operator-directory-results.list-view { grid-template-columns: 1fr; }
.operator-directory-results.list-view .person-card { grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; padding: 14px 16px; }
.operator-directory-results.list-view .avatar { width: 36px; height: 36px; font-size: 11px; }
.operator-directory-results.list-view .person-main { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(120px, .7fr) minmax(230px, 1.3fr) minmax(180px, 1fr); align-items: center; gap: 12px 22px; }
.operator-directory-results.list-view .person-main h2, .operator-directory-results.list-view .tags, .operator-directory-results.list-view .account-line { margin: 0; }
.operator-directory-results.list-view .card-actions { flex-direction: row; align-items: center; }
.person-card { border: 1px solid var(--line); display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: start; }
.avatar { border-radius: 50%; display: grid; place-items: center; }
.avatar.small { width: 36px; height: 36px; font-size: 12px; }
.person-main h2 { font: 600 20px Georgia, serif; margin: 1px 0 4px; }
.person-main > span, .detail-line { color: var(--muted); }
.person-main .account-line { display: block; margin-top: 7px; line-height: 1.4; }
.account-active { color: #2f7250; }
.detail-line { margin-top: 12px; }
.card-actions { display: flex; flex-direction: column; align-items: end; }
.tags { display: flex; flex-wrap: wrap; margin-top: 11px; }
.model-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-section { grid-column: 1 / -1; border: 0; border-top: 1px solid var(--line); padding: 20px 0 4px; margin: 0; }
.form-section:first-of-type { border-top: 0; padding-top: 0; }
.form-section legend { padding: 0 12px 0 0; font: 600 22px Georgia, serif; }
.form-section-description { max-width: 650px; margin: 7px 0 0; line-height: 1.45; }
.form-section-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 16px; }
.field { display: flex; flex-direction: column; }
.field:has(textarea), .field:has(.check-list), .form-actions, .errorlist { grid-column: 1 / -1; }
.field label b { color: var(--rust); }
.field small { color: var(--muted); }
.tax-code-control { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.tax-code-generate { white-space: nowrap; }
.tax-code-status { display: block; margin-top: 5px; }
.field-fiscal_birthplace_code { display: none; }
.control, .compact-form input, .compact-form select, .compact-form textarea { width: 100%; border: 1px solid #c8c8c0; padding: 10px 11px; }
.control:not(.client-select-native):not(textarea):not([type="checkbox"]):not([type="radio"]),
.compact-form input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]),
.compact-form select:not(.client-select-native),
.month-nav input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]),
.month-nav select:not(.client-select-native),
.filter-bar input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]),
.filter-bar select:not(.client-select-native),
.availability-toolbar input:not([type="hidden"]),
.billing-filter select:not(.client-select-native),
.bulk-document-actions input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]),
.quick-fields input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]),
.quick-fields select:not(.client-select-native),
.stack-form input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]) {
  min-height: var(--control-min-height);
  font-size: var(--control-font-size);
  line-height: 1.25;
}
.control:is(textarea), .compact-form textarea { font-size: var(--control-font-size); line-height: 1.45; }
.check-list { display: flex; flex-wrap: wrap; list-style: none; padding: 9px 0; margin: 0; }
.check-list label { font-weight: 400; }
.field-check { flex-direction: row; align-items: center; }
.field-check .control { width: auto; }
.form-section:has(.field-account_enabled) { border: 1px solid #cbd8d5; border-radius: 8px; background: #f3f7f6; padding: 20px; }
.form-section:has(.field-account_enabled) legend { padding: 0 10px; color: var(--forest); }
.form-section-contact { border: 1px solid #d9d5c9; border-radius: 8px; background: #faf8f3; padding: 20px; }
.form-section-contact legend { padding: 0 10px; color: #74664f; }
.field-account_enabled { grid-column: 1 / -1; display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: start; border-bottom: 1px solid #d8e2df; padding-bottom: 16px; }
.field-account_enabled .control { grid-column: 1; grid-row: 1; margin-top: 2px; }
.field-account_enabled label { grid-column: 2; grid-row: 1; font-size: 14px; }
.field-account_enabled small, .field-account_enabled .errorlist { grid-column: 2; }
.field-account_username, .field-account_password { align-self: start; }
.client-form .field-address, .client-form .field-billing_type, .client-form .field-billing_address { grid-column: 1 / -1; }
.client-form .field-excluded_operators, .care-request-form .field-required_skills, .operator-form .field-skills { grid-column: 1 / -1; gap: 8px; padding: 17px 18px 18px; border: 1px solid #d9d5c9; border-radius: 8px; background: #faf8f3; }
.client-form .field-excluded_operators > label, .care-request-form .field-required_skills > label, .operator-form .field-skills > label { color: var(--forest); font: 600 17px Georgia, serif; }
.care-request-form .field-required_skills > small { margin-top: -2px; line-height: 1.45; }
.client-form .field-excluded_operators > .check-list, .care-request-form .field-required_skills > .check-list, .operator-form .field-skills > .check-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; width: 100%; padding: 7px 0 0; }
.client-form .field-excluded_operators > .check-list > div > label, .care-request-form .field-required_skills > .check-list > div > label, .operator-form .field-skills > .check-list > div > label { display: flex; align-items: center; gap: 9px; min-height: 42px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 6px; background: white; color: var(--ink); cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s; }
.client-form .field-excluded_operators > .check-list > div > label:hover, .care-request-form .field-required_skills > .check-list > div > label:hover, .operator-form .field-skills > .check-list > div > label:hover { border-color: #9db5ae; background: #f5f9f7; }
.client-form .field-excluded_operators > .check-list > div > label:has(input:checked), .care-request-form .field-required_skills > .check-list > div > label:has(input:checked), .operator-form .field-skills > .check-list > div > label:has(input:checked) { border-color: #7fa08f; background: #eaf2ed; box-shadow: inset 3px 0 var(--forest); color: var(--forest); font-weight: 700; }
.client-form .field-excluded_operators input, .care-request-form .field-required_skills input, .operator-form .field-skills input { display: block; flex: 0 0 auto; width: 17px; height: 17px; margin: 0; padding: 0; accent-color: var(--forest); }
.client-form .field-excluded_operators > .check-list > div > label:has(input:checked) { border-color: #c98679; background: #f8e7e3; box-shadow: inset 3px 0 var(--rust); color: #8c3d2b; }
.client-form .field-excluded_operators input { accent-color: var(--rust); }
.request-plan-subtract-form { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.request-plan-subtract-form .field-dates { grid-column: 1 / -1; gap: 9px; border: 1px solid #d9d5c9; padding: 17px 18px 18px; }
.request-plan-subtract-form .field-dates > label { font: 600 17px Georgia, serif; }
.request-plan-subtract-form .field-dates > .plan-date-picker { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; width: 100%; padding: 2px 0 0; }
.request-plan-subtract-form .plan-date-picker > div > label { display: flex; align-items: center; gap: 9px; min-height: 42px; border: 1px solid var(--line); border-radius: 6px; padding: 9px 11px; background: white; color: var(--ink); cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s; }
.request-plan-subtract-form .plan-date-picker > div > label:hover { border-color: #9db5ae; background: #f5f9f7; }
.request-plan-subtract-form .plan-date-picker > div > label:has(input:checked) { border-color: #c98679; background: #f8e7e3; box-shadow: inset 3px 0 var(--rust); color: #8c3d2b; font-weight: 700; }
.request-plan-subtract-form .plan-date-picker input { display: block; flex: 0 0 auto; width: 17px; height: 17px; margin: 0; padding: 0; accent-color: var(--rust); }
.request-plan-subtract-form .field-whole_day { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr auto; gap: 5px 12px; align-items: center; border: 1px solid #cbd8d5; padding: 14px 16px; }
.request-plan-subtract-form .field-whole_day label { grid-column: 1; font-size: 14px; cursor: pointer; }
.request-plan-subtract-form .field-whole_day input { grid-column: 2; grid-row: 1; width: 19px; height: 19px; margin: 0; padding: 0; accent-color: var(--forest); cursor: pointer; }
.request-plan-subtract-form .field-whole_day small, .request-plan-subtract-form .field-whole_day .errorlist { grid-column: 1 / -1; }
.request-plan-subtract-form > .errorlist, .request-plan-subtract-form > section, .request-plan-subtract-form > button { grid-column: 1 / -1; }
.client-form .field-is_active { grid-column: 1 / -1; display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: start; border: 1px solid #cbd8d5; border-radius: 6px; background: #f3f7f6; padding: 15px; }
.client-form .field-is_active .control { grid-column: 1; grid-row: 1; margin-top: 2px; }
.client-form .field-is_active label { grid-column: 2; grid-row: 1; font-size: 14px; }
.client-form .field-is_active small, .client-form .field-is_active .errorlist { grid-column: 2; }
.form-actions { display: flex; gap: 8px; margin-top: 10px; }
.form-warning { margin-bottom: 20px; padding: 16px; }
.form-warning ul { margin: 10px 0; padding-left: 20px; }
.form-warning p { margin: 0; }
.errorlist { margin: 0; padding: 0; list-style: none; }
.context-strip { display: flex; justify-content: space-between; padding: 14px; margin-bottom: 22px; }
.settings-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.settings-panel { display: flex; flex-direction: column; }
.section-intro { margin: -7px 0 18px; font-size: 13px; }
.skill-list { border-top: 1px solid var(--line); }
.skill-row { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.skill-info { display: flex; flex-direction: column; gap: 3px; }
.skill-actions { display: flex; align-items: center; gap: 8px; }
.skill-row span { color: #2f7250; font-size: 11px; }
.skill-row.is-inactive { opacity: .62; }
.skill-row.is-inactive span { color: var(--muted); }
.settings-form { margin-top: auto; padding-top: 24px; }
.settings-form .button { justify-self: start; }
.compact-empty { padding: 24px 8px; }
.holiday-list { margin-bottom: 10px; }
.holiday-list article { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px; border: 1px solid var(--line); }
.holiday-list article > div:first-child { display: grid; gap: 3px; }
.head-actions > form, .skill-actions > form, .card-actions > form, .inline-actions > form { display: flex; margin: 0; }
.availability-toolbar { display: grid; grid-template-columns: minmax(220px, 1fr) auto auto; align-items: end; gap: 12px; margin-bottom: 20px; }
.availability-toolbar label { display: grid; gap: 5px; color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.availability-toolbar input { padding: 10px 12px; border: 1px solid var(--line); }
.availability-calendar-panel { margin-bottom: 20px; }
.availability-weekdays, .availability-month-week { display: grid; grid-template-columns: repeat(7, minmax(100px, 1fr)); }
.availability-month-calendar { min-width: 700px; border: 1px solid var(--line); }
.availability-weekdays span { padding: 8px; background: var(--forest); color: white; text-align: center; font-size: 11px; font-weight: 800; }
.availability-day { min-height: 112px; padding: 7px; border-top: 1px solid var(--line); border-right: 1px solid var(--line); }
.availability-day.outside { opacity: .55; }
.availability-day > strong { display: block; margin-bottom: 6px; font-size: 12px; }
.availability-event { display: grid; gap: 2px; margin-bottom: 4px; padding: 6px; font-size: 11px; }
.availability-event small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.availability-cell-add { width: 100%; min-height: 28px; border: 1px dashed #9db5ae; background: transparent; color: var(--forest); cursor: pointer; font-size: 16px; }
.availability-cell-add:hover { background: #edf5ef; border-color: var(--forest); }
.availability-day .availability-cell-add { min-height: 65px; }
.availability-month-calendar { overflow: hidden; }
.availability-calendar-panel { overflow-x: auto; }
.billing-products .product-state { display: inline-block; padding: 4px 8px; font-weight: 800; }
.billing-products .card-actions { flex-direction: row; align-items: center; white-space: nowrap; }
.billing-filter { display: flex; align-items: end; flex-wrap: wrap; gap: 10px; margin: -12px 0 20px; }
.sales-document-form .field[hidden], .client-form .field[hidden] { display: none !important; }
.billing-filter select { min-width: 180px; padding: 9px 12px; border: 1px solid var(--line); }
.document-list-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; margin: -12px 0 20px; }
.document-list-toolbar .billing-filter, .document-toolbar-actions .bulk-document-actions { margin: 0; }
.document-list-toolbar .billing-filter { flex: 1 1 auto; flex-wrap: nowrap; min-width: 0; }
.document-list-toolbar .billing-filter select { width: 145px; min-width: 145px; }
.document-filter-search { flex: 1 1 280px; width: auto; min-width: 220px; }
.document-date-filter { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 400; white-space: nowrap; }
.document-date-filter input { width: 145px; font-weight: 400; }
.document-toolbar-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.document-toolbar-actions .button { min-width: 150px; }
.sort-link { display: inline-flex; align-items: center; gap: 5px; color: inherit; white-space: nowrap; }
.sort-link::after { content: "\2195"; font-size: 10px; }
.sort-link.active.asc::after { content: "\2191"; color: var(--forest); }
.sort-link.active.desc::after { content: "\2193"; color: var(--forest); }
.bulk-document-actions { display: flex; justify-content: flex-end; align-items: end; gap: 10px; margin: -8px 0 14px; }
.bulk-document-actions label { display: grid; gap: 4px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.bulk-document-actions input { width: 140px; padding: 8px 10px; }
.document-selection-head label { display: flex; align-items: center; gap: 7px; font-size: 9px; }
.document-selection-cell .document-selection-grid > span { min-height: 18px; display: flex; align-items: center; }
.document-selection-grid input { margin: 0; }
.document-state { display: inline-block; padding: 4px 8px; background: #e6ece8; color: var(--ink); font-weight: 800; }
.sdi-state { display: inline-block; padding: 4px 8px; border-radius: 20px; background: #e6ece8; color: var(--ink); font-size: 11px; font-weight: 800; white-space: nowrap; }
.sdi-state.ready { background: #eef2ef; color: #405248; }
.sdi-state.submitting, .sdi-state.waiting, .sdi-state.quarantena, .sdi-state.sent { background: #dce8f2; color: #1e4f72; }
.sdi-state.delivered { background: var(--mint); color: #174c36; }
.sdi-state.rejected { background: #e9b6a8; color: #7b2617; }
.email-state { display: inline-block; padding: 4px 8px; border-radius: 20px; background: #e6ece8; color: var(--ink); font-size: 11px; font-weight: 800; white-space: nowrap; }
.email-state.sent { background: var(--mint); color: #174c36; }
.email-state.sending { background: #dce8f2; color: #1e4f72; }
.email-state.unknown { background: var(--amber); color: #6e4910; }
.email-state.error, .email-state.missing { background: #f5d8d0; color: #7b2617; }
.email-state-note, .email-error-detail { display: block; margin-top: 4px; max-width: 210px; font-size: 10px; line-height: 1.35; }
.email-error-detail { color: #7b2617; }
.sdi-storage-state, .sdi-state-note { display: block; margin-top: 4px; max-width: 220px; font-size: 11px; line-height: 1.35; }
.sdi-storage-state { color: #174c36; font-weight: 700; }
.sdi-state-note, .sdi-error-detail { color: #7b2617; }
.sdi-status-panel, .sdi-send-panel { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.sdi-status-panel h2 { margin: 5px 0; }
.sdi-status-panel p, .sdi-send-panel p { margin-bottom: 0; }
.sdi-preservation { display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.sdi-notification-list { display: grid; gap: 10px; }
.sdi-notification-list > div { display: flex; gap: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.sdi-notification-list > div:last-child { padding-bottom: 0; border-bottom: 0; }
.billing-line-form { grid-template-columns: minmax(240px, 2fr) 1fr 1fr auto; align-items: end; border-top: 1px solid var(--line); padding-top: 18px; }
.billing-line-form .button { align-self: end; }
.manual-line-panel { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 16px; }
.manual-line-panel summary { font-weight: 800; cursor: pointer; }
.manual-line-form { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
.manual-line-form .field:nth-child(2), .manual-line-form .button { grid-column: 1 / -1; }
.billing-client-group td { border-top: 2px solid var(--forest); }
.billing-generation-actions label { display: grid; gap: 4px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.billing-generation-actions input { min-width: 155px; height: 40px; padding: 7px 9px; }
.billing-generation-actions .button { min-height: 40px; }
.billing-document-columns { display: grid; grid-template-columns: 1.5fr 1fr; gap: 20px; }
.billing-summary-row, .billing-totals > div { display: flex; justify-content: space-between; gap: 20px; padding: 10px 0; border-top: 1px solid var(--line); }
.billing-totals .grand { margin-top: 8px; font-size: 20px; }
.issue-panel h2 { margin-top: 0; }
.missing-progressive { background: #fff2d6; color: #7a3f00; }
.due-period-filter { display: flex; align-items: center; flex-wrap: wrap; margin: -12px 0 20px; }
.due-period-filter [hidden] { display: none !important; }
.due-period-mode { width: 190px; }
.due-month-input { width: 170px; }
.due-year-input { width: 110px; }
.due-date-filter { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 400; white-space: nowrap; }
.due-date-filter input { width: 145px; font-weight: 400; }
.due-summary-panel { margin-top: 0; }
.due-summary-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.due-summary-row > div { min-width: 0; border-right: 1px solid var(--line); }
.due-summary-row > div:last-child { border-right: 0; }
.due-summary-row span { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }
.due-summary-row strong { display: block; font: 600 clamp(21px, 2.2vw, 30px) Georgia, serif; white-space: nowrap; }
.due-summary-row .collected strong { color: var(--forest); }
.due-summary-row .outstanding strong { color: var(--rust); }
.due-actions-cell { min-width: 210px; vertical-align: top; }
.due-actions-menu { width: min(360px, 72vw); border: 1px solid var(--line); }
.due-actions-menu summary { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 12px; cursor: pointer; list-style: none; font-weight: 800; }
.due-actions-menu summary::-webkit-details-marker { display: none; }
.due-actions-menu summary::after { content: "+"; font: 600 18px Georgia, serif; line-height: 1; }
.due-actions-menu[open] summary::after { content: "−"; }
.due-actions-menu summary small { margin-left: auto; color: var(--muted); font-size: 9px; font-weight: 500; letter-spacing: 0; text-transform: none; }
.due-actions-panel { padding: 14px; border-top: 1px solid var(--line); background: white; }
.due-actions-overview { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.due-actions-overview span { color: var(--muted); font-size: 11px; }
.due-actions-overview strong { font: 600 21px Georgia, serif; }
.due-payment-form { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.due-payment-form label { display: grid; gap: 4px; color: var(--muted); font-size: 10px; font-weight: 700; }
.due-payment-form input, .due-payment-form select, .due-payment-item input { width: 100%; min-width: 0; border: 1px solid #c8c8c0; padding: 8px 9px; font: inherit; }
.due-payment-form .button { align-self: end; justify-self: start; }
.due-quick-balance { margin-top: 8px; }
.due-payment-history { display: grid; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.due-payment-item { display: grid; gap: 8px; padding: 10px; border: 1px solid #dfe4df; background: #f7f9f7; }
.due-payment-item > div { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.due-payment-item span, .due-payment-item small { color: var(--muted); font-size: 10px; }
.due-payment-item form { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; }
.due-payment-item.is-reversed > div { text-decoration: line-through; }
.due-mark-unpaid { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.balance-period { margin-bottom: 22px; }
.balance-period .panel-head { margin-bottom: 12px; }
.balance-columns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.balance-card { display: flex; flex-direction: column; justify-content: space-between; padding: 22px; color: white; }
.balance-card.total { color: var(--ink); }
.balance-card.total.negative { color: white; }
.balance-card > span { font-weight: 800; }
.balance-card strong { font: 600 clamp(29px, 4vw, 48px) Georgia, serif; }
.balance-card small { opacity: .78; }
.balance-ledgers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.ledger-list article { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 12px; border-top: 1px solid var(--line); padding: 13px 0; }
.ledger-list article > div { display: flex; flex-direction: column; gap: 3px; }
.ledger-list article span { color: var(--muted); font-size: 11px; }
.money-in { color: #2f7250; }
.money-out { color: var(--rust); }
.expense-entry { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 16px; }
.expense-entry summary { font-weight: 800; cursor: pointer; }
.document-print-page { min-width: 210mm; padding: 30px; font-size: 11px; }
.document-pages { display: grid; justify-content: center; gap: 24px; }
.document-sheet { position: relative; width: 210mm; height: 297mm; display: flex; flex-direction: column; margin: auto; padding: 10mm; overflow: hidden; background: white; }
.document-sheet[hidden] { display: none !important; }
.document-page-content { min-height: 0; flex: 1; overflow: hidden; }
.document-sheet span { display: block; }
.document-sheet footer { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; min-height: 9mm; margin-top: 4mm; border-top: 1px solid var(--line); padding-top: 3mm; color: var(--muted); font-size: 10px; }
.document-sheet footer > span:first-child { max-width: 75%; }
.document-page-number { flex: 0 0 auto; margin-left: auto; color: var(--ink); font-weight: 800; white-space: nowrap; }
.invoice-head { display: grid; grid-template-columns: 1fr auto; gap: 30px; border-bottom: 2px solid var(--forest); padding-bottom: 20px; }
.invoice-company { display: flex; flex-direction: column; gap: 3px; font-size: 11px; }
.invoice-company img { width: 270px; max-height: 70px; object-fit: contain; object-position: left center; margin-bottom: 8px; }
.invoice-company > strong { font-size: 17px; }
.invoice-identity { text-align: right; }
.invoice-identity h1 { margin: 0 0 8px; font: 600 34px Georgia, serif; }
.invoice-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 22px 0; }
.invoice-parties section { min-height: 125px; padding: 16px; }
.invoice-label { font-weight: 800; }
.assisted-label { margin-top: 28px; }
.invoice-lines thead { display: table-header-group; }
.invoice-lines th, .invoice-lines td { padding: 7px 8px; }
.invoice-lines tr { break-inside: avoid; }
.invoice-lines th:nth-child(n+4), .invoice-lines td:nth-child(n+4) { text-align: right; white-space: nowrap; }
.invoice-lines .invoice-service-time { text-align: left; white-space: nowrap; }
.invoice-source td { border-bottom: 0; padding-top: 15px; font-weight: 800; }
.invoice-electronic-note { margin: 22px 0; font-size: 11px; }
.invoice-closing { display: grid; grid-template-columns: 1.5fr 1fr; gap: 25px; break-inside: avoid; }
.invoice-closing h2 { margin: 0 0 8px; font-size: 12px; }
.invoice-summary-row { display: grid; grid-template-columns: 1fr auto auto; gap: 18px; border-top: 1px solid var(--line); padding: 7px 0; }
.invoice-summary-row small { display: block; color: var(--muted); }
.invoice-payment { display: grid; grid-template-columns: 1fr 1fr; gap: 25px; margin-top: 30px; }
.invoice-totals { padding: 14px 18px; }
.invoice-totals > div { display: flex; justify-content: space-between; gap: 18px; padding: 6px 0; }
.invoice-totals .grand { margin-top: 55px; border-top: 2px solid white; font-size: 18px; }
.invoice-notes { break-inside: avoid; margin-top: 20px; }
.invoice-continuation-head { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-bottom: 8mm; border-bottom: 2px solid var(--forest); padding-bottom: 4mm; }
.invoice-continuation-head strong { color: var(--ink); font-size: 15px; }
.invoice-continuation-head span { color: var(--muted); }
.draft-watermark { position: absolute; top: 350px; left: 120px; transform: rotate(-28deg); font-size: 120px; font-weight: 900; letter-spacing: .12em; }
.print-actions { width: min(210mm, 100%); margin: 0 auto 16px; text-align: right; }
.availability-form-grid { display: grid; grid-template-columns: repeat(2, minmax(280px, 1fr)); }
.availability-featured { grid-column: 1 / -1; }
.availability-full-day-form { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
.availability-full-day-form .field-note, .availability-full-day-form .button { grid-column: 1 / -1; }
.availability-full-day-form .field-note textarea { height: 124px; overflow-y: auto; resize: none; line-height: 1.45; }
.availability-exception-form { display: flex; align-items: end; gap: 14px; }
.availability-exception-fields { flex: 1; grid-template-columns: repeat(2, minmax(180px, 1fr)); }
.availability-standard-panel { display: flex; flex-direction: column; }
.availability-standard-panel .compact-form { display: flex; flex: 1; flex-direction: column; }
.availability-standard-panel .compact-form > .button { margin-top: auto; }
.availability-form-fields { display: grid; gap: 11px; }
.availability-form-fields > div { display: grid; gap: 5px; }
.availability-weekly-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.availability-weekly-fields .field-operator, .availability-weekly-fields .field-month, .availability-weekly-fields .field-weeks, .availability-weekly-fields .field-weekdays { grid-column: 1 / -1; }
.compact-form { display: grid; gap: 11px; margin-top: 22px; }
.compact-form > div { display: grid; gap: 5px; }
.compact-form > .button { justify-self: start; }
.compact-form .field:has(.check-list) { display: grid; }
.weekday-picker { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; padding: 0; }
.field-weeks > .week-picker { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.weekday-picker > div { min-width: 0; }
.weekday-picker label { display: flex; align-items: center; gap: 7px; min-height: 38px; border: 1px solid var(--line); padding: 8px 9px; color: var(--muted); cursor: pointer; }
.weekday-picker label:has(input:checked) { font-weight: 800; }
.weekday-picker input { appearance: none; flex: 0 0 17px; width: 17px; height: 17px; margin: 0; border: 1px solid #9ba9a5; border-radius: 4px; background: white; }
.weekday-picker input:checked { border-color: var(--forest); background: var(--forest); box-shadow: inset 0 0 0 4px white; }
.weekday-picker input:focus-visible { outline: 2px solid var(--forest); outline-offset: 2px; }
.request-create-form .field-required_skills .check-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; padding: 0; }
.request-create-form .field-required_skills .check-list > div { min-width: 0; }
.request-create-form .field-required_skills .check-list label { display: flex; align-items: center; gap: 7px; min-height: 38px; border: 1px solid var(--line); border-radius: 5px; padding: 8px 9px; background: #f8faf9; color: var(--muted); cursor: pointer; }
.request-create-form .field-required_skills .check-list label:has(input:checked) { border-color: #75a7ad; background: var(--mint); color: var(--forest); font-weight: 800; }
.request-create-form .field-required_skills input { flex: 0 0 17px; width: 17px; height: 17px; }
.request-create-form textarea { width: 100%; resize: vertical; }
.request-merge-warning > p { margin-top: 6px; }
.request-merge-conflicts { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 8px; margin-top: 14px; }
.request-merge-conflicts article { display: flex; flex-direction: column; gap: 4px; border: 1px solid #d6a64e; border-radius: 5px; padding: 10px; background: #fffaf0; }
.request-merge-conflicts small { white-space: pre-line; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; }
th, td { border-bottom: 1px solid var(--line); vertical-align: middle; }
td > span { display: block; color: var(--muted); margin-top: 3px; }
.coverage-table tr.coverage-uncovered td:first-child { border-left: 4px solid var(--rust); }
.coverage-table tr.coverage-partial td:first-child { border-left: 4px solid var(--amber); }
.coverage-table tr.coverage-covered td:first-child { border-left: 4px solid #61a67f; }
.note-box { border-left: 4px solid var(--amber); background: #eee8d8; padding: 18px 20px; margin-bottom: 20px; }
.note-box p { margin-bottom: 0; white-space: pre-line; }
.candidate-list article { display: flex; gap: 12px; align-items: center; border-top: 1px solid var(--line); padding: 13px 0; }
.candidate-list article > div { display: flex; flex: 1; flex-direction: column; gap: 3px; }
.candidate-list span { color: var(--muted); font-size: 11px; }
.inline-actions { display: flex !important; flex-direction: row !important; align-items: center; font-size: 11px; }
.inline-actions > a, .inline-actions .link-button { min-height: 28px; display: inline-flex; align-items: center; padding-block: 0; line-height: 1.2; }
.calendar-shell { overflow-x: auto; border: 1px solid var(--line); }
.calendar-fixed-header { position: fixed; z-index: 24; display: none; overflow: hidden; border: 1px solid var(--line); background: white; pointer-events: none; }
.calendar-fixed-header.is-visible, .calendar-fixed-scrollbar.is-visible { display: block; }
.calendar-fixed-header .month-grid { position: absolute; top: 0; left: 0; }
.calendar-fixed-header .month-grid > .month-corner:first-child { visibility: hidden; }
.calendar-fixed-header .hour-grid { position: absolute; top: 0; left: 0; overflow: visible; }
.calendar-fixed-header .hour-grid > .hour-grid-corner:first-child { visibility: hidden; }
.calendar-fixed-summary-header .week-grid { position: absolute; top: 0; left: 0; overflow: visible; border: 0; }
.calendar-fixed-summary-header .week-column { min-height: 0; }
.calendar-fixed-corner { position: absolute !important; inset: 0 auto 0 0; z-index: 4 !important; box-sizing: border-box; }
.calendar-fixed-scrollbar { position: fixed; bottom: 0; z-index: 25; display: none; height: 17px; overflow-x: auto; overflow-y: hidden; border: 1px solid var(--line); box-shadow: 0 -4px 12px #18352b1f; }
.calendar-fixed-scrollbar > div { height: 1px; }
.month-grid { display: grid; grid-template-columns: 170px repeat(var(--days), minmax(92px, 1fr)); min-width: calc(170px + var(--days) * 92px); }
.month-corner, .month-day, .month-person, .month-cell { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); min-height: 50px; }
.month-corner, .month-person { position: sticky; left: 0; z-index: 2; padding: 12px; font-size: 12px; font-weight: 700; }
.month-corner { z-index: 3; text-transform: uppercase; }
.month-day { display: flex; flex-direction: column; align-items: center; padding: 8px; }
.month-day small { font-size: 9px; text-transform: uppercase; }
.month-day strong { font: 600 18px Georgia, serif; }
.month-cell { padding: 4px; position: relative; }
.cell-add, .client-cell-add { float: right; display: grid; place-items: center; border: 1px solid transparent; border-radius: 50%; background: transparent; cursor: pointer; line-height: 1; }
.month-cell:hover .cell-add, .cell-add:focus, .month-cell:hover .client-cell-add, .client-cell-add:focus { opacity: 1; color: var(--forest); }
.month-cell a, .month-event { display: flex; flex-direction: column; align-items: center; padding: 5px; margin-bottom: 3px; text-align: center; overflow: hidden; }
.operator-event { margin-bottom: 3px; overflow: hidden; }
/* Matita dei quadri: sovrapposta al riquadro, compare su hover senza aggiungere altezza. */
@media screen {
  [data-board-card] { position: relative; }
  .calendar-workspace [data-board-card] > .calendar-board-edit { position: absolute; z-index: 1; top: 4px; left: 4px; display: flex; align-items: center; justify-content: center; width: 24px; min-height: 24px; height: 24px; margin: 0; padding: 0; border: 1px solid var(--client-color-border, var(--line)); border-radius: 5px; background: var(--white); color: var(--teal-deep); text-decoration: none; opacity: 0; pointer-events: none; transition: opacity .15s ease; }
  .calendar-board-edit svg { width: 12px; height: 12px; }
  [data-board-card]:hover > .calendar-board-edit,
  [data-board-card] > .calendar-board-edit:focus-visible { opacity: 1; pointer-events: auto; }
  .calendar-workspace .calendar-board-edit:hover { background: var(--surface-soft); }
  .calendar-board-edit:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
}
@media print { .calendar-board-edit { display: none !important; } }
/* Simboli SVG condivisi (base.html): definiti una volta, richiamati con <use>, senza spazio nella pagina. */
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.calendar-workspace :is([data-calendar-row-label], [data-calendar-row-cell])[hidden] { display: none !important; }
.operator-event.opportunity { background: var(--amber); }
.month-cell .operator-event > a, .operator-event > .month-event { margin: 0; border-radius: 0; background: transparent; }
.operator-event-action { margin: 0; }
.operator-event-action button, button.operator-event-action { width: 100%; border: 0; border-top: 1px solid #0002; padding: 4px; background: #fff9; cursor: pointer; font-weight: 800; }
.operator-event-action button:hover, button.operator-event-action:hover { background: white; }
.client-event { margin-bottom: 3px; overflow: hidden; }
.client-event.current-request { position: relative; z-index: 1; outline: 3px solid #f0a51a; outline-offset: 2px; }
.month-cell .client-event.coverage-uncovered { background: #e9b6a8; }
.month-cell .client-event.coverage-partial { background: var(--amber); }
.client-event .client-event-main { align-items: center; margin: 0; border-radius: 0; background: transparent; text-align: center; }
.client-event-main b, .client-event-main span { width: 100%; text-align: center; }
.client-event-main b { white-space: nowrap; }
.client-event-main span { margin-top: 2px; }
.client-event-assign, .client-event-remove { width: 100%; border: 0; border-top: 1px solid #0002; padding: 4px; background: #fff9; cursor: pointer; font-weight: 800; }
.client-event-assign:hover, .client-event-remove:hover { background: white; }
.client-event-uncovered-label { color: var(--rust); font-weight: 900; }
.operator-event-assign[data-past-warning="true"], .client-event-assign[data-past-warning="true"] { background: #c62828; color: white; }
.operator-event-assign[data-past-warning="true"]:hover, .client-event-assign[data-past-warning="true"]:hover { background: #a61f1f; }
.client-event-unavailable { display: grid; align-content: center; width: 100%; border-top: 1px solid #0002; padding: 4px; background: #fff1ed; cursor: default; font-weight: 700; text-align: center; }
.client-event-remove-form { margin: 0; }
.client-event-reorganize { display: block; border-top: 1px solid #0002; padding: 5px 3px; color: white; text-align: center; white-space: nowrap; font-weight: 800; }
.reorganization-summary { border-left: 5px solid var(--forest); }
.reorganization-list { display: grid; gap: 8px; }
.reorganization-list article { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 12px 14px; border: 1px solid var(--line); }
.reorganization-list article div { display: flex; flex-direction: column; gap: 3px; }
.reorganization-list article div:last-child { align-items: flex-end; }
.reorganization-list del { color: var(--muted); }
.reorganization-warnings { margin: 0; padding-left: 22px; display: grid; gap: 8px; }
.quick-dialog { width: min(760px, calc(100vw - 28px)); max-height: calc(100vh - 30px); padding: 0; color: var(--ink); }
.dialog-head { display: flex; align-items: start; justify-content: space-between; }
.dialog-head h2 { font: 600 32px Georgia, serif; margin: 4px 0; }
.dialog-head p { margin: 0; color: var(--muted); }
.dialog-close { border: 0; background: transparent; font-size: 29px; cursor: pointer; }
.quick-fields { display: grid; grid-template-columns: 2fr 1.2fr 1fr 1.2fr 1fr 1.2fr; gap: 12px; margin: 20px 0; }
.quick-fields.request-only-fields { grid-template-columns: 1.2fr 1fr 1.2fr 1fr 1.2fr; }
.request-only-fields .quick-client-field { grid-column: 1 / -1; }
.assignment-search-fields { grid-template-columns: repeat(2, minmax(245px, 1fr)) auto; align-items: end; }
.assignment-search-fields #find-assignment-operators { align-self: end; white-space: nowrap; }
.quick-fields label { display: grid; gap: 6px; font-size: 11px; font-weight: 700; }
.quick-fields input, .quick-fields select { width: 100%; min-width: 0; border: 1px solid #c8c8c0; padding: 9px; }
.quick-description { grid-column: 1 / -1; }
.h24-badge { align-self: flex-start; margin-top: 2px; padding: 2px 5px; border-radius: 10px; background: var(--forest); color: white; font-size: 8px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.operator-picker { border: 1px solid var(--line); padding: 16px; }
.operator-picker-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 11px; }
.operator-picker-head h3 { margin: 2px 0; font: 600 20px Georgia, serif; }
.operator-results { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; max-height: 210px; overflow-y: auto; }
.operator-results > p { grid-column: 1 / -1; color: var(--muted); font-size: 12px; }
.operator-option { display: flex; gap: 10px; align-items: center; border: 1px solid var(--line); background: white; padding: 11px; border-radius: 5px; cursor: pointer; }
.operator-option:has(input:checked) { border-color: var(--forest); background: #e2eee7; }
.operator-option span { display: flex; flex-direction: column; gap: 3px; }
.operator-option small { color: var(--muted); font-size: 9px; }
.no-candidates { color: #8c3d2b !important; }
.dialog-actions { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-top: 18px; }
.dialog-actions > span { color: var(--muted); font-size: 11px; }
.dialog-actions > div { display: flex; gap: 8px; }
.assignment-dialog-body { padding: 26px; }
.dialog-candidate-list { max-height: 360px; margin: 20px 0; overflow-y: auto; }
.dialog-candidate-list article { align-items: flex-start; }
.dialog-candidate-list article form { display: grid; gap: 8px; min-width: min(390px, 58%); }
.mileage-controls { display: grid; grid-template-columns: 1.7fr repeat(2, minmax(82px, .65fr)); gap: 7px; }
.mileage-controls label { display: grid; gap: 3px; color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.mileage-controls select, .mileage-controls input { width: 100%; min-width: 0; border: 1px solid #c8c8c0; border-radius: 4px; padding: 7px; background: white; color: var(--ink); font-size: 11px; }
.mileage-controls input[readonly] { background: #efeee8; }
.mileage-inherited-note { margin: 0; color: var(--forest); font-size: 10px; font-weight: 800; }
.access-mileage-row { display: flex; justify-content: space-between; border-top: 1px solid var(--line); padding: 12px 0; }
.access-mileage-row > div { display: grid; gap: 3px; }
.access-mileage-row span { color: var(--muted); font-size: 11px; }
.mileage-edit-dialog > form { padding: 26px; }
.mileage-dialog-fields { margin: 20px 0; }
.week-grid { display: grid; grid-template-columns: repeat(7, minmax(150px, 1fr)); background: var(--line); border: 1px solid var(--line); overflow-x: auto; }
.week-column { min-width: 150px; min-height: 470px; }
.week-column > header { padding: 14px; display: flex; align-items: center; justify-content: space-between; text-transform: capitalize; }
.week-column > header strong { font: 600 24px Georgia, serif; }
.week-column.weekend > header { background: #efe5d1; }
.week-events { padding: 8px; display: flex; flex-direction: column; gap: 7px; }
.week-event { border-left: 3px solid var(--forest); padding: 9px; display: flex; flex-direction: column; gap: 4px; font-size: 11px; }
.week-event time { font-weight: 800; }
.week-event span, .no-events { color: var(--muted); font-size: 10px; }
.operator-period-brief { margin-top: 28px; color: var(--ink); }
.operator-period-brief-head { border-bottom: 2px solid var(--forest); padding-bottom: 14px; }
.operator-period-brief-head > span { color: var(--forest); font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.operator-period-brief-head h1 { margin: 5px 0 3px; font: 600 30px Georgia, serif; }
.operator-period-brief-head p { margin: 0; color: var(--muted); }
.operator-period-groups { display: grid; gap: 22px; margin-top: 18px; }
.operator-period-group { break-inside: avoid; page-break-inside: avoid; }
.operator-period-group > h2 { margin: 0 0 9px; padding: 8px 11px; background: var(--forest); color: white; font: 600 18px Georgia, serif; }
.operator-period-clients { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.operator-period-client { border: 1px solid var(--line); padding: 14px; break-inside: avoid; page-break-inside: avoid; background: white; }
.operator-period-client > header { border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.operator-period-client h3 { margin: 0; font: 600 20px Georgia, serif; }
.operator-period-client > header p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.operator-period-client h4 { margin: 0 0 4px; color: var(--forest); font-size: 9px; letter-spacing: .06em; text-transform: uppercase; }
.operator-period-note { margin-top: 10px; }
.operator-period-note p { margin: 3px 0; white-space: normal; }
.operator-period-access-note { margin-top: 5px; padding-left: 9px; border-left: 2px solid #c7d9cf; }
.summary-month-calendar { width: 100%; border: 1px solid var(--line); }
.summary-month-weekdays, .summary-month-week { min-width: 1050px; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; }
.summary-month-weekdays span { background: #e8e6de; padding: 10px 12px; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.summary-month-week { margin-top: 1px; }
.summary-month-day { min-height: 190px; background: var(--white); }
.summary-month-day.weekend { background: #f7f0e3; }
.summary-month-day.outside-month { min-height: 40px; background: #e3dfe4; }
.summary-month-day > header { display: flex; align-items: center; justify-content: space-between; padding: 9px 10px; border-bottom: 1px solid var(--line); }
.summary-month-day > header span { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.summary-month-day > header strong { font: 600 18px Georgia, serif; }
.summary-month-events { display: flex; flex-direction: column; gap: 5px; padding: 6px; }
.summary-event { display: flex; flex-direction: column; gap: 3px; padding: 7px; border-left: 3px solid var(--forest); font-size: 10px; }
.summary-event time { font-weight: 800; }
.summary-event span { color: var(--muted); font-size: 9px; line-height: 1.3; }
.filter-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin-bottom: 22px; }
.report-section { margin: 35px 0 50px; }
.section-title { display: flex; gap: 15px; align-items: start; margin-bottom: 16px; }
.section-title > span { background: var(--forest); color: white; padding: 8px; font-weight: 800; }
.section-title h2 { margin: 0; font: 600 27px Georgia, serif; }
.section-title p { margin: 4px 0; color: var(--muted); }
.report-table { background: white; font-size: 11px; }
.report-table th { min-width: 80px; }
.report-table th:first-child { min-width: 160px; }
.simple-list > div { display: flex; flex-direction: column; gap: 2px; border-top: 1px solid var(--line); padding: 10px 0; }
.simple-list span { color: var(--muted); font-size: 11px; }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: 1.35fr 1fr; background: var(--forest); }
.login-intro { padding: clamp(40px, 9vw, 140px); display: flex; justify-content: center; flex-direction: column; color: white; background: linear-gradient(90deg, #24535bcc, #47848d99), url("../img/marchio/accesso.c2149c53635d.jpg") center/cover; }
.login-agency-logo { width: min(330px, 72%); height: auto; margin-bottom: clamp(35px, 7vh, 80px); }
.login-intro .eyebrow { color: white; }
.login-intro h1 { max-width: 700px; font: 500 clamp(55px, 8vw, 112px)/.88 Georgia, serif; margin: 20px 0 35px; }
.login-intro p { max-width: 520px; color: white; font-size: 18px; }
.login-card { margin: 25px; padding: clamp(35px, 6vw, 90px); display: flex; justify-content: center; flex-direction: column; }
.product-label { margin-top: 28px; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.login-card h2 { font: 600 34px Georgia, serif; margin: 8px 0 25px; }
.stack-form { display: grid; gap: 18px; }
.stack-form label { display: grid; gap: 7px; font-size: 12px; font-weight: 700; }
.stack-form input { border: 1px solid var(--line); background: white; padding: 13px; border-radius: 4px; }
.error-note { color: #9f3325; }
@media (max-width: 1350px) {
  .document-list-toolbar .billing-filter { flex-wrap: wrap; }
  .document-filter-search { flex-basis: 100%; width: 100%; }
}
@media (max-width: 1050px) {
  .card-grid, .settings-layout, .availability-form-grid, .billing-document-columns, .balance-ledgers { grid-template-columns: 1fr; }
  .billing-line-form { grid-template-columns: 1fr 1fr; }
  .manual-line-form { grid-template-columns: 1fr 1fr; }
  .availability-featured { grid-column: auto; }
  .availability-full-day-form, .availability-weekly-fields { grid-template-columns: 1fr; }
  .availability-full-day-form .field-note, .availability-full-day-form .button, .availability-weekly-fields .field-operator, .availability-weekly-fields .field-month, .availability-weekly-fields .field-weekdays { grid-column: auto; }
  .availability-exception-form { align-items: stretch; flex-direction: column; }
  .availability-exception-fields { grid-template-columns: 1fr; }
  .week-grid { grid-template-columns: repeat(7, 170px); }
  .client-directory-results.list-view .person-main { grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr); }
  .operator-directory-results.list-view .person-main { grid-template-columns: minmax(180px, 1fr) minmax(200px, 1.4fr); }
  .due-summary-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .due-summary-row > div { border-bottom: 1px solid var(--line); }
  .due-summary-row > div:nth-child(3n) { border-right: 0; }
  .due-summary-row > div:nth-last-child(-n+2) { border-bottom: 0; }
}
@media (max-width: 760px) {
  .mobile-header { position: sticky; top: 0; display: flex; justify-content: space-between; z-index: 30; }
  .brand-small { display: flex; align-items: center; color: white; font-weight: 800; letter-spacing: .08em; }
  .brand-small img { height: auto; }
  .menu-button { padding: 7px 11px; font-size: var(--control-font-size); font-weight: 700; }
  .sidebar { transform: translateX(-100%); transition: transform .2s; }
  .menu-open .sidebar { transform: translateX(0); }
  .page-head { flex-direction: column; }
  .model-form { grid-template-columns: 1fr; }
  .form-section-fields { grid-template-columns: 1fr; }
  .field { grid-column: 1 !important; }
  .person-card { grid-template-columns: auto 1fr; }
  .card-actions { grid-column: 2; flex-direction: row; align-items: center; }
  .login-shell { grid-template-columns: 1fr; }
  .login-intro { min-height: 44vh; padding: 35px; }
  .request-plan-subtract-form { grid-template-columns: 1fr; }
  .quick-fields { grid-template-columns: 1fr 1fr; }
  .quick-fields.request-only-fields { grid-template-columns: 1fr 1fr; }
  .assignment-search-fields { grid-template-columns: 1fr; }
  .assignment-search-fields #find-assignment-operators { width: 100%; }
  .quick-client-field, .quick-required, .quick-description { grid-column: 1 / -1; }
  .operator-results { grid-template-columns: 1fr; }
  .availability-toolbar { grid-template-columns: 1fr; }
  .dialog-actions { align-items: stretch; flex-direction: column; }
  .filter-bar .client-combobox { width: 100%; }
  .client-list-toolbar, .client-directory-filter, .client-list-options, .billing-client-toolbar { align-items: stretch; flex-direction: column; }
  .billing-client-toolbar .client-combobox, .client-list-toolbar .client-combobox { flex-basis: auto; width: 100%; }
  .billing-client-toolbar > .button { width: 100%; }
  .report-toolbar, .report-toolbar .month-nav { align-items: stretch; flex-direction: column; }
  .report-toolbar > .button { width: 100%; }
  .calendar-summary-toolbar, .calendar-summary-toolbar .month-nav, .calendar-summary-toolbar .head-actions { align-items: stretch; flex-direction: column; }
  .calendar-summary-toolbar .month-nav { flex: none; width: 100%; }
  .calendar-summary-entity-filter { flex-basis: auto; width: 100%; }
  .calendar-summary-toolbar .calendar-summary-filter-type { flex: none; width: 100%; min-width: 0; }
  .calendar-summary-toolbar .calendar-summary-entity-filter { width: 100%; }
  .calendar-summary-toolbar .button { width: 100%; }
  .operator-period-clients { grid-template-columns: 1fr; }
  .client-list-options { width: 100%; }
  .client-list-options > .button { width: 100%; }
  .view-switch .button { flex: 1; min-width: 0; }
  .client-directory-results.list-view .person-main { grid-template-columns: 1fr; gap: 5px; }
  .client-directory-results.list-view .client-invoice-email { grid-column: auto; }
  .client-directory-results.list-view .card-actions { grid-column: 2; }
  .operator-directory-results.list-view .person-main { grid-template-columns: 1fr; gap: 5px; }
  .operator-directory-results.list-view .card-actions { grid-column: 2; justify-content: flex-start; }
  .billing-filter, .bulk-document-actions { align-items: stretch; flex-direction: column; }
  .billing-filter select { width: 100%; }
  .document-filter-search, .document-date-filter input { width: 100%; }
  .bulk-document-actions input { width: 100%; }
  .document-list-toolbar, .document-toolbar-actions { align-items: stretch; flex-direction: column; }
  .document-list-toolbar .billing-filter { flex: none; }
  .document-toolbar-actions { margin-left: 0; }
  .document-toolbar-actions, .document-toolbar-actions .button { width: 100%; }
  .document-date-filter { align-items: stretch; flex-direction: column; gap: 4px; }
  .due-period-filter, .due-date-filter { align-items: stretch; flex-direction: column; }
  .due-period-filter > *, .due-date-filter input { width: 100%; }
  .due-summary-row { grid-template-columns: 1fr; }
  .due-summary-row > div, .due-summary-row > div:nth-last-child(-n+2) { border-right: 0; border-bottom: 1px solid var(--line); }
  .due-summary-row > div:last-child { border-bottom: 0; }
  .due-actions-cell, .due-actions-menu { width: 100%; min-width: 280px; }
  .due-payment-form { grid-template-columns: 1fr; }
  .due-payment-item > div, .due-payment-item form { align-items: stretch; grid-template-columns: 1fr; flex-direction: column; }
  .calendar-board-toolbar { align-items: stretch; flex-direction: column; }
  .calendar-board-toolbar .view-switch, .calendar-board-toolbar .month-nav { width: 100%; }
  .calendar-board-toolbar .view-switch .button { flex: 1; text-align: center; }
  .billing-line-form { grid-template-columns: 1fr; }
  .manual-line-form { grid-template-columns: 1fr; }
  .sdi-status-panel, .sdi-send-panel { align-items: stretch; flex-direction: column; }
  .sdi-preservation { align-items: flex-start; text-align: left; }
  .balance-columns { grid-template-columns: 1fr; }
  .annual-balance .panel-head { align-items: flex-start; flex-direction: column; }
  .document-print-page { padding: 16px; }
}
@media print {
  @page { size: landscape; margin: 10mm; }
  .sidebar, .mobile-header, .sidebar-edge-trigger, .trame-dialog-backdrop, .no-print, .calendar-fixed-header, .calendar-fixed-scrollbar, .filo-overlay-root { display: none !important; }
  .app-main { margin: 0 !important; }
  body, :root { background: white; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .week-grid { grid-template-columns: repeat(7, 1fr); overflow: visible; }
  .week-column { min-width: 0; }
  .week-column + .week-column { border-left: 1px solid var(--line); }
  .operator-period-brief { break-before: page; page-break-before: always; font-size: 10px; }
  .operator-period-clients { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-month-weekdays, .summary-month-week { min-width: 0; }
  .report-section { break-inside: avoid; margin: 15px 0 25px; }
  .report-table { font-size: 8px; }
  .print-actions { display: none !important; }
  .document-pages { display: block; }
  .document-print-page .document-sheet { page: invoice; width: 210mm; height: 297mm; break-after: page; margin: 0; overflow: hidden; padding: 10mm; box-shadow: none; }
  .document-print-page .document-sheet:last-child { break-after: auto; }
  .document-print-page { padding: 0; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .invoice-head { break-inside: avoid; }
  .invoice-parties { break-inside: avoid; }
}
@page invoice { size: A4 portrait; margin: 0; }

/* ===== Secondo strato del foglio: superfici, navigazione e componenti (ordine di cascata invariato). ===== */

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/manrope-latin-ext.6d36d5bdedfa.woff2") format("woff2");
}

:root {
  --ink: #162c30;
  --muted: #607277;
  --paper: #f4f7f7;
  --white: #ffffff;
  --line: #d9e3e4;
  --forest: #2f7f89;
  --mint: #d8eef0;
  --lime: #eef7f7;
  --rust: #b95137;
  --amber: #f2bd61;
  --planning-accent: #d9f2f4;
  --billing-accent: #f6fbfb;
  --surface-soft: #edf3f3;
  --surface-warm: #f8f5f0;
  --teal-deep: #174d55;
  --teal-dark: #103b42;
  --teal-bright: #3f929c;
  --success: #23714f;
  --warning: #8a5a0a;
  --danger: #a5402d;
  --focus: #d97745;
  --shadow-float: 0 18px 45px rgb(18 57 62 / 16%);
  --shadow-dialog: 0 28px 90px rgb(9 38 42 / 28%);
  --radius-small: 8px;
  --radius-medium: 12px;
  --radius-large: 18px;
  --control-min-height: 44px;
  --control-small-min-height: 36px;
  --control-font-size: 13px;
  --sidebar: 248px;
  --motion-fast: 140ms;
  --motion-standard: 210ms;
  --motion-slow: 280ms;
  --motion-ease: cubic-bezier(.2, .75, .25, 1);
  --motion-spring: cubic-bezier(.2, .9, .3, 1.25);
  font-family: "Manrope", ui-sans-serif, system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

.email-configuration-editor { display: grid; gap: 16px; }
.email-config-section { display: grid; gap: 14px; }
.email-config-section[hidden] { display: none; }
.email-config-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.email-config-grid .field, .email-config-section > .field { display: grid; gap: 6px; }
.email-config-grid label, .email-config-section > .field > label { font-size: 12px; font-weight: 800; }
.email-config-wide { grid-column: 1 / -1; }
.email-editor-toolbar { display: flex; gap: 6px; border: 1px solid var(--line); border-bottom: 0; border-radius: 9px 9px 0 0; padding: 7px; background: var(--surface-soft); }
.email-editor-toolbar button { min-height: 32px; border: 1px solid var(--line); border-radius: 6px; padding: 5px 10px; background: white; color: var(--teal-dark); cursor: pointer; }
.email-message-editor { min-height: 220px; border: 1px solid var(--line); border-radius: 0 0 9px 9px; padding: 18px; background: white; line-height: 1.6; outline: none; }
.email-message-editor:focus { border-color: var(--teal-bright); box-shadow: 0 0 0 3px rgb(63 146 156 / 15%); }
.email-message-editor img { display: block; max-width: min(100%, 480px); height: auto; margin: 10px 0; }
.email-placeholder-help { margin: 0; color: var(--muted); font-size: 11px; }
.email-placeholder-help code { border-radius: 4px; padding: 2px 5px; background: var(--surface-soft); color: var(--teal-deep); }
.email-config-actions { display: flex; gap: 10px; }
@media (max-width: 780px) { .email-config-grid { grid-template-columns: 1fr; } .email-config-wide { grid-column: auto; } }

/* Configuration indexes: clear operational records, not table rows. */
.configuration-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 18px;
  border: 1px solid #cbdcde;
  border-left: 4px solid var(--teal-bright);
  border-radius: var(--radius-medium);
  padding: 17px 20px;
  background: #f9fcfc;
}
.configuration-summary h2 { margin: 0 0 3px; color: var(--teal-dark); font-size: 15px; font-weight: 800; letter-spacing: -.015em; }
.configuration-summary p { max-width: 680px; margin: 0; color: var(--muted); font-size: 12px; }
.configuration-summary-count { flex: none; color: var(--teal-deep); font-size: 24px; line-height: 1; }
.configuration-summary-count span { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; font-weight: 700; text-align: right; }
.configuration-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.configuration-card {
  position: relative;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  min-width: 0;
  overflow: hidden;
  border: 1px solid #d4e0e1;
  border-radius: var(--radius-large);
  background: var(--white);
  box-shadow: 0 7px 20px rgb(18 57 62 / 6%);
  transition: border-color var(--motion-standard) var(--motion-ease), box-shadow var(--motion-standard) var(--motion-ease);
}
.configuration-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: #b8cacc; }
.configuration-card-default { border-color: #8fbdc2; box-shadow: 0 10px 26px rgb(35 113 79 / 10%); }
.configuration-card-default::before { background: var(--success); }
.configuration-card:focus-within { border-color: var(--teal-bright); box-shadow: 0 0 0 3px rgb(63 146 156 / 12%); }
.configuration-card-header { display: flex; align-items: flex-start; gap: 12px; padding: 20px 20px 15px 23px; }
.configuration-card-mark {
  display: grid;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 11px;
  background: var(--mint);
  color: var(--teal-deep);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -.06em;
}
.configuration-card-mark-email { background: #e8f2f3; font-size: 21px; letter-spacing: 0; }
.configuration-card-title { min-width: 0; margin-right: auto; }
.configuration-kind { display: block; margin-bottom: 2px; color: var(--muted); font-size: 10px; font-weight: 700; }
.configuration-card-title h2 { margin: 0; overflow-wrap: anywhere; color: var(--teal-dark); font-size: 18px; font-weight: 800; letter-spacing: -.025em; line-height: 1.25; }
.status-badge.neutral { border-color: #d5e0e1; background: var(--surface-soft); color: var(--muted); }
.configuration-card-details { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(110px, .65fr); gap: 12px; padding: 0 20px 18px 23px; }
.configuration-card-details > div { min-width: 0; border-left: 2px solid #e5eded; padding-left: 10px; }
.configuration-card-details span { display: block; margin-bottom: 2px; color: var(--muted); font-size: 10px; font-weight: 650; }
.configuration-card-details strong { display: block; overflow-wrap: anywhere; color: var(--ink); font-size: 12px; font-weight: 700; line-height: 1.4; }
.configuration-email-details { grid-template-columns: minmax(0, 1fr); }
.configuration-readiness { display: grid; grid-template-columns: 9px 1fr; column-gap: 9px; align-content: center; margin: 0 20px 18px 23px; border-radius: 10px; padding: 10px 12px; }
.configuration-readiness > span { grid-row: 1 / 3; align-self: center; width: 9px; height: 9px; border-radius: 50%; }
.configuration-readiness strong { font-size: 11px; line-height: 1.3; }
.configuration-readiness small { color: var(--muted); font-size: 10px; line-height: 1.35; }
.configuration-readiness.is-ready { background: #edf7f2; }
.configuration-readiness.is-ready > span { background: var(--success); box-shadow: 0 0 0 3px rgb(35 113 79 / 12%); }
.configuration-readiness.is-ready strong { color: var(--success); }
.configuration-readiness.is-incomplete { background: #fff7e8; }
.configuration-readiness.is-incomplete > span { background: var(--warning); box-shadow: 0 0 0 3px rgb(138 90 10 / 11%); }
.configuration-readiness.is-incomplete strong { color: var(--warning); }
.configuration-card-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-height: 64px; margin-top: auto; border-top: 1px solid #e0e9ea; padding: 12px 20px 12px 23px; background: #f7fafa; }
.configuration-card-actions form { display: flex; margin: 0; }
.configuration-card-actions .configuration-delete-action { margin-left: auto; }
.configuration-empty { grid-column: 1 / -1; }

html { scroll-behavior: smooth; }
body { min-width: 320px; color: var(--ink); background-color: var(--paper); font-size: 14px; line-height: 1.55; }
body::before { content: ""; position: fixed; inset: 0 0 auto var(--sidebar); height: 3px; z-index: 19; background: linear-gradient(90deg, var(--teal-deep), var(--teal-bright) 45%, var(--amber)); }
a { color: #256c75; text-underline-offset: 3px; }
a:hover { color: var(--teal-dark); }
button, input, select, textarea { letter-spacing: -.005em; }
::selection { background: #bfe3e6; color: var(--teal-dark); }

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus) 72%, white);
  outline-offset: 3px;
}
[disabled], [aria-disabled="true"] { cursor: not-allowed; }

@keyframes control-pop {
  0% { transform: scale(.9); }
  62% { transform: scale(1.04); }
  100% { transform: scale(1); }
}
@keyframes dialog-enter {
  0% { opacity: 0; transform: translateY(12px) scale(.985); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes backdrop-enter {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes content-reveal {
  0% { opacity: 0; transform: translateY(-5px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* Application frame */
.sidebar {
  width: var(--sidebar);
  padding: 24px 16px 18px;
  overflow: hidden;
  background: var(--teal-deep);
  border-right: 1px solid rgb(255 255 255 / 10%);
}
.sidebar-edge-trigger { display: none; }
.sidebar::after { content: ""; position: absolute; inset: 0 0 0 auto; width: 1px; background: rgb(255 255 255 / 10%); }
.brand { gap: 11px; min-height: 54px; margin: 0 8px 23px; letter-spacing: .04em; }
.brand-logo { width: 92px; }
.brand span strong { font-size: 15px; font-weight: 800; letter-spacing: .09em; }
.brand small { margin-top: 1px; color: #bcd8db; font-size: 9px; letter-spacing: .02em; }
.sidebar nav { gap: 3px; margin-top: 2px; margin-right: -6px; padding-right: 6px; scrollbar-width: thin; scrollbar-color: #4c7a80 transparent; }
.sidebar nav a {
  position: relative;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: var(--radius-small);
  color: #dcebed;
  font-size: 12.5px;
  font-weight: 550;
}
.sidebar nav a:hover { color: white; background: rgb(255 255 255 / 8%); }
.sidebar nav a.active { color: white; background: #28636b; box-shadow: inset 3px 0 var(--amber); }
.sidebar nav a.nav-primary { min-height: 43px; padding-inline: 12px; font-size: 13px; font-weight: 750; }
.sidebar nav.nav-planning a.active { color: #ffd88c; }
.sidebar-user { align-items: flex-end; gap: 12px; margin-inline: 6px; border-color: #3d737a; padding: 15px 5px 0; color: #c9dddf; font-size: 11px; }
.sidebar-user > span { min-height: 28px; display: flex; align-items: center; }
.sidebar-user-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.sidebar-user-actions form { margin: 0; }
.sidebar .link-button { color: white; }
.app-main { margin-left: var(--sidebar); padding: 38px clamp(26px, 3.4vw, 58px) 80px; }
.mobile-header { background: var(--teal-deep); }

@media (min-width: 761px) {
  .sidebar-autohide-ready::before { left: 0; }
  .sidebar-autohide-ready .app-main { margin-left: 0; transition: margin-left 180ms ease-out; }
  .sidebar-autohide-ready .sidebar {
    transform: translateX(calc(-100% - 18px));
    transition: transform 180ms ease-out, box-shadow 180ms ease-out;
    box-shadow: none;
  }
  .sidebar-autohide-ready.sidebar-open .sidebar {
    transform: translateX(0);
    box-shadow: 18px 0 44px rgb(7 35 39 / 22%);
  }
  .sidebar-autohide-ready.sidebar-pinned::before { left: var(--sidebar); }
  .sidebar-autohide-ready.sidebar-pinned .app-main { margin-left: var(--sidebar); }
  .sidebar-autohide-ready.sidebar-pinned .sidebar { transform: translateX(0); box-shadow: none; }
  .sidebar-collapsed::before { left: 0; }
  .sidebar-collapsed .app-main { margin-left: 0; }
  .sidebar-collapsed .sidebar { transform: translateX(calc(-100% - 18px)); box-shadow: none; }
  .nav-scroll-pending .sidebar nav { visibility: hidden; }
  .sidebar-autohide-ready .sidebar-edge-trigger {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 22;
    display: flex;
    width: 10px;
    height: 100vh;
    align-items: center;
    justify-content: center;
    transition: left 180ms ease-out, width 120ms ease-out, background-color 120ms ease-out;
    border: 0;
    border-radius: 0;
    padding: 0;
    color: white;
    background: transparent;
    box-shadow: none;
    cursor: pointer;
  }
  .sidebar-autohide-ready .sidebar-edge-trigger:hover,
  .sidebar-autohide-ready .sidebar-edge-trigger:focus-visible { width: 14px; background: transparent; }
  .sidebar-autohide-ready .sidebar-edge-trigger > span[aria-hidden] {
    display: flex;
    width: 10px;
    height: 68px;
    align-items: center;
    justify-content: center;
    border-radius: 0 8px 8px 0;
    background: var(--teal-deep);
    box-shadow: 3px 0 10px rgb(7 35 39 / 18%);
    font-size: 18px;
    line-height: 1;
    transition: transform 180ms ease-out, background-color 120ms ease-out;
  }
  .sidebar-autohide-ready .sidebar-edge-trigger:hover > span[aria-hidden],
  .sidebar-autohide-ready .sidebar-edge-trigger:focus-visible > span[aria-hidden] { background: #28636b; }
  .sidebar-autohide-ready.sidebar-pinned .sidebar-edge-trigger { left: var(--sidebar); }
  .sidebar-autohide-ready.sidebar-open .sidebar-edge-trigger > span[aria-hidden] { transform: rotate(180deg); }
}

/* Login keeps the original photographic gradient while joining the new type system. */
.login-intro h1 { font-family: "Manrope", sans-serif; font-size: clamp(54px, 7.6vw, 104px); font-weight: 760; line-height: .91; letter-spacing: -.065em; }
.login-intro p { line-height: 1.55; }
.login-card { border: 1px solid rgb(255 255 255 / 42%); border-radius: 20px; background: #f7f9f9; box-shadow: 0 20px 65px rgb(14 60 66 / 15%); }
.login-card h2 { color: var(--teal-dark); font-family: "Manrope", sans-serif; font-size: 31px; font-weight: 750; letter-spacing: -.04em; }
.product-label { color: var(--teal-bright); letter-spacing: .1em; }
.login-request-hint { margin: -12px 0 20px; border-left: 3px solid var(--teal-bright); padding-left: 11px; color: #45666b; font-size: 12px; }
.login-destinations { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; min-width: 0; margin: 0; border: 0; padding: 0; }
.login-destinations legend { grid-column: 1 / -1; margin-bottom: -1px; padding: 0; color: var(--teal-dark); font-size: 12px; font-weight: 720; }
.login-destination-tile { min-width: 0; min-height: 72px; display: flex !important; grid-template-columns: none !important; align-items: center; gap: 10px !important; border: 1px solid #b8ccce; border-radius: 11px; padding: 12px; background: white; color: var(--teal-dark); cursor: pointer; }
.login-destination-tile:hover { border-color: var(--forest); background: #f0f7f7; }
.login-destination-tile:has(input:checked) { border-color: var(--teal-deep); background: #e8f4f5; box-shadow: inset 3px 0 var(--teal-bright); }
.login-destination-tile:has(input:focus-visible) { outline: 3px solid color-mix(in srgb, var(--focus) 72%, white); outline-offset: 3px; }
.login-destination-tile input { width: 18px; height: 18px; flex: 0 0 auto; margin: 0; accent-color: var(--teal-deep); }
.login-destination-tile > span { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.login-destination-tile strong { font-size: 13px; }
.login-destination-tile small { color: var(--muted); font-size: 10px; font-weight: 500; line-height: 1.35; }
.login-submit { width: 100%; }

/* Headings and page rhythm */
.page-head { align-items: center; gap: 28px; margin-bottom: 26px; }
.page-head > div:first-child { min-width: 0; }
.page-head h1 {
  max-width: 900px;
  margin: 3px 0 4px;
  color: var(--teal-dark);
  font-family: "Manrope", sans-serif;
  font-size: clamp(30px, 3.2vw, 46px);
  font-weight: 760;
  line-height: 1.04;
  letter-spacing: -.045em;
}
.page-head p { max-width: 760px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.eyebrow { color: var(--teal-bright); font-size: 11px; font-weight: 750; letter-spacing: .02em; text-transform: none; }
.head-actions { align-items: center; justify-content: flex-end; gap: 9px; }
.section-intro { max-width: 880px; color: var(--muted); line-height: 1.65; }
.client-form .field-excluded_operators > label, .care-request-form .field-required_skills > label, .operator-form .field-skills > label, .summary-month-day > header strong, .section-title h2, .due-actions-menu summary::after { font-family: "Manrope", sans-serif; }
.assignment-excluded-toggle { border-color: #c98679; background: linear-gradient(135deg, #f8e7e3, #f1d2ca); color: #8c3d2b; }
.assignment-excluded-toggle:hover, .assignment-excluded-toggle[aria-pressed="true"] { border-color: var(--rust); background: linear-gradient(135deg, #f5ddd7, #eabeb4); color: #7c2f22; }
.assignment-excluded-heading { display: flex; grid-column: 1 / -1; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 8px; border-top: 1px solid #d7a196; padding: 14px 0 3px; color: #8c3d2b; }
.assignment-excluded-heading span { color: #a04b3b; font-size: 10px; }
.dialog-candidate-list article.assignment-candidate-excluded { border: 1px solid #c98679; border-radius: 9px; padding: 12px; background: #f8e7e3; box-shadow: inset 3px 0 var(--rust); color: #8c3d2b; }
.assignment-candidate-excluded > div > strong, .assignment-candidate-excluded > div > span, .assignment-candidate-excluded > div > small, .assignment-candidate-excluded .mileage-controls label { color: #8c3d2b; }
/* Operatrice esclusa nell'elenco a caselle (inserimento rapido): stesso colore
   usato nell'anagrafica cliente per le escluse selezionate. */
.operator-option.assignment-candidate-excluded {
  border: 1px solid #c98679;
  background: #f8e7e3;
  box-shadow: inset 3px 0 var(--rust);
  color: #8c3d2b;
}
.operator-option.assignment-candidate-excluded:hover { border-color: #b96b58; background: #f6ded8; }
.operator-option.assignment-candidate-excluded small { color: #8c3d2b; }
.operator-option.assignment-candidate-excluded:has(input:checked) {
  border-color: var(--rust);
  background: #f3d9d3;
  box-shadow: inset 3px 0 var(--rust);
  color: #7c2d18;
  font-weight: 700;
}
.operator-option.assignment-candidate-excluded input { accent-color: var(--rust); }
.section-title h2 { color: var(--teal-dark); font-size: 22px; font-weight: 750; letter-spacing: -.03em; }
.summary-month-day > header strong { color: var(--teal-dark); font-size: 16px; font-weight: 720; }

/* Anagrafica cliente: la tipologia guida il modulo senza cambiare il linguaggio visivo del sito. */
.client-form .form-section-client-type { padding-bottom: 8px; }
.client-form .field-billing_type > label { color: var(--teal-dark); font-size: 13px; }
.client-type-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.client-type-options > div { min-width: 0; }
.client-type-options label {
  display: flex;
  min-height: 58px;
  align-items: center;
  gap: 10px;
  border: 1px solid #b8ccce;
  border-radius: 10px;
  padding: 12px 14px;
  background: white;
  color: var(--teal-dark);
  cursor: pointer;
  font-size: 13px;
  font-weight: 720;
  line-height: 1.25;
  transition: border-color .16s ease, background-color .16s ease, box-shadow .16s ease;
}
.client-type-options label:hover { border-color: var(--forest); background: #f0f7f7; }
.client-type-options label:has(input:checked) {
  border-color: var(--teal-deep);
  background: #e8f4f5;
  box-shadow: inset 3px 0 var(--teal-bright);
}
.client-type-options label:has(input:focus-visible) { outline: 3px solid color-mix(in srgb, var(--focus) 72%, white); outline-offset: 2px; }
.client-type-options label:has(input:disabled) { cursor: default; opacity: .82; }
.client-type-options input { width: 18px; height: 18px; flex: 0 0 auto; margin: 0; accent-color: var(--teal-deep); }
.client-form .form-section-billing { border-top-color: #bdd0d2; }
.client-form .form-section-contact { margin-top: 5px; }
.client-form .form-section-assisted { border-top-color: #bdd0d2; }
.client-form .field-assisted_matches_billing_holder {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 10px;
  align-items: start;
  border: 1px solid #b8ccce;
  border-radius: 8px;
  padding: 15px 16px;
  background: #f0f7f7;
}
.client-form .field-assisted_matches_billing_holder .control { grid-column: 1; grid-row: 1; width: 18px; height: 18px; margin-top: 1px; accent-color: var(--teal-deep); }
.client-form .field-assisted_matches_billing_holder > label { grid-column: 2; grid-row: 1; color: var(--teal-dark); cursor: pointer; font-size: 14px; }
.client-form .field-assisted_matches_billing_holder > small,
.client-form .field-assisted_matches_billing_holder > .errorlist { grid-column: 2; }
.client-form .form-section[hidden], .client-form .field[hidden] { display: none !important; }

@media (max-width: 760px) {
  .client-type-options { grid-template-columns: 1fr; }
  .client-type-options label { min-height: 52px; }
}

/* Buttons and actions */
.button {
  min-height: var(--control-min-height);
  border-color: #8eb4b9;
  border-radius: 10px;
  padding: 10px 16px;
  color: #256c75;
  font-size: var(--control-font-size);
  font-weight: 720;
  line-height: 1.2;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease, transform .16s ease, box-shadow .16s ease;
}
.button:hover { border-color: var(--forest); background: #eaf3f4; color: var(--teal-dark); }
.button:active { transform: translateY(1px); }
.button.primary { border-color: var(--teal-deep); background: var(--teal-deep); color: white; box-shadow: 0 6px 15px rgb(23 77 85 / 14%); }
.button.primary:hover { border-color: var(--teal-dark); background: var(--teal-dark); color: white; box-shadow: 0 8px 20px rgb(23 77 85 / 20%); }
.button.ghost { border-color: #9bbbc0; background: white; color: #256c75; }
.button.ghost:hover { border-color: var(--forest); background: var(--lime); color: var(--teal-dark); }
.button.small { min-height: var(--control-small-min-height); padding: 7px 12px; font-size: 11px; border-radius: 8px; }
.button.danger { border-color: #d99b8c; background: #fffaf8; color: var(--danger); }
.button.danger:hover { border-color: var(--danger); background: #fff0eb; color: #82301f; }
.button.document-delete-button { border-color: #8f2c21; background: linear-gradient(135deg, #c9513c, #982e23); color: white; box-shadow: 0 5px 14px rgb(143 44 33 / 18%); }
.button.document-delete-button:hover { border-color: #762219; background: linear-gradient(135deg, #b84331, #81251c); color: white; box-shadow: 0 7px 18px rgb(118 34 25 / 24%); }
.link-button { min-height: 28px; color: #256c75; font-size: inherit; font-weight: 650; }
.link-button:hover { color: var(--teal-dark); text-decoration: underline; text-underline-offset: 3px; }
.sidebar-user .link-button:hover, .sidebar-user .link-button:focus-visible { color: #ffd88c; }
.link-button.danger, .danger { color: var(--danger); }
.button.is-disabled { opacity: .55; border-style: dashed; background: #f3f5f5; box-shadow: none; }

/* Surfaces, metrics and timeline */
.panel {
  border-color: var(--line);
  border-radius: var(--radius-large);
  padding: clamp(21px, 2.4vw, 30px);
  background: var(--white);
  box-shadow: 0 1px 0 rgb(16 59 66 / 3%);
}
.panel.flush { border-radius: var(--radius-large); }
.panel-head { margin-bottom: 20px; }
.panel-head h2 { margin: 0; color: var(--teal-dark); font-family: "Manrope", sans-serif; font-size: 20px; font-weight: 750; letter-spacing: -.025em; }
.panel-head > span, .panel-head a:not(.button) { font-size: 11px; font-weight: 600; }
.timeline { display: grid; }
.timeline-row { grid-template-columns: 80px minmax(0, 1fr) auto; min-height: 72px; gap: 18px; border-color: #e3e9e9; padding: 15px 4px; }
.timeline-row:first-child { border-top: 0; }
.timeline-row:hover { background: #f7faf9; }
.timeline-row time { color: var(--teal-deep); font-size: 15px; font-weight: 750; }
.timeline-row div span { font-size: 12px; }
.status { border: 1px solid transparent; border-radius: 999px; padding: 5px 10px; font-size: 10px; font-weight: 750; }
.status.covered { border-color: #aad6c1; background: #e1f3e9; color: #1b6847; }
.status.partial { border-color: #e3c273; background: #fff4d8; color: #76500c; }
.status.uncovered { border-color: #dfa696; background: #fce8e2; color: #8d3524; }

/* Feedback */
.message { border: 1px solid #276972; border-radius: 12px; background: var(--teal-deep); color: white; padding: 12px 18px; font-size: 13px; }
.message.error { border-color: #7e2e20; background: #963b29; }
.message.warning { border-color: #d9a94f; background: #fff4d7; color: #68470c; }
.trame-dialog-backdrop { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; border: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; padding: 16px; animation: dialog-backdrop-in .12s ease both; }
.trame-dialog-backdrop::backdrop { background: transparent; }
.trame-dialog { background: white; border-radius: var(--radius-medium); box-shadow: 0 20px 60px rgb(0 0 0 / 28%), 0 4px 14px rgb(0 0 0 / 12%); padding: 28px 28px 20px; max-width: 400px; width: 100%; animation: dialog-panel-in .15s var(--motion-ease) both; }
.trame-dialog-message { margin: 0 0 22px; font-size: 15px; line-height: 1.55; color: var(--ink); white-space: pre-wrap; }
.trame-dialog-input { display: block; width: 100%; box-sizing: border-box; margin: 10px 0 22px; }
.trame-dialog-actions { display: flex; gap: 10px; justify-content: flex-end; }
@keyframes dialog-backdrop-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes dialog-panel-in { from { opacity: 0; transform: scale(.96) translateY(-5px); } to { opacity: 1; transform: none; } }
.empty { border: 1px dashed #b9cbcd; border-radius: var(--radius-medium); background: #f9fbfb; padding: 34px; color: var(--muted); }

/* Standalone Filo shell: one conversation model at every viewport width. */
.filo-body { min-width: 320px; overflow: hidden; background: #edf3f3; }
.filo-body::before { inset: 0 0 auto; background: var(--amber); }
.filo-shell { min-height: 100vh; height: 100vh; min-height: 100dvh; height: 100dvh; display: flex; flex-direction: column; }
.filo-app-header { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid #2e656d; padding: 11px clamp(18px, 3vw, 44px); background: var(--teal-deep); color: white; }
.filo-brand { display: flex; align-items: center; gap: 12px; color: white; }
.filo-brand:hover { color: white; }
.filo-brand > span:last-child { display: flex; flex-direction: column; }
.filo-brand strong { font-size: 21px; font-weight: 800; letter-spacing: -.035em; line-height: 1.1; }
.filo-brand small { color: #bdd9dc; font-size: 10px; }
.filo-mark { width: 26px; height: 26px; border: 2px solid #d8eef0; border-radius: 50%; box-shadow: inset 8px 0 #f2bd61; }
.filo-header-actions { display: flex; align-items: center; gap: 14px; }
.filo-header-actions form { display: flex; margin: 0; }
.filo-header-actions .button { min-height: 38px; border-color: #9dc6ca; background: transparent; color: white; }
.filo-header-actions .button:hover { border-color: white; background: rgb(255 255 255 / 9%); color: white; }
.filo-header-actions .link-button { min-height: 38px; color: #d5e7e9; }
.filo-status { display: inline-flex; align-items: center; gap: 8px; color: #f5ddb0; font-size: 11px; font-weight: 700; white-space: nowrap; }
.filo-status > span { width: 8px; height: 8px; border: 1px solid #ffe6b6; border-radius: 50%; background: #c98632; }
.filo-status.is-active { color: #c9eee1; }
.filo-status.is-active > span { border-color: #d8fff0; background: #42b88b; }
.filo-workspace { min-height: 0; flex: 1; display: flex; justify-content: center; }
.filo-main { width: 100%; max-width: 920px; min-width: 0; min-height: 0; display: flex; flex-direction: column; padding: 0 clamp(18px, 4vw, 48px); }
.filo-thread-heading { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid #cbdadb; padding: 14px 0 12px; }
.filo-thread-heading h1 { max-width: 620px; overflow: hidden; margin: 2px 0 0; color: var(--teal-dark); font-size: clamp(18px, 2.5vw, 25px); line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.filo-thread-heading .filo-context { margin: 0; }
.filo-thread-heading form { margin: 0; }
.filo-conversation { min-height: 0; flex: 1; overflow-y: auto; display: flex; flex-direction: column; justify-content: flex-start; gap: clamp(24px, 4vh, 42px); padding: clamp(26px, 5vh, 54px) 0 28px; scrollbar-width: thin; scrollbar-color: #9ebabc transparent; }
.filo-conversation > .filo-welcome:first-child { margin-top: auto; }
.filo-conversation > .filo-example:last-child { margin-bottom: auto; }
.filo-welcome { max-width: 680px; }
.filo-context { margin: 0 0 9px; color: var(--teal-bright); font-size: 12px; font-weight: 750; }
.filo-welcome h1 { margin: 0 0 13px; color: var(--teal-dark); font-size: clamp(36px, 6vw, 62px); font-weight: 760; line-height: 1; letter-spacing: -.055em; }
.filo-welcome > p:last-child { max-width: 64ch; margin: 0; color: var(--muted); font-size: 14px; }
.filo-example { max-width: 730px; border-left: 3px solid var(--teal-bright); padding: 2px 0 2px clamp(17px, 3vw, 28px); }
.filo-example-author { display: flex; align-items: center; gap: 8px; color: #387780; font-size: 11px; font-weight: 730; }
.filo-example-author span { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; background: var(--teal-deep); color: white; }
.filo-example blockquote { margin: 13px 0 10px; color: var(--teal-dark); font-size: clamp(17px, 2.3vw, 22px); font-weight: 680; line-height: 1.4; letter-spacing: -.02em; }
.filo-example > p { max-width: 68ch; margin: 0; color: var(--muted); font-size: 12px; }
.filo-message { max-width: 730px; }
.filo-message-user { align-self: flex-end; width: min(620px, 92%); border-radius: 16px 16px 4px; padding: 14px 17px; background: var(--teal-deep); color: white; }
.filo-message-user p { margin: 0 0 5px; color: #b9dadd; font-size: 10px; font-weight: 750; text-transform: uppercase; }
.filo-message-user blockquote { margin: 0; font-size: 15px; line-height: 1.45; }
.filo-message-result, .filo-message-error { border-left: 3px solid var(--teal-bright); padding: 2px 0 2px clamp(17px, 3vw, 28px); }
.filo-message-error p, .filo-message-error span { margin: 0; }
.filo-message-error p { color: var(--muted); }
.filo-message-result article { margin-top: 15px; border: 1px solid #c6d7d8; border-radius: 11px; padding: 13px 15px; background: #f8fafa; }
.filo-message-result article > strong { color: var(--teal-dark); font-size: 15px; }
.filo-message-result dl { display: grid; gap: 9px; margin: 11px 0 0; }
.filo-message-result dl div { display: grid; grid-template-columns: 145px minmax(0, 1fr); gap: 12px; }
.filo-message-result dt { color: var(--muted); font-size: 10px; font-weight: 750; text-transform: uppercase; }
.filo-message-result dd { display: flex; flex-wrap: wrap; gap: 5px; margin: 0; color: var(--teal-dark); font-size: 12px; }
.filo-message-result dd span { border-radius: 999px; padding: 3px 8px; background: #e2eeee; }
.filo-message-result small { display: block; margin-top: 11px; color: var(--muted); font-size: 10px; }
.filo-message-error { display: flex; flex-direction: column; gap: 5px; border-color: #b94d48; color: #7c2724; }
.filo-message-error p { margin: 0; font-size: 10px; font-weight: 750; text-transform: uppercase; }
.filo-message-error span { color: var(--muted); font-size: 11px; }
.filo-message-applied { display: grid; gap: 6px; border-left: 3px solid #3a9975; padding: 4px 0 4px clamp(17px, 3vw, 28px); color: #175d45; }
.filo-message-applied p { margin: 0; color: var(--muted); font-size: 10px; font-weight: 750; text-transform: uppercase; }
.filo-operation { max-width: 730px; border: 1px solid #a9c7c9; border-radius: 14px; padding: 17px; background: #f8fafa; box-shadow: 0 10px 28px rgb(24 75 82 / 8%); }
.filo-operation-warning { border-color: #ddb967; background: #fff8e7; }
.filo-answer { border-color: #94bfaa; background: #f4faf7; }
.filo-answer-count { min-width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--teal-deep); color: white; font-size: 13px; font-weight: 750; }
.filo-readonly-note { margin: 13px 0 0; color: #39705c; font-size: 10px; font-weight: 700; }
.filo-operation-warning p { margin: 7px 0 0; color: #6f5521; }
.filo-operation-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.filo-operation-heading > div { display: flex; flex-direction: column; gap: 3px; }
.filo-operation-heading > div > span { color: var(--teal-bright); font-size: 10px; font-weight: 760; text-transform: uppercase; }
.filo-operation-heading > div > strong { color: var(--teal-dark); font-size: 18px; }
.filo-operation-period { margin: 12px 0 6px; color: var(--teal-dark); font-weight: 700; }
.filo-operation > p { font-size: 11px; }
.filo-operation-changes { display: grid; gap: 7px; margin-top: 14px; }
.filo-operation-changes article { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(170px, 1.2fr) minmax(180px, 1.4fr); gap: 8px; border-top: 1px solid #d5e1e2; padding-top: 9px; font-size: 11px; }
.filo-operation-changes small { grid-column: 3; color: var(--muted); }
.filo-uncovered { color: #9a3e32; font-weight: 700; }
.filo-confirm-form { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 17px; border-top: 1px solid #c7d8d9; padding-top: 14px; }
.filo-confirm-form p { max-width: 50ch; margin: 0; color: var(--muted); font-size: 10px; }
.filo-operation-state { margin: 15px 0 0; border-top: 1px solid #c7d8d9; padding-top: 12px; color: var(--teal-dark); font-weight: 700; }
.filo-composer { flex: 0 0 auto; border-top: 1px solid #cbdadb; padding: 16px 0 14px; background: #edf3f3; }
.filo-composer > label { display: block; margin-bottom: 7px; color: var(--teal-dark); font-size: 12px; font-weight: 740; }
.filo-input-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; align-items: stretch; }
.filo-composer textarea { width: 100%; min-height: 62px; max-height: 140px; resize: vertical; border: 1px solid #b8ccce; border-radius: 11px; padding: 11px 13px; background: #f8fafa; color: var(--muted); font-size: 16px; line-height: 1.4; }
.filo-composer textarea::placeholder { color: #708387; opacity: 1; }
.filo-composer .button { min-width: 82px; }
.filo-composer .button:disabled { border-color: #b4c4c6; background: #d8e2e2; color: #627477; box-shadow: none; }
.filo-composer > p { margin: 7px 0 0; color: var(--muted); font-size: 10px; }
.filo-composer .filo-field-error { color: #a63833; font-size: 11px; font-weight: 700; }
.filo-footer { min-height: 34px; display: flex; align-items: center; justify-content: center; gap: 28px; border-top: 1px solid #d5e1e2; padding: 7px max(18px, env(safe-area-inset-right)) max(7px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left)); background: #f7f9f9; color: #607579; font-size: 10px; }
.filo-footer span + span::before { content: ""; display: inline-block; width: 4px; height: 4px; margin: 0 14px 2px 0; border-radius: 50%; background: var(--teal-bright); }

.toolbar, .month-nav, .calendar-board-toolbar, .calendar-summary-toolbar, .report-toolbar, .client-list-toolbar, .document-list-toolbar, .due-period-filter {
  gap: 10px 14px;
}
.toolbar, .month-nav, .calendar-board-toolbar, .calendar-summary-toolbar, .report-toolbar, .client-list-toolbar { margin-top: -8px; }
.view-switch { gap: 4px; border: 1px solid #b7cbcd; border-radius: 11px; padding: 3px; background: #eaf1f1; }
.view-switch .button { min-height: 36px; border: 0; border-radius: 8px; background: transparent; box-shadow: none; }
.view-switch .button.primary { background: var(--brand-grad); color: #fff; box-shadow: 0 2px 8px rgb(25 66 71 / 10%); }
.client-directory-filter { flex: 1 1 540px; min-width: 0; flex-wrap: wrap; }
.client-combobox { border-radius: 10px; }
.client-combobox::after { top: 20px; border-color: #56777b; }
.client-combobox-options { top: calc(100% + 7px); border-color: #afc4c7; border-radius: 12px; padding: 6px; box-shadow: var(--shadow-float); }
.client-combobox-option { border-radius: 8px; font-size: 13px; }
.client-combobox-option:hover, .client-combobox-option.is-active, .client-combobox-option[aria-selected="true"] { background: var(--mint); color: var(--teal-dark); }
.control, .compact-form input, .compact-form select, .compact-form textarea,
.month-nav input, .month-nav select, .filter-bar input, .filter-bar select,
.availability-toolbar input, .availability-toolbar select, .billing-filter select,
.bulk-document-actions input, .quick-fields input, .quick-fields select,
.due-payment-form input, .due-payment-form select, .due-payment-item input {
  border-color: #bdcdcf;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.control:hover, .compact-form input:hover, .compact-form select:hover, .compact-form textarea:hover { border-color: #86a9ae; }
.control:focus, .compact-form input:focus, .compact-form select:focus, .compact-form textarea:focus { border-color: var(--forest); box-shadow: 0 0 0 4px rgb(63 146 156 / 12%); outline: 0; }
textarea { line-height: 1.55; }

/* Directories */
.card-grid { gap: 13px; }
.person-card {
  border-color: var(--line);
  border-radius: 14px;
  padding: 19px;
  background: white;
}
.person-card:hover { border-color: #a8c2c5; background: #fbfdfd; }
.person-card.inactive { opacity: 1; border-style: dashed; background: #f5f7f7; }
.person-card.inactive .avatar { filter: grayscale(.7); }
.avatar { width: 44px; height: 44px; background: #d7ecee; color: #286f78; font-size: 12px; font-weight: 800; }
.person-card.client .avatar { background: #f3e3c8; color: #775621; }
.person-main h2 { color: var(--teal-dark); font-family: "Manrope", sans-serif; font-size: 17px; font-weight: 750; letter-spacing: -.025em; }
.person-main > span, .detail-line { font-size: 11px; }
.account-disabled { color: var(--danger) !important; }
.card-actions { gap: 8px; font-size: 11px; }
.tags { gap: 5px; }
.tags small { border: 1px solid #d1dedd; border-radius: 999px; background: #edf3f2; padding: 4px 8px; color: #476267; font-size: 9px; font-weight: 650; }
.client-directory-results.list-view .person-card, .operator-directory-results.list-view .person-card { border-radius: 11px; }

/* Forms and selectable cards */
.form-panel { max-width: 1080px; }
.model-form { gap: 21px 24px; }
.form-section { border-top-color: #dce5e6; padding-top: 24px; }
.form-section legend { color: var(--teal-dark); font-family: "Manrope", sans-serif; font-size: 18px; font-weight: 750; letter-spacing: -.025em; }
.form-section-description { color: var(--muted); font-size: 12px; }
.form-section-fields { gap: 18px 22px; }
.field, .compact-form label { gap: 7px; }
.field label, .compact-form label { color: #2a4145; font-size: 11px; font-weight: 720; }
.field small { font-size: 11px; line-height: 1.5; }
.field-check { border-color: var(--line); border-radius: 11px; background: #f5f8f8; }
.field-check:has(input:checked) { border-color: #91bcc1; background: #e8f4f5; }
.check-list { gap: 7px; }
.check-list label, .weekday-picker label, .plan-date-picker label {
  border-color: #cddadc;
  border-radius: 9px;
  background: #f8fafa;
  transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.check-list label:hover, .weekday-picker label:hover, .plan-date-picker label:hover { border-color: #95b5b9; background: #f1f7f7; }
.check-list label:has(input:checked), .weekday-picker label:has(input:checked), .plan-date-picker label:has(input:checked) { border-color: #6ba5ac; background: var(--mint); color: var(--teal-dark); box-shadow: inset 3px 0 var(--forest); }
.form-actions { border-top: 1px solid #e0e7e8; padding-top: 20px; }
.form-warning, .warning-panel, .request-merge-warning { border: 1px solid #e5c47a; border-left: 4px solid var(--amber); border-radius: var(--radius-medium); background: #fff9e9; color: #68470c; }
.errorlist { border-radius: 8px; background: #fff0eb; color: var(--danger); font-size: 11px; }
.context-strip { border: 1px solid #b9d5d8; border-radius: 11px; background: #edf8f8; }
.request-create-grid, .availability-form-grid { gap: 16px; }
.availability-standard-panel, .availability-featured { border-top: 4px solid #b9dadd; }
.request-plan-subtract-form .field-dates { border-color: #d6e0e1; border-radius: 13px; background: var(--surface-warm); }
.request-plan-subtract-form .field-dates > label { color: var(--teal-dark); font-family: "Manrope", sans-serif; font-size: 16px; font-weight: 750; }
.request-plan-subtract-form .field-whole_day { border-color: #bed6d8; border-radius: 11px; background: #eff7f7; }
.late-cancellation-confirmation { border: 1px solid #e4bd71; border-radius: 12px; padding: 16px; background: #fff8e7; }

/* Tables */
.table-wrap { border: 1px solid var(--line); border-radius: 14px; background: white; scrollbar-color: #9eb8bb #edf2f2; }
table { font-size: 12px; }
th { border-bottom: 1px solid #cddadc; background: #eaf0f0; color: #496367; font-size: 9px; font-weight: 800; letter-spacing: .07em; text-transform: none; }
th, td { padding: 12px 13px; }
td { border-bottom-color: #e4ebeb; }
tbody tr:hover > td { background: #f7fafa; }
tbody tr:last-child > td { border-bottom: 0; }
.sort-link::after { color: #78969a; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.document-selection-head { min-width: 226px; }
.document-selection-caption { display: block; margin-bottom: 7px; color: #647d81; font-size: 8px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.document-selection-grid { display: grid; grid-template-columns: 76px 64px 72px; gap: 5px; align-items: center; }
.document-selection-slot { display: flex; min-height: 29px; align-items: center; }
.document-selection-option { position: relative; display: inline-flex; min-height: 29px; width: 100%; align-items: center; gap: 6px; padding: 5px 7px; border: 1px solid #cbd8da; border-radius: 8px; background: #f8fafa; color: #4b666a; font-size: 9px; font-weight: 800; line-height: 1; cursor: pointer; transition: border-color .15s ease, background-color .15s ease, color .15s ease, box-shadow .15s ease; }
.document-selection-head .document-selection-option { background: #fdfefe; }
.document-selection-option:hover { border-color: #8eaaae; background: #eef5f5; }
.document-selection-option:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.document-selection-option input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; }
.document-selection-mark { display: inline-grid; width: 14px; height: 14px; flex: 0 0 14px; place-items: center; border: 1.5px solid #8ca4a8; border-radius: 4px; background: white; color: white; font-size: 10px; line-height: 1; }
.document-selection-option input:checked + .document-selection-mark::after { content: "✓"; }
.document-selection-option input:indeterminate + .document-selection-mark::after { content: "−"; }
.document-selection-option.is-draft:has(input:checked), .document-selection-option.is-draft:has(input:indeterminate) { border-color: #9a8ca8; background: #f1edf4; color: #55465f; box-shadow: inset 3px 0 #796487; }
.document-selection-option.is-draft input:checked + .document-selection-mark, .document-selection-option.is-draft input:indeterminate + .document-selection-mark { border-color: #796487; background: #796487; }
.document-selection-option.is-sdi:has(input:checked), .document-selection-option.is-sdi:has(input:indeterminate) { border-color: #83a9c2; background: #e7f0f6; color: #24526f; box-shadow: inset 3px 0 #39769b; }
.document-selection-option.is-sdi input:checked + .document-selection-mark, .document-selection-option.is-sdi input:indeterminate + .document-selection-mark { border-color: #39769b; background: #39769b; }
.document-selection-option.is-email:has(input:checked), .document-selection-option.is-email:has(input:indeterminate) { border-color: #79aa97; background: #e6f2eb; color: #245a45; box-shadow: inset 3px 0 #438064; }
.document-selection-option.is-email input:checked + .document-selection-mark, .document-selection-option.is-email input:indeterminate + .document-selection-mark { border-color: #438064; background: #438064; }
.document-selection-option:has(input:disabled) { opacity: .45; cursor: not-allowed; }
.inline-actions { gap: 9px !important; }
.pagination { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px 14px; margin: 14px 0 24px; }
.pagination > span { display: inline-flex; align-items: center; min-height: 36px; padding: 0 5px; color: var(--muted); font-size: 11px; font-weight: 700; white-space: nowrap; }
.pagination .button { justify-content: center; min-width: 108px; }

/* Calendar boards */
.calendar-shell { border-color: #c9d7d9; border-radius: 14px; background: white; scrollbar-color: #88a9ad #e8eeee; }
.month-corner, .month-day, .month-person, .month-cell { border-color: #dce5e6; }
.month-corner, .month-person { background: #f7f9f9; }
.month-corner { color: #5f777b; font-size: 9px; letter-spacing: .06em; }
.month-person { color: var(--teal-dark); font-size: 11px; }
.month-day { background: #eaf1f1; color: #4c666a; font-size: 9px; }
.month-day strong { color: var(--teal-dark); font-family: "Manrope", sans-serif; font-size: 19px; font-weight: 720; }
.month-cell.weekend, .month-day.weekend { background: #f6f2ea; }
.cell-add, .client-cell-add { width: 26px; height: 26px; color: #527d82; opacity: .68; }
/* Fuori dal flusso: il "+" non deve rubare larghezza all'evento e tagliare l'orario.
   z-index basso: scorrendo a destra resta sotto la colonna fissa dei nomi.
   Solo figli diretti della cella, cosi il "+" dentro il dialogo di dettaglio resta invariato. */
.month-cell > .cell-add, .month-cell > .client-cell-add {
  position: absolute;
  top: 3px;
  right: 3px;
  float: none;
  margin: 0;
  z-index: 1;
  background: rgb(255 255 255 / 82%);
  backdrop-filter: blur(2px);
}
.month-cell:hover .cell-add, .cell-add:focus, .month-cell:hover .client-cell-add, .client-cell-add:focus { border-color: #79a4a9; background: #eef8f8; }
.month-cell a, .month-event { border-radius: 7px; background: #dff0f1; color: var(--teal-dark); font-size: 9px; }
.operator-event, .client-event { border: 1px solid var(--client-color-border, #b8d6d9); border-left: 3px solid var(--client-color-border, var(--forest)); border-radius: 7px; background: var(--client-color, #dff0f1); color: var(--client-color-text, var(--ink)); }
.operator-event.opportunity, .client-event.coverage-uncovered { border: 2px dashed #b42318; background-color: var(--client-color, #fae6df); background-image: repeating-linear-gradient(135deg, transparent 0 8px, rgb(180 35 24 / 10%) 8px 12px); }
.client-event.coverage-partial { border: 2px dashed #b7791f; background-color: var(--client-color, #fff2d2); background-image: repeating-linear-gradient(135deg, transparent 0 8px, rgb(183 121 31 / 10%) 8px 12px); }
.client-event.current-request { outline-color: var(--focus); box-shadow: 0 0 0 4px rgb(217 119 69 / 14%); }
.operator-event-action button, button.operator-event-action, .client-event-assign, .client-event-remove { min-height: 27px; color: #315e64; font-size: 8px; letter-spacing: .02em; text-transform: none; }
.client-event-reorganize { background: var(--teal-deep); font-size: 8px; letter-spacing: .02em; text-transform: none; }
.client-event-unavailable { color: var(--danger); letter-spacing: .02em; text-transform: none; }
.calendar-fixed-header { border-color: #bdced0; border-radius: 0 0 12px 12px; box-shadow: 0 9px 24px rgb(22 61 66 / 14%); }
.calendar-fixed-scrollbar { border-color: #bdced0; background: #dfe8e9; }

/* Summary calendars */
.week-grid { gap: 8px; }
.week-column { border-color: var(--line); border-radius: 12px; background: white; }
.week-column > header { border-bottom: 1px solid #d6e2e3; background: #eaf1f1; color: #4d696d; }
.week-column > header strong { color: var(--teal-dark); font-family: "Manrope", sans-serif; font-size: 21px; font-weight: 720; }
.week-event { border-color: var(--client-color-border, #b8d6d9); border-left-color: var(--client-color-border, var(--forest)); border-radius: 7px; background: var(--client-color, #e4f2f3); color: var(--client-color-text, var(--ink)); }
.summary-month-calendar { border-color: var(--line); overflow: hidden; background: white; }
.summary-month-weekdays { background: #eaf1f1; color: #527075; font-size: 9px; letter-spacing: .05em; }
.summary-month-day { border-color: #dfe7e8; }
.summary-month-day > strong { color: var(--teal-dark); font-family: "Manrope", sans-serif; font-size: 16px; font-weight: 720; }
.summary-event { border-color: var(--client-color-border, #b8d6d9); border-left-color: var(--client-color-border, var(--forest)); border-radius: 7px; background: var(--client-color, #e0eff0); color: var(--client-color-text, var(--ink)); }
.client-event :is(a, b, span, small), .operator-event :is(a, b, span), .week-event :is(time, strong, span), .summary-event :is(time, strong, span) { color: inherit; }
.client-event.has-provisional.coverage-covered, .operator-event.has-provisional, .week-event.has-provisional, .summary-event.has-provisional { border: 2px dashed #6f42a6; background-color: var(--client-color, #eadff5); background-image: repeating-linear-gradient(135deg, transparent 0 8px, rgb(111 66 166 / 11%) 8px 12px); }
.access-status-badge { display: inline-flex; width: fit-content; margin: 2px auto; border-radius: 999px; padding: 2px 5px; color: white !important; font-size: 7px; font-weight: 900; line-height: 1.1; letter-spacing: .04em; text-transform: uppercase; }
.access-status-badge.uncovered { background: #b42318; }
.access-status-badge.partial { background: #a9650b; }
.access-status-badge.provisional { background: #6f42a6; }
.access-status-badge.missed { background: #315b73; }
.access-status-badge.excluded { margin-inline: 4px 0; background: #8c3d2b; }
.month-cell .client-event.coverage-uncovered.has-missed,
.client-event.coverage-uncovered.has-missed,
.operator-event.opportunity.has-missed {
  border: 2px solid #315b73;
  background-color: #e5f0f4;
  background-image: repeating-linear-gradient(135deg, transparent 0 8px, rgb(49 91 115 / 10%) 8px 12px);
}
.assignment-mode-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.button.provisional, .link-button.provisional { border-color: #6f42a6; background: #6f42a6; color: white; }
.assignment-provisional {
  border: 1px solid #dcccf0;
  border-left: 4px solid var(--provisional, #6f42a6);
  border-radius: 14px;
  margin: 10px 0;
  padding: 12px 14px;
  background: linear-gradient(180deg, #ffffff, #f7f1fc);
  box-shadow: 0 8px 24px rgb(76 42 115 / 10%);
  transition: box-shadow .16s var(--motion-ease);
}
.assignment-provisional:hover { box-shadow: 0 10px 28px rgb(76 42 115 / 16%); }
.access-mileage-row { align-items: center; flex-wrap: wrap; gap: 10px 16px; }
.access-mileage-row > div:first-child { flex: 1 1 240px; min-width: 0; }
.access-mileage-row > .access-mileage-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-left: auto; flex: 0 0 auto; }
.assignment-provisional strong { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.assignment-provisional .access-status-badge.provisional { margin: 0; padding: 3px 9px; font-size: 8px; }
.field-calendar_color { grid-column: 1 / -1; }
.field-calendar_color > label { margin-bottom: 8px; }
.client-color-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: 8px; }
.client-color-options > div { display: contents; }
.client-color-options label { min-width: 0; min-height: 42px; display: flex; align-items: center; gap: 9px; border: 1px solid #cadadb; border-radius: 10px; padding: 8px 10px; background: #f8fbfb; color: var(--ink); cursor: pointer; overflow-wrap: normal; word-break: normal; hyphens: none; font-size: 11px; font-weight: 700; line-height: 1.35; }
.client-color-options label::before { width: 22px; height: 22px; flex: 0 0 22px; border: 1px solid color-mix(in srgb, var(--swatch-color, #dcefea) 68%, #173f43); border-radius: 7px; background: var(--swatch-color, linear-gradient(135deg, #dcefea, #eae1f0)); content: ""; }
.client-color-options label:has(input:checked) { border-color: var(--teal-deep); box-shadow: 0 0 0 2px rgb(23 77 85 / 14%); }
.client-color-options input { margin: 0; accent-color: var(--teal-deep); }
.field-custom_calendar_color input[type="color"] { width: 100%; min-height: 48px; padding: 5px; }

/* Availability */
.availability-toolbar { border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.availability-month-calendar { border-color: #c9d8da; border-radius: 13px; }
.availability-day { border-color: #dce5e6; background: white; }
.availability-day-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.availability-day-head > strong { color: var(--teal-deep); font-size: 13px; }
.availability-day-head > strong small { font-size: 11px; font-weight: 400; }
.availability-day-head .availability-cell-add { flex: 0 0 30px; width: 30px; min-height: 30px; height: 30px; padding: 0; border-style: solid; border-radius: 50%; background: var(--mint); color: var(--teal-deep); font-size: 14px; font-weight: 400; line-height: 1; }
.availability-day-head .availability-cell-add:hover { background: var(--teal-deep); color: var(--white); }
.availability-day.outside { background: #f1f4f4; }
.availability-event { border-left: 3px solid var(--forest); border-radius: 7px; background: #dceff0; color: var(--teal-dark); }
.availability-cell-add { border-color: #9cbcc0; border-radius: 7px; }
.availability-calendar-panel .button.small { min-height: var(--control-min-height); border-radius: 10px; padding: 10px 16px; font-size: var(--control-font-size); }

.quick-dialog {
  border: 1px solid #d6e1e2;
  border-radius: 20px;
  background: white;
  box-shadow: var(--shadow-dialog);
}
.quick-dialog::backdrop { background: rgb(10 43 48 / 66%); backdrop-filter: blur(5px); }
.quick-dialog > form { padding: clamp(20px, 3vw, 30px); }
.dialog-head { border-bottom: 1px solid #e0e8e8; padding-bottom: 17px; }
.dialog-head h2 { color: var(--teal-dark); font-family: "Manrope", sans-serif; font-size: 25px; font-weight: 760; letter-spacing: -.035em; }
.dialog-head p { font-size: 12px; text-transform: none; }
.dialog-close { width: 38px; height: 38px; border-radius: 50%; color: #5a7377; }
.dialog-close:hover { background: #edf3f3; color: var(--teal-dark); }
.operator-picker { border-color: #cbd9da; border-radius: 13px; background: #f2f6f6; }
.operator-picker-head h3 { color: var(--teal-dark); font-family: "Manrope", sans-serif; font-size: 17px; font-weight: 740; }

/* Settings and reorganization */
.settings-panel { border-top: 4px solid #badadd; }
.skill-row, .holiday-list article, .reorganization-list article { border-color: #dce5e6; border-radius: 11px; background: #fbfdfd; }
.skill-row:hover, .holiday-list article:hover, .reorganization-list article:hover { border-color: #abc5c8; }
.reorganization-summary { border-left-color: var(--forest); }

.availability-fragments { border-left: 5px solid #c17b27; }
.availability-fragments > p { max-width: 78ch; color: var(--muted); }
.availability-fragment { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 24px; border-top: 1px solid #dce5e6; padding: 18px 0 4px; }
.availability-fragment h3, .availability-fragment > p:first-of-type { grid-column: 1 / -1; }
.availability-fragment h3 { margin: 0; color: var(--teal-dark); }
.availability-fragment p { margin: 0; font-weight: 700; }
.availability-fragment ul { margin: 0; padding: 10px 12px 10px 30px; border-radius: 9px; background: #f3f7f7; }
.operation-preview { border-top: 4px solid var(--forest); }
.operation-preview > p:first-of-type { max-width: 72ch; color: var(--muted); }
.operation-preview h3 { margin: 22px 0 8px; color: var(--teal-dark); font: 720 16px/1.25 "Manrope", sans-serif; }
.operation-preview ul { margin: 0; padding: 12px 14px 12px 34px; border: 1px solid #dce5e6; border-radius: 10px; background: #f8fafa; }
.operation-preview li + li { margin-top: 7px; }
.reorganization-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 12px; }
.reorganization-actions > .panel { grid-column: 1 / -1; width: 100%; margin: 0; }
.reorganization-alternatives { border-left: 5px solid #c17b27; }
.reorganization-alternatives form { display: inline-flex; margin: 12px 8px 0 0; }
.reorganization-approval { border-top: 4px solid var(--forest); }
.reorganization-approval article { margin-top: 14px; border: 1px solid #dce5e6; border-radius: 10px; padding: 14px; background: #f8fafa; }
.reorganization-actions > form { display: grid; gap: 10px; min-width: min(100%, 420px); }
.reorganization-actions > form label { display: flex; align-items: flex-start; gap: 9px; border: 1px solid #cbd9da; border-radius: 10px; padding: 11px 12px; background: #f2f6f6; cursor: pointer; }
.reorganization-actions > form label:has(input:checked) { border-color: #6ba5ac; background: var(--mint); color: var(--teal-dark); box-shadow: inset 3px 0 var(--forest); }
.reorganization-actions > form input[type="checkbox"] { flex: 0 0 auto; width: 17px; height: 17px; margin: 1px 0 0; accent-color: var(--forest); }

/* Billing */
.billing-products .product-state, .document-state { border: 1px solid transparent; border-radius: 999px; font-size: 9px; letter-spacing: .01em; }
.billing-products .product-state, .document-state.issued, .document-state.paid { border-color: #add5c0; background: #e1f3e9; color: #1c6848; }
.billing-products .product-state.inactive, .document-state.draft { border-color: #ccd6d7; background: #edf1f1; color: #586c70; }
.document-state.partial { border-color: #e3c274; background: #fff3d5; color: #77510d; }
.document-state.overdue { border-color: #dfa494; background: #fbe6df; color: #8d3524; }
.billing-products tr.is-inactive, .due-payment-item.is-reversed { opacity: 1; color: #7a888a; background: #f3f5f5; }
.bulk-document-actions { border-radius: 12px; padding: 10px 12px; background: #edf3f3; }
.billing-generation-actions { align-items: flex-end; }
.bulk-selection-status { margin: 12px 0 0; border: 1px solid #a8cacc; border-radius: 10px; padding: 10px 12px; background: var(--mint); color: var(--teal-dark); font-size: 11px; font-weight: 700; }
.missing-progressive td { border-color: #e4c47d; background: #fff7e4; }
.billing-client-group td { border-top-color: var(--teal-deep); background: #edf4f4; }
.late-cancellation-panel { padding: 0; overflow: hidden; }
.late-cancellation-panel > .panel-head { margin: 0; padding: 24px 24px 16px; }
.late-cancellation-list { border-top: 1px solid var(--line); }
.late-cancellation-item + .late-cancellation-item { border-top: 1px solid var(--line); }
.late-cancellation-item-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 24px; background: #f6f9f9; }
.late-cancellation-item-head h3 { margin: 0; color: var(--teal-dark); font: 750 16px/1.3 "Manrope", sans-serif; }
.late-cancellation-item-head p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.late-cancellation-item-head a { flex: 0 0 auto; font-size: 11px; font-weight: 720; }
.late-cancellation-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.late-cancellation-action { display: grid; align-content: start; gap: 12px; min-width: 0; padding: 20px 24px 22px; }
.late-cancellation-action + .late-cancellation-action { border-left: 1px solid var(--line); }
.late-cancellation-action-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; min-height: 53px; }
.late-cancellation-action h4 { margin: 0; color: #2a4f54; font: 730 14px/1.3 "Manrope", sans-serif; }
.late-cancellation-action p { margin: 4px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.late-cancellation-action label { color: #2a4145; font-size: 11px; font-weight: 720; }
.late-cancellation-action .control { max-width: none; }
.late-cancellation-action .button { justify-self: start; }
.late-cancellation-action.is-complete { background: #fbfcfc; }
.late-cancellation-empty { display: grid; gap: 4px; padding: 28px 24px; color: var(--muted); text-align: center; }
.late-cancellation-empty strong { color: #40585c; }
.manual-line-panel, .expense-entry { border-top-color: #dce5e6; }
.manual-line-panel summary, .expense-entry summary { color: #256c75; }
.billing-summary-row, .billing-totals > div { border-color: #dce5e6; }
.issue-panel { border-color: #8fb9be; border-top: 4px solid var(--forest); }
.due-summary-panel { padding: 0; overflow: hidden; }
.due-summary-panel > .panel-head { align-items: flex-end; margin: 0; padding: 24px 24px 8px; }
.due-summary-panel > .section-intro { margin: 0; padding: 0 24px 22px; }
.due-summary-row { border-color: var(--line); }
.due-summary-row > div { display: grid; align-content: start; gap: 7px; min-height: 108px; border-color: var(--line); padding: 19px 20px; background: white; }
.due-summary-row span { line-height: 1.35; }
.due-summary-row strong { margin-top: 0; color: var(--teal-dark); font-family: "Manrope", sans-serif; font-size: clamp(20px, 2vw, 28px); font-variant-numeric: tabular-nums; font-weight: 720; letter-spacing: -.04em; line-height: 1.12; }
.due-actions-menu { border-color: #c9d7d9; border-radius: 11px; background: #f6f9f9; box-shadow: 0 8px 24px rgb(18 57 62 / 10%); }
.due-actions-menu summary { color: #256c75; font-size: 10px; letter-spacing: .02em; text-transform: none; }
.due-actions-panel { border-color: #dce5e6; }
.due-actions-overview strong { color: var(--danger); font-family: "Manrope", sans-serif; }
.due-payment-item { border-color: #d8e2e3; border-radius: 9px; }
.balance-columns { gap: 12px; }
.balance-card { min-height: 142px; border: 1px solid #2b6971; border-radius: 14px; background: var(--teal-deep); }
.balance-card.expense { border-color: #dda590; background: #f6ddd4; color: #703320; }
.balance-card.total { border-color: #e2c276; background: #fff0cb; }
.balance-card.total.positive { border-color: #7dc39b; background: #dff3e8; color: #145e3c; }
.balance-card.total.negative { border-color: #bb5c4a; background: #9f402e; }
.balance-card > span { font-size: 10px; letter-spacing: .04em; text-transform: none; }
.balance-card strong { font-family: "Manrope", sans-serif; font-size: clamp(27px, 3.6vw, 43px); font-weight: 720; letter-spacing: -.05em; }
.ledger-list article { border-color: #e0e8e8; }

/* Invoice preview and print document */
.document-print-page { background: #dfe5e5; font-family: "Manrope", sans-serif; }
.document-sheet { box-shadow: 0 16px 55px rgb(18 48 52 / 18%); }
.invoice-head { border-color: var(--teal-deep); }
.invoice-identity h1 { color: var(--teal-dark); font-family: "Manrope", sans-serif; font-size: 31px; font-weight: 760; letter-spacing: -.04em; }
.invoice-parties section { border-radius: 5px; background: #f0f5f5; }
.invoice-label { color: #567075; font-size: 9px; letter-spacing: .04em; text-transform: none; }
.invoice-source td { color: var(--teal-dark); }
.invoice-totals { background: #e8efef; }
.invoice-totals .grand { border-color: white; }
.draft-watermark { color: rgb(185 81 55 / 12%); font-family: "Manrope", sans-serif; }

@media (max-width: 1050px) {
  .app-main { padding-inline: 28px; }
  .page-head h1 { font-size: clamp(30px, 4vw, 40px); }
  .client-directory-results.list-view .person-main, .operator-directory-results.list-view .person-main { gap: 8px 18px; }
  .configuration-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  body::before { display: none; }
  .mobile-header { min-height: 60px; padding: 12px 16px; border-bottom: 1px solid rgb(255 255 255 / 13%); box-shadow: 0 5px 20px rgb(12 52 57 / 15%); }
  .brand-small { gap: 11px; font-size: 14px; }
  .brand-small img { width: 78px; }
  .menu-button { min-height: 38px; border: 1px solid rgb(255 255 255 / 24%); border-radius: 9px; background: white; color: var(--teal-dark); }
  .sidebar { top: 60px; width: min(286px, 84vw); padding-top: 20px; box-shadow: 18px 0 50px rgb(7 35 39 / 24%); }
  .app-main { margin-left: 0; padding: 27px 16px 64px; }
  .page-head { align-items: stretch; gap: 18px; margin-bottom: 24px; }
  .page-head h1 { font-size: clamp(29px, 9vw, 38px); line-height: 1.08; }
  .page-head p { font-size: 12px; }
  .configuration-summary { align-items: flex-start; gap: 16px; padding: 15px 16px; }
  .configuration-summary-count { font-size: 21px; }
  .configuration-card-header { padding: 17px 16px 14px 20px; }
  .configuration-card-details { padding: 0 16px 16px 20px; }
  .configuration-readiness { margin: 0 16px 16px 20px; }
  .configuration-card-actions { padding: 12px 16px 12px 20px; }
  .head-actions { justify-content: flex-start; }
  .head-actions .button { flex: 1 1 auto; }
  .panel { border-radius: 15px; padding: 20px; }
  .client-directory-filter { flex: none; width: 100%; }
  .view-switch { width: 100%; }
  .person-card { gap: 13px; border-radius: 13px; padding: 16px; }
  .person-main h2 { font-size: 16px; }
  .card-actions { gap: 12px; }
  .card-actions > a, .card-actions .link-button { display: inline-flex; align-items: center; min-height: 36px; }
  .form-panel { max-width: none; }
  .form-actions .button { width: 100%; }
  .table-wrap { border-radius: 12px; }
  th, td { padding: 10px 11px; }
  .quick-dialog { width: calc(100vw - 20px); border-radius: 16px; }
  .quick-dialog > form { padding: 18px; }
  .dialog-head h2 { font-size: 22px; }
  .availability-toolbar, .document-list-toolbar, .billing-client-toolbar, .due-period-filter { border-radius: 12px; }
  .billing-generation-actions { align-items: stretch; width: 100%; }
  .billing-generation-actions label, .billing-generation-actions .button { width: 100%; }
  .late-cancellation-panel { padding: 0; }
  .late-cancellation-panel > .panel-head { align-items: flex-start; flex-direction: column; gap: 6px; padding: 20px 18px 14px; }
  .late-cancellation-item-head { align-items: flex-start; flex-direction: column; padding: 16px 18px; }
  .late-cancellation-actions { grid-template-columns: 1fr; }
  .late-cancellation-action { padding: 18px; }
  .late-cancellation-action + .late-cancellation-action { border-top: 1px solid var(--line); border-left: 0; }
  .late-cancellation-action .button { width: 100%; }
  .summary-month-calendar, .calendar-shell { border-radius: 12px; }
  .request-plan-subtract-form .field-dates { padding: 15px; }
  .balance-card { min-height: 118px; }
  .due-summary-panel > .panel-head { align-items: flex-start; flex-direction: column; gap: 6px; padding: 20px 18px 7px; }
  .due-summary-panel > .section-intro { padding: 0 18px 18px; }
  .due-summary-row > div { min-height: 0; padding: 17px 18px; }
  .availability-fragment { grid-template-columns: 1fr; }
  .availability-fragment h3, .availability-fragment > p:first-of-type { grid-column: auto; }
  .reorganization-actions { grid-template-columns: 1fr; }
  .reorganization-actions > form { min-width: 0; }
  .reorganization-alternatives form { display: flex; margin-right: 0; }
  .login-card { margin: 0; border: 0; border-radius: 0; box-shadow: none; }
  .login-intro h1 { font-size: clamp(44px, 14vw, 62px); }
  .filo-app-header { min-height: 64px; gap: 12px; padding: 9px 14px; }
  .filo-brand small, .filo-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .filo-header-actions { gap: 7px; }
  .filo-header-actions .button { min-height: 40px; padding-inline: 12px; }
  .filo-header-actions .link-button { min-width: 44px; min-height: 40px; padding-inline: 4px; color: white; }
  .filo-workspace { display: flex; flex-direction: column; }
  .filo-main { padding-inline: 16px; }
  .filo-thread-heading { padding-block: 9px; }
  .filo-thread-heading h1 { max-width: 60vw; font-size: 17px; }
  .filo-conversation { justify-content: flex-start; gap: 28px; padding: clamp(28px, 7vh, 54px) 0 22px; }
  .filo-welcome h1 { font-size: clamp(34px, 10.5vw, 46px); }
  .filo-welcome > p:last-child { font-size: 13px; }
  .filo-example blockquote { font-size: 17px; }
  .filo-message-result dl div { grid-template-columns: 1fr; gap: 4px; }
  .filo-operation-changes article { grid-template-columns: 1fr; }
  .filo-operation-changes small { grid-column: auto; }
  .filo-confirm-form { align-items: stretch; flex-direction: column; }
  .filo-input-row { grid-template-columns: minmax(0, 1fr) 68px; }
  .filo-composer textarea { min-height: 58px; }
  .filo-composer .button { min-width: 0; padding-inline: 10px; }
  .filo-footer { justify-content: flex-start; overflow: hidden; white-space: nowrap; }
}

@media (max-width: 430px) {
  .configuration-summary p { display: none; }
  .configuration-card-header { flex-wrap: wrap; }
  .configuration-card-header > .status-badge { margin-left: 54px; }
  .configuration-card-details { grid-template-columns: 1fr; }
  .configuration-card-actions > :where(a, form) { flex: 1 1 calc(50% - 4px); }
  .configuration-card-actions form .button, .configuration-card-actions > .button { width: 100%; justify-content: center; }
  .configuration-card-actions .configuration-delete-action { margin-left: 0; }
  .login-destinations { grid-template-columns: 1fr; }
  .timeline-row { grid-template-columns: 64px minmax(0, 1fr); }
  .timeline-row .status { grid-column: 2; justify-self: start; }
  .weekday-picker { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .request-plan-subtract-form .field-dates > .plan-date-picker { grid-template-columns: 1fr; }
  .tax-code-control { grid-template-columns: 1fr; }
}

/* Shared motion language: short, functional feedback without delaying work. */
:where(.button, .link-button, .menu-button, .dialog-close, .cell-add, .client-cell-add,
  .operator-event-action, .client-event-assign, .client-event-remove, summary,
  .sidebar nav a, .card-actions a, .sort-link, .client-combobox-option) {
  transition:
    color var(--motion-fast) var(--motion-ease),
    background-color var(--motion-fast) var(--motion-ease),
    border-color var(--motion-fast) var(--motion-ease),
    box-shadow var(--motion-standard) var(--motion-ease),
    opacity var(--motion-fast) ease,
    transform var(--motion-fast) var(--motion-ease);
}
:where(.button, .menu-button, .dialog-close, .cell-add, .client-cell-add):active:not(:disabled) {
  transform: translateY(1px) scale(.985);
}
:where(input[type="checkbox"], input[type="radio"]) {
  accent-color: var(--forest);
  transition: box-shadow var(--motion-fast) ease, transform var(--motion-fast) var(--motion-spring);
}
:where(input[type="checkbox"], input[type="radio"]):active {
  animation: control-pop var(--motion-standard) var(--motion-spring);
}
.document-selection-option:active .document-selection-mark {
  animation: control-pop var(--motion-standard) var(--motion-spring);
}
.accompaniment-ask-fields { grid-template-columns: 1fr 1.6fr; }
.accompaniment-ask-note { grid-column: 1 / -1; }
.accompaniment-ask-body { padding: 26px; }
.quick-dialog[open] { animation: dialog-enter var(--motion-slow) var(--motion-ease) both; }
.quick-dialog[open]::backdrop { animation: backdrop-enter var(--motion-standard) ease-out both; }
details[open] > :not(summary) { animation: content-reveal var(--motion-standard) var(--motion-ease) both; }
tbody tr > td, .timeline-row, .skill-row, .holiday-list article,
.reorganization-list article, .ledger-list article, .due-payment-item {
  transition: background-color var(--motion-fast) ease, border-color var(--motion-fast) ease;
}
.person-card, .balance-card, .operator-event, .client-event, .week-event, .summary-event, .availability-event {
  transition:
    background-color var(--motion-fast) ease,
    border-color var(--motion-fast) ease,
    box-shadow var(--motion-standard) var(--motion-ease),
    transform var(--motion-standard) var(--motion-ease);
}
@media (hover: hover) {
  .button:hover:not(:disabled):not(.is-disabled) { transform: translateY(-1px); }
  .sidebar nav a:hover { transform: translateX(2px); }
  :where(.person-card):hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgb(18 57 62 / 9%); }
  :where(.operator-event, .client-event, .week-event, .summary-event, .availability-event):hover { transform: translateY(-1px); box-shadow: 0 5px 13px rgb(18 57 62 / 12%); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

@media print {
  :root { font-family: "Manrope", Arial, sans-serif; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  body::before, .sidebar-edge-trigger { display: none; }
  .app-main { position: relative; margin: 0; padding: 0; }
  .document-sheet { box-shadow: none; }
  .panel, .table-wrap, .calendar-shell, .summary-month-calendar { border-radius: 0; box-shadow: none; }
  .calendar-print-head { position: absolute; top: 0; left: 0; z-index: 2; width: 100%; height: 100px; margin: 0; border-bottom: 1px solid var(--line); background: white; }
  .week-column { border-radius: 0; padding-top: 100px; }
  .week-column, .summary-month-week, .summary-month-day { break-inside: auto; page-break-inside: auto; }
  .week-event, .summary-event, .operator-period-client, .operator-period-access,
  .client-event, .operator-event {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .summary-month-calendar { position: relative; }
  .summary-month-weekdays { position: absolute; top: 100px; left: 0; z-index: 2; width: 100%; }
  .summary-month-weekdays + .summary-month-week .summary-month-day { padding-top: 130px; }
}

/* Calendari operativi unificati: margini come le altre pagine da 1400 px; sotto restano 20 px
   ai lati perché la griglia mensile ha una larghezza minima e uscirebbe dal riquadro. */
.app-main:has(.calendar-workspace) { padding: 30px 20px 40px; }
@media (min-width: 1400px) { .app-main:has(.calendar-workspace) { padding-inline: 32px; } }
.calendar-workspace { --calendar-name-column: 180px; }
.calendar-workspace-head { align-items: end; margin-bottom: 16px; }
.calendar-workspace-head h1 { font-size: clamp(30px, 3.2vw, 42px); }
.calendar-workspace-head p { max-width: 720px; }
.calendar-command-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  border: 1px solid #cbdadc;
  border-radius: 13px;
  padding: 9px;
  background: #f7fafa;
  box-shadow: 0 5px 18px rgb(18 57 62 / 6%);
}
.calendar-command-bar .view-switch { flex: none; }
.calendar-period-nav { display: flex; align-items: center; gap: 5px; }
.calendar-period-nav .button { min-width: 38px; padding-inline: 10px; font-size: 17px; }
.calendar-period-nav .calendar-today { min-width: 58px; font-size: 11px; }
.calendar-period-picker { display: flex; align-items: center; gap: 6px; margin: 0; }
.calendar-period-picker input { min-height: 38px; border: 1px solid #bccdd0; border-radius: 8px; padding: 6px 9px; background: white; color: var(--ink); }
.calendar-search { display: flex; min-width: 190px; flex: 1 1 220px; align-items: center; gap: 8px; margin-left: auto; color: #526d71; font-size: 10px; font-weight: 750; }
.calendar-search input { min-width: 120px; width: 100%; min-height: 38px; border: 1px solid #bccdd0; border-radius: 8px; padding: 7px 10px; background: white; color: var(--ink); font-size: 12px; }
.calendar-board-surface { max-height: none; overflow: visible; overscroll-behavior: auto; }
.calendar-board-surface .month-day, .calendar-board-surface .month-corner { position: sticky; top: 0; z-index: 5; }
.calendar-board-surface .month-corner { left: 0; z-index: 7; }
.calendar-week-workspace .month-grid { grid-template-columns: var(--calendar-name-column) repeat(7, minmax(126px, 1fr)); min-width: 1062px; }
.calendar-week-workspace .calendar-board-surface { max-height: none; overflow: visible; }
.calendar-week-workspace .month-cell, .calendar-week-workspace .month-person { min-height: 116px; }
.calendar-week-workspace .calendar-row-empty { min-height: 48px; }
.calendar-week-workspace .month-cell { overflow: visible; padding: 7px; }
.calendar-week-workspace .month-person { display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.calendar-month-workspace .month-grid { grid-template-columns: var(--calendar-name-column) repeat(var(--days), minmax(29px, 1fr)); min-width: calc(var(--calendar-name-column) + var(--days) * 29px); }
.calendar-month-workspace .month-corner, .calendar-month-workspace .month-day, .calendar-month-workspace .month-person, .calendar-month-workspace .month-cell { min-height: 52px; }
.calendar-month-workspace .month-day { justify-content: center; padding: 5px 1px; }
.calendar-month-workspace .month-day small { font-size: 7px; }
.calendar-month-workspace .month-day strong { font-size: 13px; }
.calendar-month-workspace .month-person { display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 7px 10px; }
.calendar-month-workspace .month-person small { color: var(--danger); font-size: 8px; font-weight: 800; }
.calendar-workspace .month-person.has-open-coverage { display: flex; flex-direction: column; justify-content: flex-start; gap: 2px; box-shadow: inset 3px 0 var(--danger); }
.calendar-workspace .month-person.has-open-coverage small { display: block; color: var(--danger); font-size: 8px; font-weight: 800; }
.calendar-month-workspace .month-cell { display: grid; place-items: center; padding: 2px; }
.calendar-cell-summary { display: grid; width: 100%; height: 100%; min-height: 45px; place-content: center; gap: 0; border: 0; border-radius: 5px; padding: 2px; background: #e4f1f2; color: var(--teal-dark); cursor: pointer; text-align: center; }
.calendar-cell-summary:hover, .calendar-cell-summary:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; background: #d4e9eb; }
.calendar-cell-summary > strong { font-size: 14px; line-height: 1; }
.calendar-cell-summary > span:not(.visually-hidden) { font-size: 7px; font-weight: 750; line-height: 1.2; }
.calendar-cell-summary > small { color: #9b6414; font-size: 7px; line-height: 1.15; }
.calendar-cell-summary .coverage-label.coverage-covered { color: #34704e; }
.calendar-cell-summary .coverage-label.coverage-partial { color: #9a640d; }
.calendar-cell-summary .coverage-label.coverage-uncovered { color: var(--danger); }
.calendar-cell-summary:has(.coverage-partial) { background: #fff1cd; }
.calendar-cell-summary:has(.coverage-uncovered) { background: #fae2da; box-shadow: inset 3px 0 var(--danger); }
.calendar-month-workspace .calendar-cell-summary:has(.coverage-uncovered) { box-shadow: none; }
.calendar-cell-empty { color: #a9b8ba; font-size: 11px; }
.calendar-mobile-day { display: none; }
.calendar-detail-dialog { width: min(430px, calc(100vw - 24px)); max-height: calc(100vh - 32px); margin: auto; border: 0; border-radius: 16px; padding: 0; background: white; color: var(--ink); box-shadow: 0 24px 80px rgb(7 35 39 / 35%); }
.calendar-detail-dialog::backdrop { background: rgb(9 35 39 / 45%); }
.calendar-detail-dialog > header { position: sticky; top: 0; z-index: 2; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; border-bottom: 1px solid #dce6e7; padding: 20px 20px 16px; background: white; }
.calendar-detail-dialog > header small { color: #577276; font-size: 10px; text-transform: capitalize; }
.calendar-detail-dialog > header h2 { margin: 3px 0; color: var(--teal-dark); font-size: 22px; }
.calendar-detail-dialog > header p { margin: 0; color: var(--muted); font-size: 11px; }
.calendar-detail-dialog > header button { display: grid; width: 34px; height: 34px; flex: 0 0 34px; place-items: center; border: 1px solid #cbd8da; border-radius: 50%; background: white; color: #526d71; font-size: 23px; cursor: pointer; }
.calendar-detail-events { display: grid; gap: 10px; padding: 18px 20px 24px; }
.calendar-detail-events .operator-event, .calendar-detail-events .client-event { margin: 0; }
.calendar-detail-events .month-cell a, .calendar-detail-events .month-event { font-size: 11px; }
.calendar-ui.calendar-command-bar, .calendar-summary-toolbar.calendar-command-bar { margin-bottom: 14px; }
.calendar-board-surface.week-grid { max-height: none; overflow: visible; border-radius: 13px; }
.calendar-board-surface.summary-month-calendar { max-height: none; overflow: visible; }
.availability-calendar-panel .calendar-command-bar { margin-top: 12px; }
.access-calendar .calendar-command-bar { position: sticky; top: 0; z-index: 6; }

/* Quadro operatrici: variante blu ardesia, distinta dalla copertura clienti. */
.operator-calendar-workspace {
  --operator-accent: #486b91;
  --operator-accent-dark: #2f4f72;
  --operator-soft: #e7eef6;
  --operator-line: #bccbdd;
  --operator-grad: linear-gradient(120deg, #2f4f72 0%, #486b91 50%, #6f93bd 100%);
}
.operator-calendar-workspace .calendar-workspace-head .eyebrow { color: var(--operator-accent); }
.operator-calendar-workspace .calendar-workspace-head h1 { color: var(--operator-accent-dark); }
.operator-calendar-workspace .calendar-command-bar { border-color: var(--operator-line); background: linear-gradient(180deg, #ffffff, #f0f4f8); box-shadow: 0 5px 18px rgb(47 79 114 / 8%); }
.operator-calendar-workspace .calendar-command-bar .view-switch { border-color: #b8c6d8; background: #e9eef5; }
.operator-calendar-workspace .calendar-command-bar .button.primary { border-color: var(--operator-accent-dark); background: var(--operator-grad); color: white; }
.operator-calendar-workspace .calendar-command-bar .button.ghost { border-color: #aebfd2; color: var(--operator-accent-dark); }
.operator-calendar-workspace .calendar-board-surface { border-color: var(--operator-line); }
.operator-calendar-workspace .month-corner,
.operator-calendar-workspace .month-person { background: linear-gradient(180deg, #ffffff, #f0f4f8); color: var(--operator-accent-dark); }
.operator-calendar-workspace .month-day { background: linear-gradient(180deg, #eef3f9, #e1e9f2); color: var(--operator-accent-dark); }
.operator-calendar-workspace .month-cell:hover { background: rgb(72 107 145 / 7%); }
.operator-calendar-workspace .month-cell.weekend,
.operator-calendar-workspace .month-day.weekend { background: #f1f4f8; }
.operator-calendar-workspace .operator-event.assigned { border-color: var(--client-color-border, #b6c9de); border-left-color: var(--client-color-border, var(--operator-accent)); background: var(--client-color, #e1eaf5); }
.operator-calendar-workspace .operator-event.assigned.has-provisional { border: 2px dashed #6f42a6; background-color: var(--client-color, #eadff5); background-image: repeating-linear-gradient(135deg, transparent 0 8px, rgb(111 66 166 / 11%) 8px 12px); }
.operator-calendar-workspace .month-cell a,
.operator-calendar-workspace .month-event { color: var(--operator-accent-dark); }
.operator-calendar-workspace .calendar-cell-summary { background: var(--operator-soft); color: var(--operator-accent-dark); }
.operator-calendar-workspace .calendar-cell-summary:hover,
.operator-calendar-workspace .calendar-cell-summary:focus-visible { background: #d8e3ef; }
.operator-calendar-workspace .month-cell:hover .cell-add,
.operator-calendar-workspace .cell-add:focus { border-color: #8da6c0; background: #edf3f9; color: var(--operator-accent-dark); }
.operator-calendar-workspace .calendar-detail-dialog > header h2 { color: var(--operator-accent-dark); }

@media (max-width: 1100px) {
  .calendar-command-bar { align-items: stretch; flex-wrap: wrap; }
  .calendar-search { min-width: min(100%, 240px); }
}

@media (max-width: 760px) {
  .app-main:has(.calendar-workspace) { padding: 22px 12px 48px; }
  .calendar-workspace-head { align-items: stretch; }
  .calendar-command-bar { position: sticky; top: 60px; z-index: 12; gap: 7px; border-radius: 11px; padding: 8px; }
  .calendar-command-bar .view-switch, .calendar-period-nav, .calendar-period-picker, .calendar-search { width: 100%; }
  .calendar-command-bar .view-switch .button { flex: 1; }
  .calendar-period-nav .calendar-today { flex: 1; }
  .calendar-period-picker input, .calendar-search input { flex: 1; }
  .calendar-search { margin-left: 0; }
  .calendar-board-surface { max-height: none; overflow: visible; border: 0; border-radius: 0; background: transparent; }
  .calendar-board-surface .month-grid { display: block; min-width: 0; border: 0; background: transparent; }
  .calendar-board-surface .month-corner, .calendar-board-surface .month-day { display: none; }
  .calendar-board-surface .month-person { position: static; min-height: 0; margin: 16px 0 7px; border: 0; border-radius: 10px 10px 0 0; padding: 11px 13px; background: var(--teal-dark); color: white; box-shadow: none; }
  .calendar-board-surface .month-person a { color: white; }
  .calendar-board-surface .month-person small { color: #ffd7c9; }
  .calendar-board-surface .month-cell { display: block; min-height: 0; max-height: none; overflow: visible; margin: 0 0 7px; border: 1px solid #cbdadc; border-radius: 10px; padding: 10px; background: white; }
  .calendar-board-surface .month-cell.weekend { background: #f7f9f8; }
  .calendar-month-workspace .month-cell.is-empty { display: none; }
  /* A destra resta il posto del "+", che sta fuori dal flusso nell'angolo in alto della cella. */
  .calendar-mobile-day { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: -2px 0 8px; border-bottom: 1px solid #e0e8e9; padding: 0 30px 7px 0; color: #587176; text-transform: capitalize; }
  .calendar-mobile-day span { font-size: 10px; font-weight: 700; }
  .calendar-mobile-day strong { color: var(--teal-dark); font-size: 12px; }
  .calendar-board-surface .operator-event, .calendar-board-surface .client-event { margin: 6px 0; }
  .calendar-board-surface .operator-event a, .calendar-board-surface .client-event-main { font-size: 11px; }
  .calendar-week-workspace .month-cell.is-empty .calendar-cell-empty { display: block; padding: 5px 0; }
  .calendar-week-workspace .month-cell.calendar-row-empty { display: none; }
  .calendar-week-workspace .month-person.calendar-row-empty { margin-bottom: 7px; }
  .calendar-fixed-header, .calendar-fixed-scrollbar { display: none !important; }
  .operator-calendar-workspace .calendar-board-surface .month-person { background: var(--operator-accent-dark); }
  .operator-calendar-workspace .calendar-mobile-day strong { color: var(--operator-accent-dark); }
  .calendar-detail-dialog { width: calc(100% - 24px); max-width: none; max-height: 82vh; margin: auto; border-radius: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .calendar-detail-dialog { scroll-behavior: auto; }
}

/* Directory cards, scoped to client and operator results. */
.card-grid:where(.client-directory-results, .operator-directory-results) { gap: 12px; }
:where(.client-directory-results, .operator-directory-results) .person-card {
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px 17px;
  border: 1px solid #d3ced4;
  border-radius: 5px;
  padding: 18px;
  background: #ffffff;
  box-shadow: inset 4px 0 #47848d;
}
:where(.client-directory-results, .operator-directory-results) .person-card.client { box-shadow: inset 4px 0 #d48848; }
:where(.client-directory-results, .operator-directory-results) .avatar { border-radius: 6px; background: #dcebed; color: #315f65; }
:where(.client-directory-results, .operator-directory-results) .person-card.client .avatar { background: #f7dfc8; color: #8a4725; }
:where(.client-directory-results, .operator-directory-results) .person-main h2 { color: #3f4445; font-family: Georgia, serif; font-size: 20px; }
:where(.client-directory-results, .operator-directory-results) .person-main > span,
:where(.client-directory-results, .operator-directory-results) .detail-line { color: #687477; }
:where(.client-directory-results, .operator-directory-results) .card-actions {
  grid-column: 2;
  align-items: center;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 13px;
  border-top: 1px solid #e1ddd5;
  padding-top: 11px;
  font-size: 12px;
}
:where(.client-directory-results, .operator-directory-results) .card-actions a,
:where(.client-directory-results, .operator-directory-results) .card-actions .link-button { color: #39747c; }
:where(.client-directory-results, .operator-directory-results) .card-actions a:hover,
:where(.client-directory-results, .operator-directory-results) .card-actions .link-button:hover { color: #244b50; }
:where(.client-directory-results, .operator-directory-results) .card-actions .link-button { font-weight: 700; }
:where(.client-directory-results, .operator-directory-results) .account-disabled,
:where(.client-directory-results, .operator-directory-results) .card-actions .danger { color: #a33d2b !important; }
:where(.client-directory-results, .operator-directory-results) .tags small { border-radius: 4px; background: #e9e2eb; color: #55505a; }
.client-directory-results.list-view .person-card { box-shadow: inset 4px 0 #d48848; }
.operator-directory-results.list-view .person-card { box-shadow: inset 4px 0 #47848d; }

@media (max-width: 1100px) {
  .card-grid:where(.client-directory-results, .operator-directory-results) { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  :where(.client-directory-results, .operator-directory-results) .person-card,
  .client-directory-results.list-view .person-card,
  .operator-directory-results.list-view .person-card { grid-template-columns: 42px minmax(0, 1fr); }
  :where(.client-directory-results, .operator-directory-results) .card-actions { grid-column: 1 / -1; justify-content: flex-start; }
}

/* Tinta leggerissima del Quadro clienti su contenitori esistenti, con angoli arrotondati. */
.calendar-summary-toolbar,
.report-toolbar {
  border: 1px solid var(--line);
  border-radius: 14px;
  margin-top: 0;
  padding: 12px;
  background: linear-gradient(180deg, #ffffff, #f2f8f8);
  box-shadow: 0 8px 24px rgb(18 57 62 / 8%);
}
.summary-month-calendar { border-radius: 14px; }
.availability-toolbar { background: linear-gradient(180deg, #ffffff, #f2f8f8); }
.client-list-toolbar,
.document-list-toolbar,
.due-period-filter,
.billing-client-toolbar {
  border: 1px solid var(--line);
  border-radius: 14px;
  margin-top: 0;
  padding: 12px;
  background: linear-gradient(180deg, #ffffff, #f2f8f8);
  box-shadow: 0 8px 24px rgb(18 57 62 / 8%);
}
/* Smusso dei quadri (visuale settimanale/compatta): le celle d'angolo coprono il raggio del contenitore. */
.calendar-board-surface .month-grid > .month-corner { border-top-left-radius: 13px; }
.calendar-board-surface .month-grid > .month-day:has(+ .month-person) { border-top-right-radius: 13px; }
.calendar-board-surface .month-grid > .month-person:not(:has(~ .month-person)) { border-bottom-left-radius: 13px; }
.calendar-board-surface .month-grid > :last-child { border-bottom-right-radius: 13px; }
/* Niente riga orizzontale sopra l'intro nel dialog "Modifica rimborsi km". */
.mileage-edit-dialog .dialog-head { border-bottom: 0; }
/* Calendario riassuntivo: selettore entità più stretto e barra che non si sovrappone. */
.calendar-summary-toolbar .calendar-summary-entity-filter { flex: 1 1 180px; min-width: 150px; }
.calendar-summary-toolbar .month-nav { flex-wrap: wrap; }
.calendar-summary-toolbar .month-nav > input,
.calendar-summary-toolbar .month-nav > select { flex: 0 1 auto; min-width: 0; }

/* Filo dentro il pannello contestuale. */
.filo-body.filo-embedded { min-width: 0; }
.filo-embedded .filo-shell { height: 100dvh; min-height: 100dvh; }
.filo-embedded .filo-main { max-width: none; padding: 0 17px; }
.filo-embedded .filo-conversation { gap: 22px; padding: 22px 0 18px; }
.filo-embedded .filo-welcome h1 { font-size: clamp(28px, 8vw, 40px); }
.filo-embedded .filo-welcome > p:last-child { font-size: 12px; }
.filo-embedded .filo-example { padding-left: 15px; }
.filo-embedded .filo-example blockquote { font-size: 15px; }
.filo-embedded .filo-message-user { width: 90%; }
.filo-embedded .filo-operation { padding: 13px; }
.filo-embedded .filo-operation-changes article { grid-template-columns: 1fr; }
.filo-embedded .filo-operation-changes small { grid-column: 1; }
.filo-embedded .filo-confirm-form { align-items: stretch; flex-direction: column; }
.filo-embedded .filo-composer { padding: 12px 0 max(12px, env(safe-area-inset-bottom)); }
.filo-embedded .filo-composer textarea { min-height: 54px; max-height: 110px; }
.filo-embedded .filo-composer > p { line-height: 1.35; }
@media (max-width: 600px) {
  .filo-embedded .filo-main { padding-inline: 14px; }
  .filo-embedded .filo-conversation { padding-top: 18px; }
}
