.filter-toolbar {
  grid-template-columns: minmax(280px, 1fr) minmax(150px, .28fr) minmax(175px, .32fr) auto auto auto;
  align-items: stretch;
}
.filter-toolbar > * { align-self: stretch; }
.filter-toolbar .view-mode-switch,
.filter-toolbar .clear-button,
.filter-toolbar .new-request-button { height: 40px; }
.filter-toolbar .view-mode-switch { align-items: center; }
.quick-action-row { justify-content: flex-start; }
.quick-filters button.active {
  color: #fff !important;
  background: linear-gradient(135deg, #ef4444, #dc2626) !important;
  border-color: #b91c1c !important;
  box-shadow: 0 7px 18px rgba(220,38,38,.26);
}
.quick-filters button.active:hover { background: linear-gradient(135deg, #dc2626, #b91c1c) !important; }
.clear-button {
  box-shadow: 0 7px 18px rgba(37,99,235,.18);
  border: 1px solid rgba(37,99,235,.18);
}
.new-request-button {
  white-space: nowrap;
  box-shadow: 0 9px 22px rgba(124,58,237,.3) !important;
}
.clear-button:hover,
.new-request-button:hover { transform: translateY(-1px); }
.demand-locked-input {
  color: #40516a;
  font-weight: 800;
  background: #edf1f6 !important;
  border-color: #d2dae5 !important;
  cursor: not-allowed;
}
.confirm-demand-button { box-shadow: 0 7px 17px rgba(20,115,230,.2); }
.append-demand-button {
  color: #fff;
  background: #6d4bd1;
  box-shadow: 0 6px 15px rgba(109,75,209,.22);
}
.append-demand-button:hover { background: #5635b8; }
.change-demand-button {
  color: #556277;
  background: #edf1f6;
  border: 1px solid #d5dde8;
}
.change-demand-button:hover { color: #fff; background: #6b7280; }
.change-demand-button:disabled {
  color: #9a6700;
  background: #fff7db;
  border-color: #f3d77b;
  cursor: not-allowed;
}
.demand-locked-status { color: #49627b; }
.order-form:has(.demand-locked-input) {
  grid-template-columns: minmax(0,1fr) auto auto;
}
.order-form:has(.demand-locked-input) label { grid-column: 1 / -1; }
.order-form:has(.demand-locked-input) .note-button { grid-column: 1 / 2; }
.order-form:has(.demand-locked-input) .save-status { grid-column: 1 / -1; }
.table-actions .append-demand-button,
.table-actions .change-demand-button { min-height: 34px; padding: 6px 10px; white-space: nowrap; }
.table-demand-subline {
  display: block;
  max-width: 150px;
  margin-top: 5px;
  font-size: 11px;
  line-height: 1.3;
  color: #7a5a00;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.table-demand-subline:empty { display: none; }
.table-pending-change::before {
  content: "待確認 · ";
  font-weight: 800;
  color: #a16207;
}
#appendDemandSummary,
#changeDemandSummary { padding: 10px 12px; border-radius: 10px; background: #f2f5f9; }
@media (max-width: 1180px) {
  .filter-toolbar { grid-template-columns: minmax(260px,1fr) minmax(145px,.35fr) minmax(170px,.4fr) auto auto; }
  .new-request-button { grid-column: 1 / -1; justify-self: end; width: auto; }
}
@media (max-width: 760px) {
  .filter-toolbar { display: grid; grid-template-columns: 1fr; }
  .filter-toolbar .new-request-button,
  .filter-toolbar .clear-button { width: 100%; }
  .new-request-button { grid-column: auto; }
  .order-form:has(.demand-locked-input) { grid-template-columns: 1fr 1fr; }
  .order-form:has(.demand-locked-input) .note-button { grid-column: 1 / -1; }
}