/* Override 6-column grid from main bundle (9 toolbar items were wrapping/stacked). */
.todo-toolbar .todo-bulkbar {
  display: inline-flex !important;
  grid-template-columns: none !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  width: auto !important;
  max-width: min(100%, 520px);
}

.todo-toolbar {
  flex-wrap: nowrap !important;
  align-items: center;
  gap: 12px;
  overflow: visible;
}

.todo-toolbar input {
  min-width: 160px;
}

.todo-toolbar-hint-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 1 auto;
  min-width: 0;
}

.todo-toolbar-hint {
  color: #8b98a8;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.todo-toolbar .todo-select-all-button,
.todo-board-dark .todo-toolbar .todo-select-all-button {
  min-height: 36px;
  height: 36px;
  padding: 0 12px;
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 900;
  color: #25384a !important;
  background: #fff !important;
  border: 1px solid #dbe6f0 !important;
  border-radius: 10px;
  box-shadow: none !important;
}

.todo-toolbar .todo-select-all-button:hover,
.todo-board-dark .todo-toolbar .todo-select-all-button:hover {
  color: #172437 !important;
  background: #f8fafc !important;
  border-color: #cfd9e4 !important;
}

.todo-bulkbar {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  width: auto !important;
  min-height: 40px;
  height: 40px;
  padding: 3px 4px 3px 12px;
  overflow: visible;
  color: #172437;
  background: #fff !important;
  border: 1px solid #d9e4ef !important;
  border-radius: 12px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, .08);
}

.todo-bulkbar > strong {
  color: #172437 !important;
  font-size: 13px;
  font-weight: 950;
  white-space: nowrap;
}

/* Legacy inline bulk buttons stay hidden — only the dropdown is shown. */
.todo-bulkbar > button:not(:last-of-type):not(.regab-todo-bulk-toggle) {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  border: 0 !important;
  box-shadow: none !important;
  pointer-events: none !important;
  opacity: 0 !important;
}

.todo-bulkbar > .regab-todo-bulk-anchor,
.todo-bulkbar > .todo-bulk-menu-anchor {
  flex: 0 0 auto;
}

.todo-bulkbar.regab-todo-bulkbar-compact > .regab-todo-bulk-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  border: 0 !important;
  box-shadow: none !important;
  pointer-events: none !important;
}

.todo-bulk-menu-anchor,
.regab-todo-bulk-anchor {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

.todo-toolbar .todo-bulk-toggle,
.todo-toolbar .todo-bulk-clear,
.regab-todo-bulk-toggle,
.todo-bulkbar.regab-todo-bulkbar-compact > button:last-of-type {
  min-height: 32px !important;
  height: 32px !important;
  padding: 0 10px !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 900;
  color: #25384a !important;
  background: #f8fafc !important;
  border: 1px solid #dbe6f0 !important;
  border-radius: 9px !important;
  box-shadow: none !important;
  outline: none !important;
  cursor: pointer;
  white-space: nowrap;
}

.todo-toolbar .todo-bulk-clear,
.todo-bulkbar.regab-todo-bulkbar-compact > button:last-of-type {
  width: 32px !important;
  padding: 0 !important;
  position: static !important;
  clip: auto !important;
  overflow: visible !important;
  pointer-events: auto !important;
  transform: none !important;
}

.todo-toolbar .todo-bulk-toggle:hover,
.regab-todo-bulk-toggle:hover,
.todo-toolbar .todo-bulk-clear:hover,
.todo-bulkbar.regab-todo-bulkbar-compact > button:last-of-type:hover,
.regab-todo-bulk-toggle[aria-expanded="true"],
.todo-toolbar .todo-bulk-toggle[aria-expanded="true"] {
  color: #172437 !important;
  border-color: #cfd9e4 !important;
  background: #f1f5f9 !important;
}

.todo-toolbar .todo-bulk-toggle:focus-visible,
.regab-todo-bulk-toggle:focus-visible {
  box-shadow: 0 0 0 2px rgba(36, 75, 112, .22) !important;
}

.regab-todo-bulk-toggle::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: .65;
}

.todo-bulk-menu,
.regab-todo-bulk-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: auto;
  z-index: 160;
  width: 228px;
  max-width: calc(100vw - 24px);
  padding: 8px;
  display: grid;
  gap: 6px;
  color: #24364a;
  background: rgba(255,255,255,.98);
  border: 1px solid #d9e4ef;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .16);
}

.todo-toolbar .todo-bulk-menu button,
.regab-todo-bulk-menu button {
  display: flex !important;
  width: 100% !important;
  box-sizing: border-box;
  min-height: 36px !important;
  height: 36px !important;
  padding: 0 12px !important;
  justify-content: flex-start !important;
  align-items: center !important;
  gap: 10px !important;
  font-size: 13px;
  font-weight: 900;
  color: #25384a !important;
  background: #f8fafc !important;
  border: 1px solid #dbe6f0 !important;
  border-radius: 10px !important;
  box-shadow: none !important;
  cursor: pointer;
}

.todo-toolbar .todo-bulk-menu button svg,
.regab-todo-bulk-menu button svg {
  width: 16px !important;
  height: 16px !important;
  min-width: 16px !important;
  min-height: 16px !important;
  flex: 0 0 16px !important;
  padding: 0 !important;
  margin: 0 !important;
  background: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  fill: none !important;
  stroke: currentColor !important;
  color: inherit !important;
}

.todo-toolbar .todo-bulk-menu button:hover,
.regab-todo-bulk-menu button:hover {
  color: #172437 !important;
  border-color: #cfd9e4 !important;
  background: #eef2f6 !important;
}

.todo-toolbar .todo-bulk-menu button.danger,
.regab-todo-bulk-menu button.danger {
  width: 100% !important;
  color: #c91925 !important;
  border-color: #f3c4c8 !important;
  background: #fff5f5 !important;
}

.todo-toolbar .todo-bulk-menu button.danger:hover,
.regab-todo-bulk-menu button.danger:hover {
  color: #a40f19 !important;
  border-color: #e8a0a6 !important;
  background: #ffe9ea !important;
}

.regab-todo-bulk-menu[hidden] {
  display: none !important;
}

body.theme-dark .todo-toolbar .todo-select-all-button,
html.theme-dark .todo-toolbar .todo-select-all-button,
body.theme-dark .todo-board-dark .todo-toolbar .todo-select-all-button,
html.theme-dark .todo-board-dark .todo-toolbar .todo-select-all-button {
  color: #dbeafe !important;
  background: #0b1e31 !important;
  border-color: #244b70 !important;
}

body.theme-dark .todo-toolbar .todo-select-all-button:hover,
html.theme-dark .todo-toolbar .todo-select-all-button:hover {
  color: #ffffff !important;
  background: #143657 !important;
  border-color: #3d6a9a !important;
}

body.theme-dark .todo-bulkbar,
html.theme-dark .todo-bulkbar {
  color: #edf6ff;
  background: #10283d !important;
  border-color: #244b70 !important;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .28);
}

body.theme-dark .todo-bulkbar > strong,
html.theme-dark .todo-bulkbar > strong {
  color: #edf6ff !important;
}

body.theme-dark .todo-toolbar .todo-bulk-toggle,
body.theme-dark .todo-toolbar .todo-bulk-clear,
body.theme-dark .regab-todo-bulk-toggle,
body.theme-dark .todo-bulkbar.regab-todo-bulkbar-compact > button:last-of-type,
html.theme-dark .todo-toolbar .todo-bulk-toggle,
html.theme-dark .todo-toolbar .todo-bulk-clear,
html.theme-dark .regab-todo-bulk-toggle,
html.theme-dark .todo-bulkbar.regab-todo-bulkbar-compact > button:last-of-type,
body.theme-dark .regab-todo-bulk-toggle[aria-expanded="true"],
body.theme-dark .todo-toolbar .todo-bulk-toggle[aria-expanded="true"],
html.theme-dark .regab-todo-bulk-toggle[aria-expanded="true"],
html.theme-dark .todo-toolbar .todo-bulk-toggle[aria-expanded="true"],
body.theme-dark .todo-toolbar .todo-bulk-toggle:hover,
body.theme-dark .regab-todo-bulk-toggle:hover,
body.theme-dark .todo-toolbar .todo-bulk-clear:hover,
html.theme-dark .todo-toolbar .todo-bulk-toggle:hover,
html.theme-dark .regab-todo-bulk-toggle:hover,
html.theme-dark .todo-toolbar .todo-bulk-clear:hover {
  color: #dbeafe !important;
  background: #0b1e31 !important;
  border-color: #244b70 !important;
}

body.theme-dark .todo-bulk-menu,
body.theme-dark .regab-todo-bulk-menu,
html.theme-dark .todo-bulk-menu,
html.theme-dark .regab-todo-bulk-menu {
  color: #edf6ff;
  background: #10283d;
  border-color: #244b70;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .42);
}

body.theme-dark .todo-toolbar .todo-bulk-menu button,
body.theme-dark .regab-todo-bulk-menu button,
html.theme-dark .todo-toolbar .todo-bulk-menu button,
html.theme-dark .regab-todo-bulk-menu button {
  color: #dbeafe !important;
  background: #0b1e31 !important;
  border-color: #244b70 !important;
}

body.theme-dark .todo-toolbar .todo-bulk-menu button:hover,
body.theme-dark .regab-todo-bulk-menu button:hover,
html.theme-dark .todo-toolbar .todo-bulk-menu button:hover,
html.theme-dark .regab-todo-bulk-menu button:hover {
  color: #fff !important;
  background: #143657 !important;
  border-color: #3d6a9a !important;
}

body.theme-dark .todo-toolbar .todo-bulk-menu button.danger,
body.theme-dark .regab-todo-bulk-menu button.danger,
html.theme-dark .todo-toolbar .todo-bulk-menu button.danger,
html.theme-dark .regab-todo-bulk-menu button.danger {
  color: #ff8a96 !important;
  border-color: rgba(239, 23, 40, .45) !important;
  background: rgba(239, 23, 40, .16) !important;
}

body.theme-dark .todo-toolbar .todo-bulk-menu button.danger:hover,
body.theme-dark .regab-todo-bulk-menu button.danger:hover,
html.theme-dark .todo-toolbar .todo-bulk-menu button.danger:hover,
html.theme-dark .regab-todo-bulk-menu button.danger:hover {
  color: #ffb3ba !important;
  background: rgba(239, 23, 40, .24) !important;
}

@media (max-width: 1100px) {
  .todo-toolbar-hint {
    display: none;
  }
}

@media (max-width: 900px) {
  .todo-toolbar-hint-row,
  .todo-bulkbar {
    align-self: flex-end;
  }
}
