:root {
  --button-height-small: 30px;
  --button-height: 34px;
  --button-height-large: 38px;
  --button-radius: 8px;
  --button-gap: 6px;
  --button-padding-inline: 12px;
}

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

input:not([type]),
input:is(
  [type="text"],
  [type="search"],
  [type="email"],
  [type="password"],
  [type="tel"],
  [type="url"],
  [type="number"],
  [type="datetime-local"],
  [type="month"],
  [type="week"],
  [type="time"]
),
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;
}

input:is([type="checkbox"], [type="radio"]) {
  width: 16px;
  height: 16px;
  min-height: 0;
  margin: 0;
  padding: 0;
  accent-color: var(--blue);
}

input[type="range"] {
  width: 100%;
  min-height: 0;
  margin: 0;
  padding: 0;
  accent-color: var(--blue);
}

input[type="color"] {
  width: 44px;
  height: 32px;
  min-height: 0;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  padding: 3px;
}

input[type="file"] {
  width: 100%;
  min-height: 76px;
  border: 1px dashed #aebed2;
  border-radius: 10px;
  background: #f8fafc;
  margin: 0;
  padding: 14px;
  color: var(--muted);
  cursor: copy;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

input[type="file"]:hover,
input[type="file"]:focus-visible {
  border-color: var(--blue);
  background: var(--blue-soft);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .1);
  outline: none;
}

input[type="file"]::file-selector-button {
  height: 34px;
  margin-right: 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #334155;
  padding: 0 12px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

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

input::placeholder,
textarea::placeholder,
.custom-select .custom-select-trigger > span.is-placeholder,
.custom-select .custom-select-menu button > span.is-placeholder,
.app-inline-picklist-trigger > span.is-placeholder,
.app-inline-picklist-options > button > span.is-placeholder,
select:has(option[data-placeholder]:checked),
select option[data-placeholder] {
  color: #9aa6b8;
}

select:has(option[data-placeholder]:checked) option:not([data-placeholder]) {
  color: var(--text);
}

input:not([type]):focus,
input:is(
  [type="text"],
  [type="search"],
  [type="email"],
  [type="password"],
  [type="tel"],
  [type="url"],
  [type="number"],
  [type="datetime-local"],
  [type="month"],
  [type="week"],
  [type="time"]
):focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

input:is([type="checkbox"], [type="radio"], [type="range"]):focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.app-date-picker-input {
  position: relative;
  display: grid;
  width: 100%;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr);
}

.app-date-picker-input > :where(input, .app-date-picker-trigger) {
  grid-column: 1;
  grid-row: 1;
}

.app-date-picker-input.app-date-picker-input > input {
  width: 100%;
  min-width: 0;
  padding-right: 42px;
}

.app-date-picker-input > .app-date-picker-trigger {
  z-index: 2;
  display: grid;
  width: 36px;
  height: 100%;
  align-items: center;
  justify-self: end;
  justify-content: end;
  margin-right: 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #52647b;
  padding: 0;
  cursor: pointer;
}

.app-date-picker-trigger > .menu-svg-icon {
  width: 15px;
  height: 15px;
}

.app-date-picker-trigger:focus-visible,
.app-date-picker-input.is-open > .app-date-picker-trigger {
  background: #edf4ff;
  color: var(--blue);
}

.app-date-picker-trigger:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.28);
  outline-offset: -4px;
}

.app-date-picker-trigger:disabled {
  color: #94a3b8;
  cursor: default;
  opacity: 0.7;
}

.app-date-picker-popover {
  position: fixed;
  z-index: 5400;
  box-sizing: border-box;
  width: min(288px, calc(100vw - 16px));
  border: 1px solid rgba(181, 199, 220, 0.92);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
  color: var(--text);
  padding: 10px;
  box-shadow: 0 20px 48px rgba(31, 45, 68, 0.2), 0 3px 10px rgba(31, 45, 68, 0.08);
  backdrop-filter: blur(12px);
}

.app-date-picker-popover > header {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 32px;
  align-items: center;
  gap: 6px;
  margin-bottom: 7px;
}

.app-date-picker-popover > header strong {
  color: #1e293b;
  font-size: 13px;
  font-weight: 850;
  text-align: center;
}

.app-date-picker-popover button {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.app-date-picker-popover > header button {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 9px;
  color: #52647b;
  font-size: 22px;
  line-height: 1;
}

.app-date-picker-popover > header > .app-date-picker-month-trigger {
  display: inline-flex;
  width: auto;
  height: 32px;
  align-items: center;
  justify-content: center;
  justify-self: center;
  gap: 5px;
  padding: 0 9px;
  font-size: inherit;
}

.app-date-picker-month-trigger > .menu-svg-icon {
  width: 10px;
  height: 10px;
  color: #718096;
}

.app-date-picker-popover > header button:hover,
.app-date-picker-popover > header button:focus-visible {
  background: #edf4ff;
  color: var(--blue);
  outline: none;
}

.app-date-picker-month-selector {
  display: grid;
  gap: 10px;
  padding: 5px 2px 4px;
}

.app-date-picker-year-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 8px;
}

.app-date-picker-year-row > span {
  color: #718096;
  font-size: 10px;
  font-weight: 800;
  line-height: 34px;
}

.app-date-picker-year-select {
  display: grid;
  gap: 4px;
  width: 100%;
  min-width: 0;
}

.app-date-picker-year-field {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) 26px;
  align-items: center;
  height: 34px;
  border: 1px solid #cad6e4;
  border-radius: 8px;
  background: #ffffff;
  color: #27364a;
  padding-left: 8px;
}

.app-date-picker-year-field:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.app-date-picker-year-field > .menu-svg-icon {
  width: 13px;
  height: 13px;
  color: #7b8ba0;
}

.app-date-picker-popover .app-date-picker-year-field > input {
  appearance: none;
  align-self: center;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 0;
  height: 32px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #27364a;
  padding: 0 6px;
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  line-height: 32px;
  box-shadow: none;
}

.app-date-picker-popover .app-date-picker-year-field > input::-webkit-search-cancel-button {
  display: none;
}

.app-date-picker-popover .app-date-picker-year-field > input:focus {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  outline: none;
}

.app-date-picker-year-field > button {
  display: grid;
  width: 26px;
  height: 32px;
  place-items: center;
  border-radius: 7px;
  color: #718096;
}

.app-date-picker-year-field > button:hover,
.app-date-picker-year-field > button:focus-visible {
  background: #edf4ff;
  color: var(--blue);
  outline: none;
}

.app-date-picker-year-field > button > .menu-svg-icon {
  width: 9px;
  height: 9px;
}

.app-date-picker-year-options {
  display: grid;
  height: 128px;
  align-content: start;
  overflow-y: auto;
  border: 1px solid #d5dfeb;
  border-radius: 8px;
  background: #ffffff;
  padding: 3px;
  box-shadow: 0 9px 20px rgba(31, 45, 68, 0.12);
}

.app-date-picker-year-options > button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  width: 100%;
  height: 29px;
  align-items: center;
  gap: 8px;
  border-radius: 6px;
  padding: 0 7px;
  text-align: left;
}

.app-date-picker-year-options > button:hover,
.app-date-picker-year-options > button:focus-visible {
  background: #edf4ff;
  color: var(--blue);
  outline: none;
}

.app-date-picker-year-options > button.is-selected {
  background: #e7f0ff;
  color: var(--blue);
}

.app-date-picker-year-options > button > strong {
  font-size: 11px;
  font-weight: 850;
}

.app-date-picker-year-options > button > span {
  overflow: hidden;
  color: #718096;
  font-size: 10px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-date-picker-year-empty {
  color: #8996a8;
  padding: 18px 8px;
  font-size: 11px;
  text-align: center;
}

.app-date-picker-month-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}

.app-date-picker-month-options > button {
  height: 34px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #f7f9fc;
  color: #43536a;
  font-size: 12px;
  font-weight: 750;
}

.app-date-picker-month-options > button:hover,
.app-date-picker-month-options > button:focus-visible {
  border-color: rgba(37, 99, 235, 0.2);
  background: #edf4ff;
  color: var(--blue);
  outline: none;
}

.app-date-picker-month-options > button.is-selected {
  border-color: var(--blue);
  background: #edf4ff;
  color: var(--blue);
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.08);
}

.app-date-picker-weekdays,
.app-date-picker-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 3px;
}

.app-date-picker-weekdays {
  margin-bottom: 3px;
}

.app-date-picker-weekdays > span {
  color: #7a889a;
  font-size: 10px;
  font-weight: 750;
  line-height: 24px;
  text-align: center;
}

.app-date-picker-days > button {
  display: grid;
  width: 100%;
  height: 33px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 9px;
  color: #334155;
  font-size: 12px;
  font-weight: 650;
  transition: border-color 0.14s ease, background 0.14s ease, color 0.14s ease, transform 0.14s ease;
}

.app-date-picker-days > button:hover,
.app-date-picker-days > button:focus-visible {
  border-color: rgba(37, 99, 235, 0.18);
  background: #edf4ff;
  color: var(--blue);
  outline: none;
  transform: translateY(-1px);
}

.app-date-picker-days > button.is-outside {
  color: #a7b2c1;
}

.app-date-picker-days > button.is-today {
  border-color: #9bbce5;
  color: #245c9f;
}

.app-date-picker-days > button.is-selected {
  border-color: var(--blue);
  background: linear-gradient(135deg, #3177d4 0%, #245fb2 100%);
  color: #ffffff;
  box-shadow: 0 5px 12px rgba(37, 99, 235, 0.25);
}

.app-date-picker-days > button:disabled {
  color: #c7d0dc;
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.app-date-time-picker-popover {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 136px;
  column-gap: 14px;
  width: min(460px, calc(100vw - 16px));
}

.app-date-time-picker-popover > header { grid-column: 1; grid-row: 1; }
.app-date-time-picker-popover > .app-date-picker-month-selector { grid-column: 1; grid-row: 2 / 4; }
.app-date-time-picker-popover > .app-date-picker-weekdays { grid-column: 1; grid-row: 2; }
.app-date-time-picker-popover > .app-date-picker-days { grid-column: 1; grid-row: 3; }
.app-date-time-picker-popover > footer { grid-column: 1 / -1; grid-row: 4; }

.app-date-time-picker-time {
  display: grid;
  grid-column: 2;
  grid-row: 1 / 4;
  align-content: start;
  gap: 16px;
  border-left: 1px solid #e8edf4;
  padding: 8px 0 0 12px;
}

.app-date-time-picker-time-heading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: #52647b;
  font-size: 12px;
  font-weight: 600;
}

.app-date-time-picker-time-heading > .menu-svg-icon {
  width: 16px;
  height: 16px;
  color: #6c83a2;
}

.app-date-time-picker-wheels {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: end;
  gap: 4px;
}

.app-time-wheel-field { min-width: 0; text-align: center; }
.app-time-wheel-label { display: block; margin-bottom: 8px; font-size: 11px; color: #7a889a; }
.app-time-wheel-frame { position: relative; border-radius: 10px; background: #f7f9fc; }
.app-time-wheel-frame::before {
  content: "";
  position: absolute;
  top: 84px;
  left: 0;
  right: 0;
  height: 28px;
  border-radius: 8px;
  background: #e5edfb;
  pointer-events: none;
}

.app-time-wheel {
  position: relative;
  box-sizing: border-box;
  height: 196px;
  padding-block: 84px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  border-radius: 10px;
  mask-image: linear-gradient(transparent, #000 25%, #000 75%, transparent);
}
.app-time-wheel::-webkit-scrollbar { display: none; }
.app-time-wheel-frame:focus-within { outline: 2px solid var(--blue, #2563eb); outline-offset: 2px; }
.app-time-wheel:focus { outline: none; }
.app-time-wheel > button {
  display: block;
  box-sizing: border-box;
  width: 100%;
  height: 28px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #77869a;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  line-height: 28px;
  box-shadow: none;
  scroll-snap-align: center;
  cursor: pointer;
}
.app-time-wheel > button.is-selected { color: var(--blue, #2563eb); font-size: 18px; font-weight: 700; }
.app-time-wheel-colon { align-self: end; height: 196px; line-height: 196px; color: #52647b; font-size: 18px; }

@media (max-width: 460px) {
  .app-date-time-picker-popover { grid-template-columns: minmax(0, 1fr) 100px; column-gap: 6px; padding: 8px; }
  .app-date-time-picker-time { padding-left: 6px; }
  .app-date-time-picker-popover > .app-date-picker-days { gap: 1px; }
  .app-date-time-picker-popover .app-date-picker-days > button { padding: 0; font-size: 11px; }
  .app-date-time-picker-popover > header { grid-template-columns: 24px minmax(0, 1fr) 24px; gap: 0; }
  .app-date-time-picker-popover > header > button { width: 24px; padding: 0; }
  .app-date-time-picker-popover > header > .app-date-picker-month-trigger { width: 100%; gap: 2px; padding: 0; }
}

.app-date-picker-popover > footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 8px;
  border-top: 1px solid #e8edf4;
  padding-top: 8px;
}



.app-date-picker-popover > footer button {
  height: 30px;
  border: 1px solid #d2dce8;
  border-radius: 8px;
  background: #ffffff;
  color: #52647b;
  padding: 0 11px;
  font-size: 11px;
  font-weight: 800;
}

.app-date-picker-popover > footer button:last-child {
  border-color: rgba(37, 99, 235, 0.16);
  background: #edf4ff;
  color: var(--blue);
}

.app-date-picker-popover > footer .app-date-time-picker-footer-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.app-date-picker-popover > footer button.app-date-picker-primary-action {
  border-color: #2d6fc8;
  background: linear-gradient(135deg, #3177d4 0%, #245fb2 100%);
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.2);
}

.app-date-picker-popover > footer button.app-date-picker-primary-action:hover,
.app-date-picker-popover > footer button.app-date-picker-primary-action:focus-visible {
  border-color: #1f58a5;
  background: linear-gradient(135deg, #2b6fc9 0%, #1f55a4 100%);
}

.app-date-picker-popover > footer button:hover,
.app-date-picker-popover > footer button:focus-visible {
  border-color: #9bbce5;
  outline: none;
}

.app-date-picker-popover > footer button:disabled {
  border-color: #e2e8f0;
  background: #f8fafc;
  color: #a7b2c1;
  cursor: not-allowed;
}


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

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

.primary-button,
.secondary-button,
.ghost-button,
.add-card-button,
.danger-button,
.danger-row-button,
button.primary,
button.secondary,
.dialog-actions > button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: var(--button-gap);
  height: var(--button-height);
  border: 1px solid transparent;
  border-radius: var(--button-radius);
  padding: 0 var(--button-padding-inline);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .01em;
  line-height: 1;
  white-space: nowrap;
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease, color 140ms ease, opacity 140ms ease, transform 100ms ease;
}

.icon-button {
  display: inline-grid;
  flex: 0 0 var(--button-height);
  width: var(--button-height);
  height: var(--button-height);
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--button-radius);
  background: transparent;
  color: #26354f;
  padding: 0;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
}

.icon-button .menu-svg-icon {
  width: 14px;
  height: 14px;
}

.primary-button,
button.primary {
  background: var(--blue);
  color: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .12), 0 4px 12px rgba(37, 99, 235, .14);
}

.secondary-button,
button.secondary,
.dialog-actions > button:not(.primary-button):not(.primary):not(.danger-button):not(.danger) {
  border-color: #d6dee9;
  background: #ffffff;
  color: #334155;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
}

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

.primary-button.button-small,
.secondary-button.button-small,
.ghost-button.button-small,
.add-card-button.button-small,
.danger-button.button-small,
.danger-row-button.button-small {
  height: var(--button-height-small);
  border-radius: 7px;
  padding-inline: 10px;
  font-size: 12px;
}

.icon-button.button-small,
.refresh-icon-button.button-small {
  flex-basis: var(--button-height-small);
  width: var(--button-height-small);
  height: var(--button-height-small);
}

.primary-button.button-large,
.secondary-button.button-large,
.ghost-button.button-large,
.add-card-button.button-large,
.danger-button.button-large,
.danger-row-button.button-large {
  height: var(--button-height-large);
  padding-inline: 14px;
}

.icon-button.button-large,
.refresh-icon-button.button-large {
  flex-basis: var(--button-height-large);
  width: var(--button-height-large);
  height: var(--button-height-large);
}

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

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

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

.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: 0;
  height: var(--button-height);
  border-radius: var(--button-radius);
  padding-inline: var(--button-padding-inline);
  font-weight: 900;
}

.panel-header .refresh-icon-button,
.panel-header .db-summary > .refresh-icon-button,
.panel-header .stats > .refresh-icon-button {
  flex: 0 0 var(--button-height);
  width: var(--button-height);
  height: var(--button-height);
  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: 0;
  height: var(--button-height);
  padding-inline: var(--button-padding-inline);
}

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

.primary-button:hover,
button.primary:hover {
  background: color-mix(in srgb, var(--blue) 88%, #000000);
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.24);
}

.secondary-button:hover,
button.secondary:hover,
.dialog-actions > button:not(.primary-button):not(.primary):not(.danger-button):not(.danger):hover {
  border-color: #b8c5d6;
  background: #f8fafc;
  color: #0f172a;
}

.ghost-button {
  border-color: transparent;
  background: transparent;
  color: #475569;
  box-shadow: none;
}

.ghost-button:hover {
  border-color: transparent;
  background: #f1f5f9;
  color: var(--text);
}

.dialog-actions > .ghost-button {
  border-color: #d6dee9;
  background: #ffffff;
  color: #334155;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
}

.dialog-actions > .ghost-button:hover {
  border-color: #b8c5d6;
  background: #f8fafc;
  color: #0f172a;
}

.primary-button:active,
.secondary-button:active,
.ghost-button:active,
.add-card-button:active,
button.primary:active,
button.secondary:active,
.dialog-actions > button:active {
  transform: scale(.98);
}

.primary-button:focus-visible,
.secondary-button:focus-visible,
.ghost-button:focus-visible,
.add-card-button:focus-visible,
button.primary:focus-visible,
button.secondary:focus-visible,
.dialog-actions > button:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.22);
  outline-offset: 2px;
}

.primary-button:disabled,
.secondary-button:disabled,
.ghost-button:disabled,
.add-card-button:disabled,
button.primary:disabled,
button.secondary:disabled,
.dialog-actions > button:disabled {
  cursor: not-allowed;
  opacity: .5;
  transform: none;
}

.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;
  /* Keep select labels consistent when feature styles reset the control font. */
  font-size: 13px !important;
  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 option,
select optgroup {
  font-size: 13px;
}

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 .menu-icon-box {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  color: var(--muted);
  opacity: 0.72;
}

.custom-select-trigger .menu-svg-icon {
  width: 12px;
  height: 12px;
}

.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:hover .menu-icon-box,
.custom-select.is-open .custom-select-trigger .menu-icon-box {
  color: var(--blue);
  opacity: 0.8;
}

.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.open-up .custom-select-menu {
  top: auto;
  bottom: calc(100% + 6px);
}

.custom-select-group {
  display: grid;
  grid-auto-rows: max-content;
  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: flex-start;
  gap: 8px;
  height: var(--select-option-height, 42px);
  min-height: 0;
  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 {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  font-size: inherit;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.app-inline-picklist {
  position: relative;
  width: 100%;
  min-width: 0;
}

.app-inline-picklist-trigger {
  display: grid;
  width: 100%;
  min-width: 0;
  height: 24px;
  grid-template-columns: minmax(0, 1fr) 18px;
  align-items: center;
  gap: 4px;
  border: 1px solid #c8d5e5;
  border-radius: 5px;
  background: #ffffff;
  color: var(--text);
  padding: 0 5px 0 8px;
  text-align: left;
}

.app-inline-picklist-trigger:focus-visible,
.app-inline-picklist.is-open .app-inline-picklist-trigger {
  border-color: var(--blue);
  background: #ffffff;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
  outline: none;
}

.app-inline-picklist-trigger:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.app-inline-picklist-trigger > span {
  overflow: hidden;
  min-width: 0;
  color: inherit;
  font-size: 13px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-inline-picklist-trigger > .menu-svg-icon {
  width: 11px;
  height: 11px;
  justify-self: center;
  color: var(--muted);
}

.app-inline-picklist-options {
  position: fixed;
  z-index: 5500;
  display: grid;
  grid-auto-rows: max-content;
  gap: 2px;
  max-height: min(240px, calc(100vh - 16px));
  overflow-y: auto;
  border: 1px solid rgba(191, 203, 219, 0.96);
  border-radius: 7px;
  background: #ffffff;
  padding: 4px;
  box-shadow: 0 14px 28px rgba(31, 45, 68, 0.14);
}

.app-inline-picklist-options > button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  height: var(--select-option-height, 24px);
  min-height: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  padding: 0 8px;
  text-align: left;
}

.app-inline-picklist-options > button:hover,
.app-inline-picklist-options > button.is-active,
.app-inline-picklist-options > button.is-selected {
  border-color: rgba(37, 99, 235, 0.18);
  background: #f5f8ff;
}

.app-inline-picklist-options > button:focus-visible {
  border-color: var(--blue);
  outline: none;
}

.app-inline-picklist-options > button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.app-inline-picklist-options > button span {
  flex: 1 1 auto;
  overflow: hidden;
  min-width: 0;
  font-size: 13px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-inline-picklist-options > button i {
  flex: 0 0 12px;
  color: var(--blue);
  font-size: 10px;
  font-style: normal;
  font-weight: 850;
  text-align: center;
}

.search {
  min-width: 0;
}

.view-switch {
  display: grid;
  grid-auto-columns: max-content;
  grid-auto-flow: column;
  align-items: center;
  width: fit-content;
  min-height: 0;
  height: var(--button-height);
  padding: 0;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #f8fbff;
}

.view-switch button {
  min-width: 64px;
  min-height: 0;
  height: var(--button-height);
  white-space: nowrap;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #31557f;
  padding: 0 11px;
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
}

.view-switch button.active {
  background: var(--blue);
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.18);
}

@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);
}
