/* Shared UI primitives (BaseBasicButton, BaseInput, BaseDetailedSearch, toolbar) */

.bb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 100px;
  min-height: 40px;
  padding: 6px 15px;
  border: 0;
  border-radius: var(--radius-5);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  color: var(--gray-10);
  background-color: var(--brand-primary);
  box-shadow: var(--shadow-md);
  cursor: pointer;
}

.bb-btn.md-2 {
  width: fit-content;
  min-width: 0;
  height: 48px;
  min-height: 48px;
  padding: 0 20px;
  font-size: 16px;
  font-weight: 700;
}

.bb-btn.gray {
  color: var(--gray-10);
  background-color: var(--gray-5);
  box-shadow: var(--shadow-md);
}

.bb-btn.gray-outlined {
  color: var(--gray-5);
  background-color: var(--white);
  border: 1px solid var(--gray-6);
  box-shadow: none;
  font-weight: 700;
}

.bb-btn.gray-outlined.md-2 {
  height: 48px;
  min-height: 48px;
  padding: 0 20px;
  font-size: 16px;
}

.bb-btn.sm-2 {
  width: fit-content;
  min-width: fit-content;
  height: 38px;
  min-height: 38px;
  padding: 0 16px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.bb-btn.gray-outlined.sm-2 {
  font-weight: 600;
}

.bb-btn.primary-outlined {
  color: var(--brand-primary);
  background-color: var(--white);
  border: 1px solid var(--brand-primary);
  box-shadow: none;
}

.bb-btn.primary-outlined:hover {
  background-color: var(--green-9);
}

.bb-btn.primary-outlined:active {
  background-color: var(--green-10);
  color: var(--brand-primary);
  border-color: var(--green-5);
}

.bb-btn.primary-outlined:disabled {
  background-color: var(--green-10);
  color: var(--green-5);
  border-color: var(--green-5);
  opacity: 0.7;
  cursor: not-allowed;
}

.bb-btn.dark-outlined {
  color: var(--gray-2);
  background-color: var(--white);
  border: 1px solid var(--gray-2);
  box-shadow: none;
}

.bb-btn.dark-outlined:hover {
  background-color: var(--gray-7);
}

.bb-btn.dark-outlined:active {
  background-color: var(--gray-2);
  color: var(--white);
}

.bb-btn:not(.gray):not(.gray-outlined):not(.primary-outlined):not(.dark-outlined):hover {
  background-color: var(--green-4);
}

.bb-btn:not(.gray):not(.gray-outlined):not(.primary-outlined):not(.dark-outlined):active {
  background-color: var(--green-3);
}

.bb-btn.gray:hover {
  background-color: var(--gray-4);
}

.bb-btn.gray:active {
  background-color: var(--gray-3);
}

.bb-btn.gray-outlined:active {
  background-color: var(--gray-7);
  color: var(--gray-3);
}

.demo-input,
.demo-select {
  width: 500px;
  max-width: 100%;
  height: 48px;
  padding: 0 16px;
  border: 1px solid var(--dts-border-color);
  border-radius: var(--radius-5);
  background: var(--white);
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 400;
  line-height: 20px;
  box-shadow: var(--inset-shadow-sm);
}

.demo-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23707070' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
  cursor: pointer;
}

.demo-input::placeholder {
  color: var(--dts-placeholder-color);
  font-size: 16px;
  font-weight: 400;
}

.demo-select--compact {
  width: 240px;
}

.filter-btn-fixed {
  width: 100%;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
  justify-content: flex-start;
}

.icon-square-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid var(--gray-6);
  border-radius: var(--radius-5);
  background: var(--white);
  box-shadow: var(--shadow-sm);
  color: var(--gray-2);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.icon-square-btn:hover:not(:disabled) {
  background: var(--gray-7);
}

.icon-square-btn:active:not(:disabled) {
  background: var(--gray-6);
}

.icon-square-btn.is-open {
  border-color: var(--brand-primary);
  color: var(--black-2);
}

.icon-square-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  border-color: var(--gray-6);
  color: var(--gray-5);
}

.icon-square-btn img,
.icon-square-btn svg {
  width: 20px;
  height: 20px;
  display: block;
}

.icon-square-btn--delete {
  color: var(--gray-2);
}

.icon-square-btn--delete img,
.icon-square-btn--delete svg {
  width: 24px;
  height: 24px;
}

.search-trigger .pi-search {
  color: var(--gray-2);
}

.search-trigger.is-open .pi-search {
  color: var(--black-2);
}

/* BaseTextarea.vue 相当 */
.base-textarea {
  width: 100%;
  min-height: 126px;
  border: 1px solid var(--dts-border-color);
  border-radius: var(--radius-5);
  padding: 12px 16px;
  background: var(--white);
  font-size: 14px;
  line-height: 16px;
  font-weight: 500;
  color: var(--text-primary);
  box-shadow: var(--inset-shadow-sm);
  resize: vertical;
  outline: none;
  transition:
    background-color 0.15s ease-in-out,
    border-color 0.25s ease-in;
}

.base-textarea::placeholder {
  color: var(--dts-placeholder-color);
}

.base-textarea:hover {
  border-color: var(--brand-primary);
  background-color: var(--gray-9);
}

.base-textarea:focus {
  border-color: var(--brand-primary);
  background-color: var(--white);
  box-shadow: var(--inset-shadow-md);
}

/* カスタムチェックボックス（スライド一覧 .ck-* 準拠） */
.ck-root {
  position: relative;
  display: inline-flex;
  width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ck-input {
  position: absolute;
  inset: 0;
  z-index: 1;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.ck-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding-bottom: 2px;
  border: 2px solid var(--gray-7);
  border-radius: 4px;
  background: var(--white);
  box-sizing: border-box;
  pointer-events: none;
}

.ck-mark {
  width: 12px;
  height: 6px;
  border-bottom: 3px solid var(--gray-10);
  border-left: 3px solid var(--gray-10);
  opacity: 0;
  transform: rotate(-45deg) scale(0);
}

.ck-input:checked + .ck-box {
  border-color: var(--brand-primary);
  background: var(--brand-primary);
}

.ck-input:checked + .ck-box .ck-mark {
  opacity: 1;
  transform: rotate(-45deg) scale(1);
}
