/* Shared manager controls. Screen-only: invoice and report print layouts are unchanged. */
@media screen {
 :root{--ui-control:40px;--ui-control-pad:9px;--ui-radius:8px;--ui-gap:10px}
 body .workspace-shell,body .modal-card{font-size:14px;line-height:1.5}
 body .workspace-shell .main{overflow-x:visible;min-width:0}
 body .workspace-shell :is(.panel,.card,.grid,.toolbar,.form-grid,.settings-grid,.calendar-panel,.planner-layout,.planner-routes,.analytics-columns),body .modal-card :is(form,.form-grid,label){min-width:0;max-width:100%}
 body .workspace-shell :is(.grid,.form-grid,.toolbar,.top,.planner-layout,.route-control-fields)>*,body .modal-card :is(.form-grid,.actions,.modal-head)>*{min-width:0}
 body .workspace-shell .btn,body .workspace-shell button.primary,body .modal-card .btn,body .modal-card button.primary,body .workspace-sequence button{
  box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:var(--ui-control);height:auto;max-width:100%;padding:var(--ui-control-pad) 12px;border:1px solid transparent;border-radius:var(--ui-radius);font-size:14px;font-weight:500;line-height:20px;text-align:center;white-space:normal;overflow-wrap:normal;word-break:normal;text-decoration:none;vertical-align:middle;margin-top:0;margin-bottom:0
 }
 body .workspace-shell .btn.secondary,body .modal-card .btn.secondary,body .workspace-sequence button{border-color:var(--line)}
 body .workspace-shell .btn.current,body .workspace-sequence button.current{border-color:transparent}
 body .workspace-shell :is(input,select):not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):not([type=hidden]),body .modal-card :is(input,select):not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):not([type=hidden]){
  box-sizing:border-box;display:block;min-width:0;max-width:100%;width:100%;height:var(--ui-control);min-height:var(--ui-control);padding:8px 10px;border:1px solid #ccd7e3;border-radius:var(--ui-radius);font-size:14px;font-weight:400;line-height:20px
 }
 body #overview-filters :is(input,select){height:var(--ui-control);min-height:var(--ui-control);padding:8px 10px;font-size:14px;line-height:20px}
 body .workspace-shell input[type=color],body .modal-card input[type=color]{padding:4px}
 body .workspace-shell textarea,body .modal-card textarea{min-width:0;max-width:100%;width:100%;resize:vertical;font-size:14px;font-weight:400;border-radius:var(--ui-radius)}
 body .workspace-shell label,body .modal-card label{font-size:13px;font-weight:500;overflow-wrap:anywhere}
 body .workspace-shell :is(.toolbar,.actions,.top,.calendar-nav,.calendar-views,.planner-route-head),body .modal-card :is(.toolbar,.actions,.modal-head){gap:var(--ui-gap);flex-wrap:wrap}
 body .workspace-shell :is(.panel,.card,.route-notice,.day-visit),body .modal-card{overflow-wrap:anywhere}
 body .workspace-shell :is(.list-filters,.calendar-filters,.route-control-fields,.day-filters){align-items:end}
 body .workspace-shell .list-filters>label{flex:1 1 150px;min-width:0;max-width:100%}
 body .workspace-shell .list-filters>.list-search{flex-basis:240px}
 body .workspace-shell .list-clear{width:auto}
 body .workspace-shell .list-summary{flex-wrap:wrap}
 body .workspace-shell :is(.calendar-nav,.calendar-views){align-items:center}
 body .workspace-shell .calendar-toolbar{grid-template-columns:minmax(0,1fr) auto minmax(0,1fr)}
 body .workspace-shell .calendar-toolbar h2{font-size:18px}
 body .workspace-shell .calendar-panel{overflow:visible}
 .calendar-scroll{width:100%;max-width:100%;min-width:0;overflow-x:auto;overscroll-behavior-x:contain;border-radius:8px;border:1px solid var(--line)}
 body .workspace-shell .calendar-scroll .calendar-grid{border:0;overflow:visible}
 body .workspace-shell .calendar-scroll :is(.week-view,.month-view){width:100%;min-width:840px;grid-template-columns:repeat(7,minmax(0,1fr))}
 body .workspace-shell .calendar-scroll .month-weekdays{min-width:840px;grid-template-columns:repeat(7,minmax(0,1fr));border-bottom:1px solid var(--line)}
 body .workspace-shell .calendar-scroll .day-view{min-width:0;grid-template-columns:minmax(0,1fr)}
 body .workspace-shell .calendar-day{min-width:0}
 body .workspace-shell .calendar-visit{font-size:13px;line-height:1.4;min-height:44px;font-weight:400}
 body .workspace-shell .calendar-visit b{font-weight:500}
 .calendar-scroll-hint{margin:8px 0;font-size:12px;color:var(--muted)}
 .calendar-scroll:focus-visible{outline:3px solid #62aaf1;outline-offset:2px}
 body .workspace-shell .route-control-fields{grid-template-columns:repeat(4,minmax(0,1fr))}
 body .workspace-shell .planner-layout{grid-template-columns:minmax(0,2fr) minmax(0,3fr)}
 body .workspace-shell .planner-map{min-width:0;max-width:100%}
 body .workspace-shell :is(img,iframe,video){max-width:100%}
 body .workspace-shell :is(.planner-stop-actions,.day-actions){min-width:0}
 body .workspace-shell .planner-stop-actions{flex-wrap:wrap}
 body .workspace-shell .planner-route-head>div{min-width:0}
 body .workspace-shell .workspace-settings-tools label{min-width:0;max-width:100%}
 body .workspace-shell .taxes{grid-template-columns:repeat(4,minmax(0,1fr))}
 body .modal{padding:16px;overflow:auto;align-items:center}
 body .modal-card{max-width:100%;max-height:calc(100dvh - 32px);padding:20px;overscroll-behavior:contain}
 body .modal-card .modal-head{flex-wrap:nowrap;align-items:flex-start}
 body .modal-card .modal-head h2{margin:0 0 12px;font-size:20px}
 body .modal-card .modal-head>button{flex:0 0 var(--ui-control);width:var(--ui-control);height:var(--ui-control);display:grid;place-items:center;padding:0;line-height:1;border-radius:var(--ui-radius)}
 body .modal-card .sticky-actions{bottom:-20px;padding:12px 0 6px;gap:var(--ui-gap)}
 body .modal-card .line,body .modal-card .line-head{grid-template-columns:minmax(0,2fr) 64px 100px 60px 60px 40px}
 body .modal-card .line>*{min-width:0;max-width:100%}
 body .modal-card :is(.remove,.remove-visit,.remove-appliance){min-height:var(--ui-control)}
 body .modal-card .visit-row{grid-template-columns:repeat(3,minmax(0,1fr))!important}
 body .modal-card :is(.visit-notes,.visit-workflow){grid-column:1/-1}
 body .modal-card .remove-visit{grid-column:auto}
 body .modal-card .appliance-row{grid-template-columns:repeat(2,minmax(0,1fr))}
 body .modal-card :is(.appliance-number,.remove-appliance){grid-column:1/-1}
 body .modal-card .labor-cost-row{grid-template-columns:repeat(3,minmax(0,1fr))}
 body .modal-card .direct-cost-row{grid-template-columns:minmax(0,1fr) minmax(0,140px) auto}
 body .modal-card .costing-summary{grid-template-columns:repeat(auto-fit,minmax(min(100%,150px),1fr))}
 body .modal-card .po-line{grid-template-columns:minmax(0,1fr) 90px 110px auto}
 body .modal-card :is(.file-card,.route-stop){min-width:0;flex-wrap:wrap}
 body .modal-card :is(pre,code),body .workspace-shell :is(pre,code){max-width:100%;white-space:pre-wrap;overflow-wrap:anywhere}
 body .workspace-shell button:focus-visible,body .modal-card :is(button,input,select,textarea,a):focus-visible{outline:3px solid #62aaf1;outline-offset:2px}
 body .workspace-shell button:disabled,body .modal-card button:disabled{opacity:.55;cursor:not-allowed}
}
@media screen and (max-width:1200px){
 body .workspace-shell .calendar-toolbar{grid-template-columns:minmax(0,1fr)}
 body .workspace-shell .calendar-toolbar h2{grid-row:1;text-align:left}
 body .workspace-shell .calendar-views{justify-content:flex-start}
 body .workspace-shell .route-control-fields{grid-template-columns:repeat(2,minmax(0,1fr))}
 body .workspace-shell .planner-layout{grid-template-columns:minmax(0,1fr)}
 body .workspace-shell .planner-map{position:static}
}
@media screen and (max-width:800px){
 :root{--ui-control:44px;--ui-control-pad:11px}
 body #overview-filters :is(input,select){font-size:16px}
 body .workspace-shell :is(input,select,textarea):not([type=checkbox]):not([type=radio]),body .modal-card :is(input,select,textarea):not([type=checkbox]):not([type=radio]){font-size:16px}
 body .workspace-shell .calendar-filters{grid-template-columns:minmax(0,1fr)}
 body .workspace-shell .calendar-filters>span{grid-column:auto;padding:0}
 body .workspace-shell :is(.calendar-nav,.calendar-views){width:100%;flex-wrap:wrap}
 body .workspace-shell :is(.calendar-nav,.calendar-views) .btn{flex:1 1 60px}
 body .workspace-shell :is(.grid,.taxes){grid-template-columns:repeat(2,minmax(0,1fr))}
 body .modal-card .line{grid-template-columns:minmax(0,1fr) 62px 90px}
 body .modal-card .line-head{display:none}
 body .modal-card .line-details{grid-column:1/-1}
 body .modal-card .line .remove{width:44px;justify-self:end}
 body .modal-card .labor-cost-row{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media screen and (max-width:520px){
 body .workspace-shell .main{padding:12px}
 body .workspace-shell .panel{padding:12px}
 body .workspace-shell :is(.route-control-fields,.day-actions,.workspace-extra-filters){grid-template-columns:minmax(0,1fr)}
 body .workspace-shell .list-filters>label{flex-basis:100%}
 body .workspace-shell .list-filters>.btn{flex:1}
 body .workspace-shell .planner-stop{grid-template-columns:28px minmax(0,1fr);padding:12px;gap:8px}
 body .workspace-shell .planner-stop-actions{grid-column:2}
 body .workspace-shell .analytics-bar-row{grid-template-columns:44px minmax(0,1fr) 75px;gap:5px}
 body .modal{padding:8px}
 body .modal-card{padding:14px;max-height:calc(100dvh - 16px)}
 body .modal-card .sticky-actions{bottom:-14px;position:static}
 body .modal-card .actions>*{flex:1 1 120px;max-width:100%}
 body .modal-card :is(.visit-row,.appliance-row,.labor-cost-row,.direct-cost-row,.time-off-row){grid-template-columns:minmax(0,1fr)!important}
 body .modal-card :is(.visit-row,.appliance-row,.labor-cost-row,.direct-cost-row,.time-off-row)>*{grid-column:1/-1}
 body .modal-card .po-line{grid-template-columns:repeat(2,minmax(0,1fr))}
 body .modal-card .po-line select{grid-column:1/-1}
 body .modal-card :is(.job-costing,.visits-editor,.appliances-editor,.job-history,.customer-portal-admin){padding:12px}
 body .workspace-shell .day-date-nav{grid-template-columns:44px minmax(0,1fr) 44px}
}
@media print{.calendar-scroll-hint{display:none}.calendar-scroll{overflow:visible;border:0}}

/* 4.24.0: keep row actions readable and align filter controls by their bottom edge. */
@media screen {
 body .workspace-shell .overview-table th:last-child{width:104px}
 body .workspace-shell .overview-table td:last-child{width:104px;text-align:right;vertical-align:middle}
 body .workspace-shell .overview-table [data-overview-open]{min-width:72px;white-space:nowrap;overflow-wrap:normal;word-break:normal;padding-inline:12px}
 body #overview-filters{gap:10px;align-items:end}
 body #overview-filters label{margin:0;gap:6px}
 body #overview-filters label>input,body #overview-filters label>select{margin-top:0}
 body #overview-filters>.btn{align-self:end;white-space:nowrap}
 body .workspace-shell :is(.route-control-fields,.calendar-filters,.list-filters,.analytics-filters,.agreement-filters,.message-filters)>label{margin-bottom:0}
}
