label {
  display: grid;
  gap: 7px;
  color: #42506a;
  font-size: 12px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  padding: 10px 12px;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

textarea {
  height: 72px;
  min-height: 72px;
  resize: none;
  line-height: 1.5;
}

input::placeholder,
textarea::placeholder {
  color: #9aa6b8;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.toolbar {
  display: grid;
  gap: 10px;
}

.actions,
.dialog-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.primary-button,
.ghost-button,
.add-card-button {
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 850;
  transition: transform 120ms ease, background 160ms ease, color 160ms ease, opacity 160ms ease;
}

.primary-button {
  flex: 1;
  background: var(--blue);
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.22);
}

.secondary-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: #344154;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 850;
}

.refresh-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 42px;
  width: 42px;
  min-width: 42px;
  max-width: 42px;
  height: 42px;
  min-height: 42px;
  max-height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #ffffff;
  color: var(--blue);
  padding: 0;
  line-height: 1;
  cursor: pointer;
}

.refresh-icon-button:hover,
.refresh-icon-button:focus-visible {
  border-color: #bfdbfe;
  background: var(--blue-soft);
}

.refresh-icon-button:disabled {
  cursor: not-allowed;
  opacity: .58;
}

.refresh-icon-button .menu-svg-icon {
  display: block;
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
}

.refresh-icon-button .is-spinning {
  animation: refresh-spin 900ms linear infinite;
}

@keyframes refresh-spin {
  to {
    transform: rotate(360deg);
  }
}

.panel-header .primary-button,
.panel-header .secondary-button,
.panel-header .db-summary > button,
.panel-header .stats > button {
  flex: 0 0 auto;
  min-height: 42px;
  border-radius: 9px;
  padding-inline: 18px;
  font-weight: 900;
}

.panel-header .refresh-icon-button,
.panel-header .db-summary > .refresh-icon-button,
.panel-header .stats > .refresh-icon-button {
  flex: 0 0 42px;
  width: 42px;
  min-width: 42px;
  max-width: 42px;
  height: 42px;
  min-height: 42px;
  max-height: 42px;
  padding: 0;
}

.list-sort-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  font: inherit;
  text-align: left;
}

.list-sort-button:hover,
.list-sort-button.active {
  color: var(--blue);
}

.list-sort-button span {
  color: currentColor;
  font-size: 11px;
  font-weight: 900;
}

.resizable-header-cell {
  position: relative;
}

.resizable-header-content {
  min-width: 0;
  padding-right: 8px;
}

.column-resize-handle {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  width: 12px;
  cursor: col-resize;
}

.column-resize-handle::after {
  position: absolute;
  top: 8px;
  right: 2px;
  bottom: 8px;
  width: 2px;
  border-radius: 999px;
  background: var(--blue);
  content: "";
  opacity: 0;
  transition: opacity 0.12s ease;
}

.resizable-header-cell:hover .column-resize-handle::after,
.resizable-header-cell.is-column-resizing .column-resize-handle::after,
.column-resize-handle:hover::after {
  opacity: 1;
}

.is-resizing-column {
  cursor: col-resize;
  user-select: none;
}

.compact-action {
  flex: 0 0 auto;
  min-height: 38px;
  padding-inline: 18px;
}

.primary-button:hover,
.ghost-button:hover,
.add-card-button:hover,
.view-switch button:hover {
  transform: translateY(-1px);
}

.ghost-button {
  background: #eef3f9;
  color: #26354f;
}

.toolbar {
  grid-template-columns: minmax(220px, 1fr) 160px 230px;
  align-items: end;
  margin-bottom: 14px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.toolbar-field {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.toolbar-field span {
  padding-left: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  line-height: 1;
}

.toolbar-field input,
.toolbar-field select {
  padding-left: 14px;
}

select {
  appearance: none;
  background-color: #ffffff;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 12 12' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' fill='none' stroke='%2336475f' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: right 12px center;
  background-repeat: no-repeat;
  background-size: 12px;
  padding-right: 34px;
}

select:hover {
  border-color: #b8c9df;
  background-color: #fbfdff;
}

.custom-select {
  position: relative;
  min-width: 0;
}

.custom-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  color: var(--text);
  padding: 0 11px 0 14px;
  font-size: 13px;
  font-weight: 850;
  text-align: left;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02);
}

.custom-select .custom-select-trigger span {
  overflow: hidden;
  min-width: 0;
  color: inherit;
  padding: 0;
  font-size: inherit;
  font-weight: inherit;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-select-trigger b {
  display: grid;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 999px;
  background: #eef4fb;
  color: #42526d;
  font-size: 13px;
  font-weight: 950;
  line-height: 1;
}

.custom-select-trigger:hover,
.custom-select.is-open .custom-select-trigger {
  border-color: #b8c9df;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.custom-select-trigger:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.custom-select-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  z-index: 120;
  display: grid;
  gap: 4px;
  max-height: min(280px, 48vh);
  overflow: auto;
  border: 1px solid rgba(191, 203, 219, 0.96);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  padding: 6px;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(12px);
}

.custom-select-group {
  display: grid;
  gap: 3px;
}

.custom-select-group p {
  margin: 4px 7px 2px;
  color: var(--faint);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.custom-select-menu button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 34px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  padding: 0 9px;
  font-size: 13px;
  font-weight: 800;
  text-align: left;
}

.custom-select-menu button:hover,
.custom-select-menu button.active {
  background: #edf5ff;
  color: var(--blue);
}

.custom-select .custom-select-menu button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-select-menu button strong {
  color: var(--blue);
  font-size: 12px;
  font-weight: 950;
}

.search {
  min-width: 0;
}

.view-switch {
  display: grid;
  grid-auto-columns: minmax(58px, max-content);
  grid-auto-flow: column;
  min-height: 42px;
  padding: 3px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #ffffff;
}

.view-switch button {
  min-width: 0;
  white-space: nowrap;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.view-switch button.active {
  background: #172033;
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(23, 32, 51, 0.16);
}

@media (max-width: 880px) {
  .toolbar {
    grid-template-columns: 1fr;
  }
}

.custom-select-trigger b,
.project-switcher-button b,
.project-field-trigger b {
  display: inline-grid;
  width: 18px;
  height: 18px;
  place-items: center;
  font-size: 0;
  line-height: 1;
}

.custom-select-trigger b::before,
.project-switcher-button b::before,
.project-field-trigger b::before {
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  content: "";
  transform: rotate(45deg) translate(-1px, -1px);
}

.custom-select-trigger[aria-expanded="true"] b::before,
.project-switcher-button[aria-expanded="true"] b::before,
.project-field-trigger[aria-expanded="true"] b::before {
  transform: rotate(225deg) translate(-1px, -1px);
}
