/* Finance filters share TSIGNS controls and keep the existing data bindings. */
body.ts2 #dashboardSection .dashboard-toolbar {
  display: grid !important; grid-template-columns: minmax(220px, 1fr) minmax(155px, 190px) minmax(155px, 190px) !important;
  gap: 16px !important; align-items: end; padding: 0 0 24px !important; overflow: visible;
}
body.ts2 #dashboardSection .dashboard-toolbar > .field { margin: 0 !important; }
body.ts2 .finance-work-search { position: relative; min-width: 0; width: 100%; }
body.ts2 .finance-work-search > input,
body.ts2 .finance-date-input {
  box-sizing: border-box; width: 100%; height: var(--ts-filter-control-size, 40px) !important;
  min-height: var(--ts-filter-control-size, 40px) !important; padding: 8px 12px !important;
  font: 400 14px/1.4 var(--ts-font, inherit) !important; border: 1px solid var(--ts-border, #dfe4e7) !important;
  border-radius: 6px !important; background: var(--ts-surface, #fff) !important; color: var(--ts-text, #252a30) !important;
}
body.ts2 .finance-work-search > input { padding-right: 44px !important; text-overflow: ellipsis; }
body.ts2 .finance-work-search > input::placeholder { color: var(--ts-muted, #757b83); }
body.ts2 .finance-work-toggle {
  position: absolute; top: 0; right: 0; display: grid; place-items: center; padding: 0; width: 40px; height: 40px;
  border: 0; border-radius: 6px; background: transparent; color: var(--ts-muted, #757b83); cursor: pointer;
}
body.ts2 .finance-work-toggle svg { width: 18px; height: 18px; }
body.ts2 .finance-work-options {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 60; max-height: min(320px, 45dvh);
  overflow-y: auto; overscroll-behavior: contain; padding: 4px; border: 1px solid var(--ts-border, #dfe4e7);
  border-radius: 8px; background: var(--ts-surface, #fff); box-shadow: 0 8px 24px #20242b1a;
}
body.ts2 .finance-work-options[hidden],
body.ts2 select[data-finance-search][hidden] { display: none !important; }
body.ts2 .finance-work-option { padding: 10px 12px; border-radius: 4px; font-size: 14px; line-height: 1.4; cursor: pointer; overflow-wrap: anywhere; }
body.ts2 .finance-work-option:hover,
body.ts2 .finance-work-option.is-active { background: var(--ts-brand-tint, #fff1e9); color: var(--ts-brand, #c65322); }
body.ts2 .finance-work-empty { padding: 12px; font-size: 13px; color: var(--ts-muted, #757b83); }
body.ts2 .finance-date-input::-webkit-calendar-picker-indicator { opacity: .6; cursor: pointer; width: 18px; height: 18px; }
body.ts2 .finance-date-input:focus,
body.ts2 .finance-work-search > input:focus { border-color: var(--ts-focus, #c65322) !important; outline: 2px solid var(--ts-brand-tint, #fff1e9); outline-offset: 1px; }
@media (max-width: 767px) {
  body.ts2 #dashboardSection .dashboard-toolbar { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important; gap: 12px !important; }
  body.ts2 #dashboardSection .dashboard-toolbar > .field:first-child { grid-column: 1 / -1; }
  body.ts2 .finance-work-toggle { height: 44px; width: 44px; }
  body.ts2 .finance-work-option { min-height: 44px; box-sizing: border-box; }
  body.ts2 .finance-work-search > input,
  body.ts2 .finance-date-input { font-size: 16px !important; }
}

/* The supplier search uses the same dropdown as the work selector. */
body.ts2 .finance-provider-control { display: block; position: relative; border: 0; background: transparent; padding: 0; }
body.ts2 .finance-provider-control > .provider-search-icon { display: none; }
body.ts2 #dashboardSection .dashboard-provider-toolbar { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important; }
@media (max-width: 767px) {
  body.ts2 #dashboardSection .dashboard-provider-toolbar { grid-template-columns: minmax(0, 1fr) !important; }
}

/* Shared Órdenes primitives: controls, modal layout and durable feedback. */
body.ts2 { --workspace-control-height:40px; --workspace-row-action-height:36px; --ts-ui-radius:6px; }
body.ts2 .ts-ui-button {
  display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:36px;padding:8px 14px;
  border:1px solid var(--ts-border,#dfe4e7);border-radius:var(--ts-ui-radius);background:#fff;color:var(--ts-text,#252a30);
  font:600 13px/1.4 var(--ts-font,Arial);cursor:pointer;white-space:nowrap;
}
body.ts2 .ts-ui-button:hover:not(:disabled){background:#f5f6f8;border-color:#bcc5cf}
body.ts2 .ts-ui-button:disabled{opacity:.5;cursor:default}
body.ts2 .ts-ui-button:focus-visible{outline:2px solid var(--ts-brand,#d94b00);outline-offset:2px}
body.ts2 .ts-ui-dialog {
  width:min(620px,calc(100vw - 32px));max-height:calc(100dvh - 40px);padding:0;margin:auto;overflow:auto;
  border:1px solid #dfe4e7;border-radius:8px;background:white;color:#252a30;font-family:var(--ts-font,Arial);box-shadow:0 20px 70px #17212b30;
}
body.ts2 .ts-ui-dialog::backdrop{background:#17212b70}
body.ts2 .ts-ui-dialog>header{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding:22px 24px;border-bottom:1px solid #e5e8ed}
body.ts2 .ts-ui-dialog h2{font:650 20px/1.3 var(--ts-font,Arial);margin:0}
body.ts2 .ts-ui-dialog p{font:400 13px/1.5 var(--ts-font,Arial);color:#697581;margin:6px 0 0}
body.ts2 .ts-ui-dialog>header>button{min-width:36px;padding:5px;font-size:22px;line-height:1;flex-shrink:0}
body.ts2 .ts-ui-dialog-content{padding:20px 24px}
body.ts2 .ts-ui-dialog>footer{display:flex;justify-content:flex-end;padding:16px 24px;border-top:1px solid #e5e8ed}
body.ts2 .ts-inline-message {display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;padding:12px 14px;border:1px solid #e6cbb5;border-radius:6px;background:#fff8f1;color:#784119;font:400 13px/1.5 var(--ts-font,Arial);grid-column:1/-1;}
body.ts2 .ts-inline-message[hidden]{display:none!important}
body.ts2 .ts-inline-message[data-kind=success]{background:#f1f9f5;border-color:#c8e2d2;color:#22613d}
body.ts2 .ts-inline-message>span{flex:1 1 240px}
body.ts2 .reservation-date-field .ts-date-validation{display:block;color:#a83b24;font-size:12px;margin-top:6px}
@media(max-width:767px){body.ts2{--workspace-control-height:44px;--workspace-row-action-height:44px}body.ts2 .ts-ui-button{min-height:44px}body.ts2 .ts-ui-dialog>header,body.ts2 .ts-ui-dialog-content,body.ts2 .ts-ui-dialog>footer{padding:16px}}

/* One set of filter controls for the operational sections. */
body.ts2 :is(
  #unitsSection .un-filters, #rentalAdministrationSection .ra-filters,
  #incomesSection .incomes-filters, #reservationsSection .reservation-monthly-controls,
  #reservationsSection .reservation-history-filters, #reservationsSection .reservation-filter-panel,
  #purchaseNotesSection .pn-filters, #contactsSection .contacts-toolbar,
  #collectorSignaturesSection .cs-filters, #renditionsSection .renditions-toolbar,
  #adminSection .users-filter-bar, #auditCentralFilters
) label {
  margin: 0 !important;
  font: 500 12px/18px var(--ts-font) !important;
  color: var(--ts-muted);
  letter-spacing: 0;
}
body.ts2 :is(
  #unitsSection .un-filters, #rentalAdministrationSection .ra-filters,
  #incomesSection .incomes-filters, #reservationsSection .reservation-monthly-controls,
  #reservationsSection .reservation-history-filters, #reservationsSection .reservation-filter-panel,
  #purchaseNotesSection .pn-filters, #contactsSection .contacts-toolbar,
  #collectorSignaturesSection .cs-filters, #renditionsSection .renditions-toolbar,
  #adminSection .users-filter-bar, #auditCentralFilters
) :is(input:not([type=checkbox]):not([type=radio]), select) {
  box-sizing: border-box;
  height: var(--workspace-control-height) !important;
  min-height: var(--workspace-control-height) !important;
  margin: 0 !important;
  padding: 8px 12px !important;
  border: 1px solid var(--ts-border) !important;
  border-radius: 6px !important;
  background-color: var(--ts-surface);
  box-shadow: none !important;
  color: var(--ts-text);
  font: 400 13px/1.4 var(--ts-font) !important;
}
body.ts2 :is(#unitsSection .un-filters, #rentalAdministrationSection .ra-filters,
  #incomesSection .incomes-filters, #reservationsSection .reservation-monthly-controls) select {
  appearance: auto !important;
  background-image: none !important;
}

/* Shared calendar, backed by the original date input. */
body.ts2 .reservation-date-source { display:none!important; }
body.ts2 .reservation-date-field { display:block!important; width:100%; min-width:0; }
body.ts2 .reservation-date-trigger { width:100%!important; height:42px!important; min-height:42px!important; display:flex!important; flex-direction:row!important; justify-content:space-between!important; align-items:center!important; gap:12px; border:1px solid #d8dde3!important; border-radius:5px!important; padding:0 12px!important; margin:0!important; background:#fff!important; color:#202a35!important; font:400 13px var(--ts-font,Arial)!important; box-shadow:none!important; cursor:pointer; }
body.ts2 .reservation-date-trigger span { font:inherit!important; color:inherit!important; }
body.ts2 .reservation-date-trigger svg { color:#6c7783; flex-shrink:0; }
body.ts2 .reservation-date-trigger:focus-visible, body.ts2 .reservation-calendar :is(button,select):focus-visible { outline:2px solid #da4a09!important; outline-offset:2px; }
body.ts2 .reservation-date-trigger:disabled { color:#7a8490!important; background:#f6f7f8!important; cursor:default; }
body.ts2 .reservation-calendar { position:fixed; inset:auto; box-sizing:border-box; width:310px; max-width:calc(100vw - 24px); margin:0!important; padding:14px!important; border:1px solid #dbe0e6!important; border-radius:8px!important; background:white!important; box-shadow:0 8px 30px #17212b29!important; color:#202a35; font:400 13px var(--ts-font,Arial); }
body.ts2 .reservation-calendar::backdrop { background:transparent; }
body.ts2 .reservation-calendar-head { display:grid; grid-template-columns:28px minmax(0,1fr) 76px 28px; gap:5px; align-items:center; padding:0 0 12px; }
body.ts2 .reservation-calendar-head :is(button,select) { width:100%!important; height:32px!important; min-height:32px!important; border:1px solid #dfe3e8!important; border-radius:4px!important; padding:0 4px!important; margin:0!important; background:white!important; color:#26323e!important; box-shadow:none!important; font:600 12px var(--ts-font,Arial)!important; }
body.ts2 .reservation-calendar-head button { font-size:22px!important; cursor:pointer; }
body.ts2 .reservation-calendar-week, body.ts2 .reservation-calendar-days { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:3px; text-align:center; }
body.ts2 .reservation-calendar-week span { font:500 10px var(--ts-font,Arial)!important; color:#7b8591; padding:5px 0 8px; }
body.ts2 .reservation-calendar-days button { display:block!important; width:100%!important; min-width:0!important; height:32px!important; min-height:32px!important; padding:0!important; margin:0!important; border:1px solid transparent!important; border-radius:4px!important; background:white!important; color:#303d49!important; font:500 12px var(--ts-font,Arial)!important; box-shadow:none!important; cursor:pointer; }
body.ts2 .reservation-calendar-days button.is-other-month { color:#a6adb6!important; }
body.ts2 .reservation-calendar-days button:hover { background:#fff0e7!important; }
body.ts2 .reservation-calendar-days button[aria-current="date"] { border-color:#eb9f78!important; }
body.ts2 .reservation-calendar-days button[aria-pressed="true"] { background:#d94b00!important; color:#fff!important; }
body.ts2 .reservation-calendar-days button:disabled { opacity:.35; cursor:default; }
body.ts2 .reservation-calendar-footer { display:flex; align-items:center; justify-content:space-between; padding-top:10px; margin-top:10px; border-top:1px solid #e7eaee; }
body.ts2 .reservation-calendar-footer span { color:#7a8591; font:400 11px var(--ts-font,Arial)!important; }
body.ts2 .reservation-calendar-footer button { height:28px!important; min-height:28px!important; width:auto!important; min-width:0!important; padding:0 10px!important; margin:0!important; border:0!important; border-radius:4px!important; background:#fff4ed!important; color:#b94409!important; font:600 12px var(--ts-font,Arial)!important; }

body.ts2 .reservation-date-trigger {height:var(--workspace-control-height)!important;min-height:var(--workspace-control-height)!important;font-size:13px!important}
body.ts2 .reservation-calendar-footer button:disabled {opacity:.35;cursor:default}
body.ts2 :is(dialog.ra-dialog,dialog.un-dialog,.reservation-report-dialog,.commercial-ledger-modal-card) {border-radius:8px!important;border:1px solid #dfe4e7;box-shadow:0 20px 70px #17212b30}
body.ts2 :is(.ra-dialog,.un-dialog,.reservation-report-dialog,.commercial-ledger-modal-card) :is(.btn,.ra-btn,.un-btn) {min-height:var(--workspace-control-height);border-radius:6px;font:600 13px/1.4 var(--ts-font,Arial)}
body.ts2 #commercialLedgerFeedback {margin:0 24px 16px}
@media(max-width:767px){body.ts2 .reservation-date-trigger {font-size:16px!important}body.ts2 :is(#unitsSection .un-filters,#rentalAdministrationSection .ra-filters,#incomesSection .incomes-filters,#reservationsSection .reservation-monthly-controls,dialog.ra-dialog,dialog.un-dialog) :is(input:not([type=checkbox]):not([type=radio]),select){font-size:16px!important}}


/* Operational toolbars use the same geometry as Órdenes, including nested actions. */
body.ts2 :is(#contactsSection .contacts-toolbar-actions, #contactQueries .cq-tools .ts-toolbar,
  #incomesSection .incomes-filters, #unitsSection .un-filters,
  #rentalAdministrationSection .ra-filters, #reservationsSection .reservation-history-filters,
  #reservationsSection .reservation-monthly-controls, #purchaseNotesSection .pn-filters,
  #renditionsSection .renditions-toolbar, #performanceSection .speed-filters) {
  gap:12px!important; align-items:end!important; flex-wrap:wrap; min-width:0;
}
body.ts2 :is(#contactQueries .cq-tools, #contactQueries .cq-period, #contactsSection .contacts-toolbar,
  #purchaseNotesSection .pn-filters, #collectorSignaturesSection .cs-filters,
  #renditionsSection .renditions-toolbar, #performanceSection .speed-filters) :is(input:not([type=checkbox]):not([type=radio]),select),
body.ts2 :is(#contactQueries .cq-tools, #contactQueries .cq-period, #contactsSection .contacts-toolbar,
  #purchaseNotesSection .pn-filters, #collectorSignaturesSection .cs-filters,
  #renditionsSection .renditions-toolbar, #performanceSection .speed-filters,
  #incomesSection .incomes-filters, #unitsSection .un-filters, #rentalAdministrationSection .ra-filters,
  #reservationsSection .reservation-monthly-controls, #reservationsSection .reservation-history-filters) button {
  box-sizing:border-box; height:var(--workspace-control-height)!important;
  min-height:var(--workspace-control-height)!important; margin:0!important;
  border-radius:6px!important; box-shadow:none!important; font-size:13px!important;
}
body.ts2 #contactsSection .contacts-toolbar-actions {height:auto!important;min-height:0!important}
body.ts2 #contactQueries .cq-tools :is(input,select) {border:1px solid var(--ts-border);background-color:#fff}
body.ts2 #contactQueries .cq-tools .ts-toolbar {display:flex;align-items:center!important}
body.ts2 #contactQueries .cq-tools .cq-search {margin:0;min-width:220px;flex:1 1 300px}
body.ts2 #contactQueries .cq-tools .cq-search input {padding-left:38px!important}
body.ts2 #contactQueries #cqChanges {margin:0 0 16px}
body.ts2 :is(.ts-button,.contacts-button,.contacts-row-button,.ra-btn,.un-btn,.pn-btn,.cs-button) {
  border-radius:6px;box-shadow:none;transition:background-color .15s,border-color .15s,color .15s;
}
body.ts2 .contacts-button:hover {transform:none}
body.ts2 :is(.cq-row-actions,.un-actions,.ra-actions,.pn-row-actions,.cs-actions) {display:flex;align-items:center;gap:8px;flex-wrap:wrap}
body.ts2 :is(.cq-row-actions,.un-actions,.ra-actions,.pn-row-actions,.cs-actions) button,
body.ts2 .contacts-row-button {min-height:var(--workspace-row-action-height);box-sizing:border-box}
body.ts2 :is(.cq-dialog,.contacts-dialog,.pn-dialog,.cs-dialog) {
  border:1px solid var(--ts-border,#dfe4e7);border-radius:8px;max-width:calc(100vw - 32px);
  max-height:calc(100dvh - 40px);margin:auto;box-shadow:0 20px 70px #17212b30;
}
body.ts2 :is(.cq-dialog,.contacts-dialog,.pn-dialog,.cs-dialog) :is(.ts-dialog-head,.ts-dialog-foot) {gap:12px;flex-wrap:wrap}
body.ts2 :is(.cq-dialog,.contacts-dialog,.pn-dialog,.cs-dialog) :is(input:not([type=checkbox]):not([type=radio]):not([type=file]),select) {
  box-sizing:border-box;min-height:var(--workspace-control-height);border-radius:6px;font-size:13px;
}
body.ts2 :is(.cq-dialog,.contacts-dialog,.pn-dialog,.cs-dialog) button:focus-visible,
body.ts2 :is(#contactQueries,#contactsSection,#purchaseNotesSection,#collectorSignaturesSection) :is(input,select,button):focus-visible {
  outline:2px solid var(--ts-brand,#d94b00);outline-offset:2px;
}
#workspacePreparing {position:fixed;z-index:2000;bottom:24px;left:50%;transform:translateX(-50%);padding:12px 20px;border:1px solid #dfe4e7;border-radius:8px;background:#fff;color:#34404c;box-shadow:0 4px 20px #17212b20;font:500 13px/1.4 var(--ts-font,Arial)}
#workspacePreparing[hidden],#aiSection[hidden] {display:none!important}
@media(max-width:767px){
  body.ts2 :is(#contactQueries .cq-tools,#contactQueries .cq-period,#contactsSection .contacts-toolbar,#performanceSection .speed-filters,.cq-dialog,.contacts-dialog,.pn-dialog,.cs-dialog) :is(input:not([type=checkbox]):not([type=radio]),select) {font-size:16px!important}
  body.ts2 #contactQueries .cq-tools .ts-toolbar {width:100%}
  body.ts2 #contactQueries .cq-tools .ts-toolbar select {flex:1;min-width:140px;max-width:none}
  body.ts2 #contactsSection .contacts-toolbar-actions {justify-content:flex-start;overflow:visible}
  body.ts2 :is(.cq-dialog,.contacts-dialog,.pn-dialog,.cs-dialog) {max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px)}
}
@media(prefers-reduced-motion:reduce){body.ts2 :is(.ts-button,.contacts-button,.contacts-row-button,.ra-btn,.un-btn,.pn-btn,.cs-button){transition:none}}

body.ts2 .menu-count-badge[hidden],#aiLauncher[hidden],#aiMenu[hidden]{display:none!important}

body.ts2 dialog.cq-dialog .cq-field {font:500 12px/18px var(--ts-font,Arial)!important;gap:6px}
body.ts2 dialog.cq-dialog :is(select,input:not([type=checkbox]):not([type=radio]):not([type=file]),.reservation-date-trigger) {height:var(--workspace-control-height)!important;min-height:var(--workspace-control-height)!important;border:1px solid var(--ts-border,#dfe4e7)!important;border-radius:6px!important;font:400 13px/1.4 var(--ts-font,Arial)!important;box-shadow:none!important;margin:0!important}
@media(max-width:767px){body.ts2 dialog.cq-dialog :is(select,input:not([type=checkbox]):not([type=radio]):not([type=file]),.reservation-date-trigger){font-size:16px!important}}
