/* Compact search and filter controls, shared by desktop and mobile views. */
.filter-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 14px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.filter-search {
  display: flex;
  align-items: center;
  position: relative;
  flex: 1 1 160px;
  min-width: 0;
}
.filter-search > .icon {
  position: absolute;
  inset-inline-start: 11px;
  width: 16px;
  height: 16px;
  color: #8293ac;
  pointer-events: none;
}
.filter-search input {
  width: 100%;
  min-width: 0;
  height: 36px;
  border: 1px solid #e3e9f2;
  border-radius: 9px;
  background: #f8faff;
  color: var(--ink);
  padding: 7px 34px 7px 10px;
  font-size: 12px;
}
.filter-search input::placeholder { color: #98a4b6; }
.filter-search input:focus { background: #fff; border-color: #7da5ee; }
.filter-dates {
  display: flex;
  align-items: center;
  flex: 0 1 238px;
  gap: 7px;
  min-width: 215px;
  height: 36px;
  padding: 0 9px;
  border: 1px solid #e3e9f2;
  border-radius: 9px;
  background: #fff;
}
.filter-dates > .icon { width: 15px; height: 15px; color: #8394ae; }
.filter-dates label { display: flex; flex: 1; gap: 5px; align-items: center; min-width: 0; }
.filter-dates label > span { font-size: 10px; color: #8a98aa; }
.filter-dates input {
  border: 0;
  background: transparent;
  min-width: 0;
  width: 100%;
  padding: 4px 0;
  color: #55677f;
  text-align: center;
  direction: ltr;
  font-size: 11px;
}
.filter-dates input::placeholder { font-size: 10px; color: #a2adbd; }
.date-divider { height: 15px; width: 1px; background: #e7edf5; flex: none; }
.filter-toolbar .btn { height: 36px; min-height: 36px; padding: 7px 11px; font-size: 11px; gap: 6px; }
.filter-toolbar .btn > .icon { width: 16px; height: 16px; }
.filter-toggle { position: relative; color: #57708f; background: #f8faff; border-color: #e3e9f2; }
.filter-toggle[aria-expanded=true] { color: #2864d7; background: #edf3ff; border-color: #c9daf8; }
.filter-count { font-size: 10px; min-width: 18px; height: 18px; padding: 0 4px; background: #e5edfd; color: #2864d7; border-radius: 6px; line-height: 18px; }
.filter-toolbar .filter-reset { width: 34px; padding: 6px; color: #8b9ab0; background: transparent; border-color: transparent; }
.filter-reset:hover { background: #f2f5fb; color: #2864d7; }
.filter-advanced {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  align-items: end;
  flex: 1 0 100%;
  order: 6;
  gap: 10px;
  padding-top: 11px;
  margin-top: 3px;
  border-top: 1px solid #edf1f7;
}
.filter-advanced .field { margin: 0; min-width: 0; }
.filter-advanced .field label { margin-bottom: 4px; font-size: 10px; color: #7789a2; }
.filter-advanced .field select { height: 36px; min-height: 36px; padding: 6px 9px; font-size: 11px; border-color: #e3e9f2; border-radius: 9px; }
.filter-chips { display: flex; flex: 1 0 100%; order: 7; gap: 6px; min-width: 0; max-width: 100%; overflow-x: auto; scrollbar-width: thin; }
.filter-chip {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 5px;
  max-width: 230px;
  min-height: 27px;
  padding: 3px 8px;
  color: #58759e;
  background: #f0f5ff;
  border: 1px solid #e5edfc;
  border-radius: 7px;
  font-size: 10px;
}
.filter-chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filter-chip .icon { width: 12px; height: 12px; }
.filter-chip:hover { background: #e3edff; }
.filter-chip-date,.filter-chips-date-only { display: none; }

.content .filter-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  align-items: end;
  gap: 10px;
  padding: 12px 14px;
}
.content .filter-form .field { margin: 0; min-width: 0; }
.content .filter-form .field label { font-size: 10px; line-height: 1.3; margin-bottom: 4px; color: #7789a2; }
.content .filter-form .field input,.content .filter-form .field select { height: 36px; min-height: 36px; padding: 6px 10px; border-color: #e3e9f2; border-radius: 9px; font-size: 12px; }
.content .filter-form .btn { height: 36px; min-height: 36px; padding: 7px 12px; font-size: 11px; width: auto; margin: 0; }
.content #cashflow-filter { grid-template-columns: minmax(90px,.75fr) minmax(130px,1.1fr) minmax(120px,1.1fr) minmax(100px,.8fr) minmax(120px,1fr) auto; }
.cash-controls { margin: 14px 0; border-radius: 12px; }
.cash-controls > summary { display: flex; align-items: center; gap: 8px; padding: 10px 14px; min-height: 42px; list-style: none; }
.cash-controls > summary::-webkit-details-marker { display: none; }
.cash-controls > summary > .icon { width: 16px; height: 16px; }
.cash-filter-summary { color: #92a0b6; font-size: 10px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cash-filter-chevron { margin-inline-start: auto; transform: rotate(-90deg); }
.cash-controls[open] .cash-filter-chevron { transform: rotate(90deg); }
.content .cheque-filters { padding: 10px 14px; gap: 6px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; background: #fff; }
.cheque-filters .btn { flex: none; min-height: 34px; padding: 6px 11px; }

@media (max-width: 1250px) {
  .content #cashflow-filter { grid-template-columns: repeat(3, minmax(0,1fr)); }
}
@media (max-width: 1100px) {
  .filter-dates { display: none; order: 5; flex: 1 0 100%; min-width: 0; }
  .filter-toolbar[data-expanded=true] .filter-dates { display: flex; }
  .filter-toolbar[data-expanded=true] .filter-advanced { margin-top: 0; padding-top: 0; border-top: 0; }
  .filter-chip-date { display: inline-flex; }
  .filter-chips-date-only { display: flex; }
}
@media (max-width: 800px) {
  .filter-advanced { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .content .filter-form { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 650px) {
  .filter-toolbar { gap: 7px; padding: 10px 12px; }
  .filter-search { flex: 1 1 90px; }
  .filter-search input { height: 42px; font-size: 16px; padding-inline-start: 32px; }
  .filter-search input::placeholder { font-size: 12px; }
  .filter-toolbar .btn { min-width: 42px; height: 42px; min-height: 42px; padding: 9px; }
  .filter-search-submit > span,.filter-toggle-label { display: none; }
  .filter-toggle .filter-count { position: absolute; top: -4px; inset-inline-end: -3px; border: 2px solid white; height: 20px; line-height: 16px; }
  .filter-toolbar .filter-reset { width: 42px; min-width: 42px; }
  .filter-dates { height: 42px; padding: 0 10px; }
  .filter-dates input { font-size: 16px; }
  .filter-dates label > span { font-size: 11px; }
  .filter-advanced { gap: 10px 8px; }
  .filter-advanced .field label { font-size: 11px; }
  .filter-advanced .field select { height: 42px; min-height: 42px; font-size: 16px; }
  .filter-advanced > .btn { font-size: 12px; }
  .filter-chip { min-height: 32px; padding: 4px 8px; }
  .content .filter-form { gap: 10px 8px; padding: 10px 12px; }
  .content .filter-form .field label { font-size: 11px; line-height: 1.3; margin-bottom: 3px; }
  .content .filter-form .field input,.content .filter-form .field select { font-size: 16px; height: 42px; min-height: 42px; padding: 7px 8px; }
  .content .filter-form .btn { height: 42px; min-height: 42px; font-size: 12px; padding: 8px 10px; }
  .content #cashflow-filter { grid-template-columns: repeat(2, minmax(0,1fr)); }
  #statement-filter .field:first-child { grid-column: 1; grid-row: 1; }
  #statement-filter .field:nth-child(2) { grid-column: 1; grid-row: 2; }
  #statement-filter .field:nth-child(3) { grid-column: 2; grid-row: 2; }
  #statement-filter > .btn { grid-column: 2; grid-row: 1; }
  .cash-controls > summary { padding: 10px 12px; font-size: 11px; gap: 7px; }
  .cash-filter-summary { font-size: 9px; }
  .content .cheque-filters { padding: 9px 12px; }
  .cheque-filters .btn { min-height: 42px; font-size: 11px; }
}
@media print {
  .filter-toolbar,.content .filter-form,.cheque-filters,.cash-controls { display: none !important; }
}
