body.ts2 #dashboardExpensesPanel .dashboard-toolbar {
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 240px) !important;
}
body.ts2 #dashboardExpensesPanel .dashboard-toolbar.has-custom-dates {
  grid-template-columns: minmax(220px, 1fr) minmax(160px, 210px) repeat(2, minmax(155px, 190px)) !important;
}
body.ts2 #dashboardExpensesPanel .field[hidden],
body.ts2 #dashboardExpensesPanel section[hidden] { display: none !important; }
body.ts2 #dashboardPeriodFilter { width: 100%; min-height: 40px; }
body.ts2 #dashboardUnclassifiedSection .dashboard-rubro-summary { min-width: 220px; }
body.ts2 #dashboardUnclassifiedSection .dashboard-bar-fill { background: #8994a3; }
body.ts2 .budget-scope-note { display: block; margin-top: 7px; color: #626d79; font-size: 13px; }
@media (max-width: 1100px) {
  body.ts2 #dashboardExpensesPanel .dashboard-toolbar.has-custom-dates {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
@media (max-width: 767px) {
  body.ts2 #dashboardExpensesPanel .dashboard-toolbar,
  body.ts2 #dashboardExpensesPanel .dashboard-toolbar.has-custom-dates { grid-template-columns: minmax(0, 1fr) !important; }
  body.ts2 #dashboardUnclassifiedSection .preview-header { flex-wrap: wrap; gap: 12px; }
  body.ts2 #dashboardUnclassifiedSection .dashboard-rubro-summary { width: 100%; min-width: 0; }
}

/* Keep the selected range readable without stretching its reset action on phones. */
@media (max-width: 767px) {
  body.ts2 #dashboardSection .dashboard-actions {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center !important;
    justify-content: space-between;
    gap: 8px 12px !important;
  }
  body.ts2 #dashboardSection .dashboard-date-pill {
    flex: 1 1 180px !important;
    width: auto !important;
    min-height: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    line-height: 1.45;
    font-weight: 500;
  }
  body.ts2 #dashboardSection #dashboardClearFiltersBtn {
    flex: 0 0 auto !important;
    width: auto !important;
    min-height: 44px !important;
    height: 44px;
    margin-left: auto !important;
    white-space: nowrap;
    background: #fff !important;
    border: 1px solid #dfe3e8 !important;
    color: #374151 !important;
  }
}

body.ts2 #budgetTraceModal .work-budget-trace-sheet { display: flex; flex-direction: column; overflow: hidden; }
body.ts2 #budgetTraceModal .work-budget-trace-head,
body.ts2 #budgetTraceModal .work-budget-trace-summary,
body.ts2 #budgetTraceModal .work-budget-trace-pager { flex-shrink: 0; }
body.ts2 #budgetTraceModal .work-budget-trace-list { min-height: 0; overflow: auto; align-content: start; overscroll-behavior: contain; }
body.ts2 #budgetTraceModal .work-budget-trace-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 0 12px; }
body.ts2 #budgetTraceModal .work-budget-trace-pager[hidden] { display: none !important; }
body.ts2 #budgetTraceModal .work-budget-trace-pager span { grid-column: 1 / -1; font-size: 12px; line-height: 1.4; color: #626d79; }
body.ts2 #budgetTraceModal .work-budget-trace-pager button { min-height: 44px; margin: 0; padding: 0 12px; }
body.ts2 #budgetTraceModal .work-budget-trace-pager button:disabled { opacity: .45; cursor: default; }
@media (max-width: 767px) {
  body.ts2 #budgetTraceModal .work-budget-trace-sheet { padding: 16px; }
  body.ts2 #budgetTraceModal .work-budget-trace-head { gap: 10px; padding-bottom: 10px; }
  body.ts2 #budgetTraceModal .work-budget-trace-head h3 { font-size: 18px; line-height: 1.25; }
  body.ts2 #budgetTraceModal .work-budget-trace-head .icon-btn { flex: 0 0 44px; min-height: 44px; }
  body.ts2 #budgetTraceModal .work-budget-trace-summary { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin: 10px 0; }
  body.ts2 #budgetTraceModal .work-budget-trace-summary > div:last-child:nth-child(odd) { grid-column: 1 / -1; }
  body.ts2 #budgetTraceModal .work-budget-trace-summary > div { padding: 10px; }
}
body.ts2 #budgetTraceModal .work-budget-trace-head .icon-btn { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 44px; width: 44px; height: 44px; padding: 0; border: 1px solid #dfe3e8; border-radius: 8px; background: #fff; color: #374151; font-size: 24px; line-height: 1; }
body.ts2 #budgetTraceModal .work-budget-trace-summary > div:last-child:nth-child(odd) { grid-column: 1 / -1; }
body.ts2 #budgetTraceModal .work-budget-trace-pager button { border-radius: 8px !important; }
body.ts2 #budgetTraceModal .work-budget-order-row .btn { background: #18212b !important; color: #fff !important; border: 1px solid #18212b !important; border-radius: 6px !important; font-size: 12px; min-height: 36px; }
body.ts2 #budgetTraceModal button:focus-visible { outline: 2px solid #e95b29; outline-offset: 2px; }
@media (max-width: 767px) {
  body.ts2 #budgetTraceModal .work-budget-order-row .btn { min-height: 44px; }
}
