/* ==========================================================================
   CUSTOM OBJECT LIST  (Events, Leads, Tickets; HUB-264)
   Class names follow the design's events.php markup (evl-*, ev-*, evs-*, evc-*), so
   the design's events.css / view-settings.css can replace this file when they are
   handed over. Colours, radii and spacing come from base.css tokens (both themes).
   ========================================================================== */

/* ---------------------------------------------------------------- page */
.evl {
  display: flex;
  align-items: stretch;
  min-height: calc(100vh - var(--header-h, 64px) - 64px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.evl--loading {
  align-items: center;
  justify-content: center;
}
.evl-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: var(--sp-4) var(--sp-5) var(--sp-3);
}
.evl-spacer {
  flex: 1;
}

/* ---------------------------------------------------------------- shared bits */
.ev-dd {
  position: relative;
  display: inline-flex;
}
.ev-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 200px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
.ev-menu--right {
  left: auto;
  right: 0;
}
.ev-menu__item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  font-size: 13px;
  line-height: 1.3;
  text-align: left;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  background: none;
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.ev-menu__item:hover,
.ev-menu__item:focus-visible {
  background: var(--surface-hover);
  outline: none;
}
.ev-menu__item[aria-checked='true'],
.ev-menu__item.is-current {
  color: var(--brand);
  font-weight: 600;
  background: var(--brand-soft);
}
.ev-menu__item.is-disabled {
  color: var(--text-subtle);
  cursor: not-allowed;
}
.ev-menu__item.is-disabled:hover {
  background: none;
}
.ev-menu__item--link {
  color: var(--brand);
  font-weight: 600;
}
.ev-menu__rule {
  height: 1px;
  margin: 4px 0;
  background: var(--border);
}
.ev-menu__scroll {
  display: flex;
  flex-direction: column;
  max-height: 280px;
  overflow-y: auto;
  margin-top: 6px;
}
.ev-pop--form {
  gap: 10px;
  min-width: 270px;
  padding: 12px;
}
.ev-pop__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.ev-label {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}
.ev-help {
  margin: 0 0 var(--sp-3);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-muted);
}
.ev-help--danger {
  color: var(--danger);
}
.ev-help-inline {
  margin-left: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.ev-search {
  position: relative;
  display: flex;
  align-items: center;
}
.ev-search .input {
  height: 34px;
  padding: 0 32px 0 12px;
  font-size: 13px;
}
.ev-search > .icon {
  position: absolute;
  right: 10px;
  color: var(--text-muted);
  pointer-events: none;
}

.ev-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  cursor: pointer;
}
.ev-pill:hover {
  background: var(--surface-hover);
}
.ev-pill.is-on,
.ev-pill.is-open {
  color: var(--brand);
  background: var(--brand-soft);
  border-color: var(--brand);
}
.ev-pill[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}
.ev-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 11px;
  font-weight: 700;
  color: var(--brand-contrast);
  background: var(--brand);
  border-radius: 9px;
}

.ev-iconbtn {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.ev-iconbtn:hover {
  color: var(--text);
  background: var(--surface-hover);
}
.ev-iconbtn--round {
  background: var(--surface);
  border-color: var(--border-strong);
  border-radius: 50%;
}
.ev-iconbtn--xs {
  width: 22px;
  height: 22px;
}
.ev-iconbtn.is-on,
.ev-iconbtn.is-open {
  color: var(--brand);
  background: var(--brand-soft);
  border-color: var(--brand);
}
.ev-iconbtn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.ev-link {
  padding: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand);
  background: none;
  border: 0;
  cursor: pointer;
}
.ev-link:hover {
  text-decoration: underline;
}
.ev-link[disabled] {
  color: var(--text-subtle);
  text-decoration: none;
  cursor: default;
}

.ev-seg {
  display: inline-flex;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
}
.ev-seg button {
  flex: 1;
  padding: 6px 10px;
  font-size: 12.5px;
  color: var(--text);
  background: var(--surface);
  border: 0;
  cursor: pointer;
}
.ev-seg button + button {
  border-left: 1px solid var(--border-strong);
}
.ev-seg button[aria-pressed='true'] {
  font-weight: 600;
  color: var(--brand);
  background: var(--brand-soft);
}

.ev-check,
.ev-radio {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}
.ev-check input,
.ev-radio input,
.evl-table input[type='checkbox'] {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--brand);
}
.ev-radio.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.ev-checks {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2px 12px;
}
.ev-fieldset {
  margin: var(--sp-3) 0 0;
  padding: 0;
  border: 0;
}
.ev-filter-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ev-filter-stack .input,
.ev-advgrid .input {
  height: 36px;
  font-size: 13px;
}
.ev-range {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
}
.ev-range .input {
  flex: 1;
  min-width: 0;
}
.ev-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
}

.btn-crm--danger {
  color: #fff;
  background: var(--danger);
  border-color: var(--danger);
}
.btn-crm--danger:hover {
  background: var(--danger);
  filter: brightness(0.94);
}

/* ---------------------------------------------------------------- header */
.evl-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-3);
}
.evl-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 4px;
  margin-left: -4px;
  color: var(--text);
  background: none;
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.evl-title:hover {
  background: var(--surface-hover);
}
.evl-title h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
}
.evl-objects {
  width: 250px;
  gap: 6px;
}
.evl-objects__list {
  display: flex;
  flex-direction: column;
  max-height: 320px;
  overflow-y: auto;
}
.evl-head__actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.evl-add {
  --btn-h: 32px;
  padding: 0 14px;
  font-size: 13px;
  border-radius: var(--radius-pill);
}

/* ---------------------------------------------------------------- view tabs */
.evl-views {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  margin-bottom: var(--sp-3);
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
}
.evl-view {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 220px;
  margin-bottom: -1px;
  padding: 7px 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  background: none;
  border: 1px solid transparent;
  border-bottom: 2px solid transparent;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  cursor: pointer;
}
.evl-view span {
  overflow: hidden;
  text-overflow: ellipsis;
}
.evl-view:hover {
  color: var(--text);
}
.evl-view.is-active {
  color: var(--text);
  background: var(--surface-2);
  border-color: var(--border);
  border-bottom: 2px solid var(--brand);
}
.evl-views__add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin: 0 0 5px 6px;
  color: var(--text-muted);
  background: none;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  cursor: pointer;
}
.evl-views__add:hover {
  color: var(--brand);
  border-color: var(--brand);
}

/* ---------------------------------------------------------------- toolbar + quick filters */
.evl-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-2);
}
.evl-search {
  width: 220px;
}
.evl-dirty {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: 4px;
}
.evl-dirty .btn-crm {
  --btn-h: 28px;
  padding: 0 10px;
  font-size: 12.5px;
}
.evl-quick {
  margin-bottom: var(--sp-2);
}
.evl-quick__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 14px;
  min-height: 28px;
}
.evl-qf {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.evl-qf__btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 320px;
  padding: 3px 2px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  background: none;
  border: 0;
  cursor: pointer;
}
.evl-qf__btn:hover,
.evl-qf__btn.is-open,
.evl-qf.is-set .evl-qf__btn {
  color: var(--brand);
}
.evl-qf__value {
  overflow: hidden;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.evl-qf__pop .ev-checks {
  grid-template-columns: 1fr;
  max-height: 240px;
  overflow-y: auto;
}
.evl-qf__remove {
  display: inline-flex;
  padding: 2px;
  color: var(--text-muted);
  background: none;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
}
.evl-qf__remove:hover {
  color: var(--danger);
}
.evl-qf__add {
  width: 260px;
}
.evl-qf__adv {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 2px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  background: none;
  border: 0;
  cursor: pointer;
}
.evl-qf__adv:hover {
  color: var(--brand);
}

/* ---------------------------------------------------------------- bulk bar */
.evl-bulk {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-4);
  margin-bottom: var(--sp-2);
  padding: 7px 12px;
  font-size: 12.5px;
  font-weight: 600;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.ev-bulkbtn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--brand);
  background: none;
  border: 0;
  cursor: pointer;
}
.ev-bulkbtn:hover {
  text-decoration: underline;
}
.ev-bulkbtn--danger {
  color: var(--danger);
}
.ev-bulkbtn[disabled] {
  color: var(--text-subtle);
  cursor: not-allowed;
}

/* ---------------------------------------------------------------- table */
.evl-body {
  position: relative;
  display: flex;
  flex: 1;
  min-height: 360px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.evl-body__loading {
  margin: auto;
}
.evl-tablewrap {
  flex: 1;
  min-width: 0;
  max-height: calc(100vh - 320px);
  overflow: auto;
  transition: opacity var(--fast) var(--ease);
}
.evl-tablewrap.is-loading {
  opacity: 0.6;
}
.evl-rail {
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 6px 4px;
  border-left: 1px solid var(--border);
}
.evl-table {
  width: max-content;
  min-width: 100%;
  font-size: 12.5px;
  border-spacing: 0;
  border-collapse: separate;
}
.evl-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 8px 12px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text);
  text-align: left;
  white-space: nowrap;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.evl-table td {
  max-width: 320px;
  padding: 7px 12px;
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.evl-table--compact td {
  padding-top: 4px;
  padding-bottom: 4px;
}
.evl-table--comfortable td {
  padding-top: 12px;
  padding-bottom: 12px;
}
.evl-table td.evl-table__name {
  position: relative;
}
.evl-table tbody tr:hover td {
  background: var(--surface-hover);
}
.evl-table tbody tr.is-selected td {
  background: var(--brand-soft);
}
.evl-table .is-num {
  font-variant-numeric: tabular-nums;
}
.evl-table__check {
  width: 36px;
  padding-right: 4px !important;
}
.evl-table.is-pinned .evl-table__check {
  position: sticky;
  left: 0;
  z-index: 1;
}
.evl-table.is-pinned td.evl-table__name,
.evl-table.is-pinned th.evl-table__name {
  position: sticky;
  left: 36px;
  z-index: 1;
  box-shadow: inset -1px 0 0 var(--border);
}
.evl-table.is-pinned th.evl-table__check,
.evl-table.is-pinned th.evl-table__name {
  z-index: 3;
}
.evl-th {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}
.evl-th:hover {
  color: var(--brand);
}
.evl-name {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 230px;
}
.evl-name__toggle {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  color: var(--text-muted);
  background: none;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
}
.evl-name__toggle:hover {
  color: var(--text);
  background: var(--surface-hover);
}
.evl-name__link {
  max-width: 300px;
  overflow: hidden;
  padding: 0;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--brand);
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: none;
  border: 0;
  cursor: pointer;
}
.evl-name__link:hover {
  text-decoration: underline;
}
.evl-name__tools {
  position: absolute;
  top: 50%;
  right: 8px;
  display: inline-flex;
  gap: 4px;
  padding-left: 6px;
  background: inherit;
  opacity: 0;
  transform: translateY(-50%);
  transition: opacity var(--fast) var(--ease);
}
.evl-name__tools .ev-iconbtn {
  background: var(--surface);
}
.evl-table tr:hover .evl-name__tools,
.evl-name:focus-within .evl-name__tools {
  opacity: 1;
}
.evl-table__expand td {
  max-width: none;
  padding: 12px 16px;
  white-space: normal;
  background: var(--surface-2) !important;
}

/* expanded row: linked records */
.evl-assoc {
  position: sticky;
  left: 52px;
  max-width: min(900px, calc(100vw - 420px));
}
.evl-assoc__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.evl-assoc__label {
  font-size: 12px;
  font-weight: 600;
}
.evl-assoc__type {
  width: auto;
  height: 30px;
  padding: 0 28px 0 10px;
  font-size: 12.5px;
}
.evl-assoc__search {
  width: 200px;
}
.evl-assoc__search .input {
  height: 30px;
}
.evl-assoc__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 260px));
  gap: 10px 24px;
  margin: 0 0 8px;
  padding: 0;
  list-style: none;
}
.evl-assoc__name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--brand);
  text-decoration: none;
}
.evl-assoc__name:hover {
  text-decoration: underline;
}
.evl-assoc__sub {
  display: block;
  font-size: 11.5px;
  color: var(--text-muted);
}

/* empty */
.evl-empty {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 48px 16px;
  color: var(--text-muted);
  text-align: center;
}
.evl-empty h2 {
  margin: 4px 0 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}
.evl-empty p {
  margin: 0 0 6px;
  font-size: 13px;
}

/* ---------------------------------------------------------------- pager + footer */
.evl-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 0 6px;
  font-size: 12.5px;
}
.evl-pager .ev-menu {
  top: auto;
  bottom: calc(100% + 4px);
}
.evl-pager__step,
.evl-pager__size {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 0 4px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--brand);
  background: none;
  border: 0;
  cursor: pointer;
}
.evl-pager__size {
  margin-left: var(--sp-4);
  color: var(--text);
}
.evl-pager__step[disabled] {
  color: var(--text-subtle);
  cursor: default;
}
.evl-pager__num {
  min-width: 26px;
  height: 26px;
  padding: 0 6px;
  font-size: 12.5px;
  color: var(--text);
  background: none;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
}
.evl-pager__num:hover {
  background: var(--surface-hover);
}
.evl-pager__num.is-current {
  font-weight: 600;
  border-color: var(--border-strong);
}
.evl-pager__num[disabled]:not(.is-current) {
  color: var(--text-subtle);
  cursor: default;
}
.evl-foot {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-top: var(--sp-2);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--border);
}
.evl-count {
  padding: 3px 10px;
  font-size: 11.5px;
  font-weight: 600;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
}
.ev-split {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
}
.ev-split button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 28px;
  color: var(--text-muted);
  background: var(--surface);
  border: 0;
  cursor: pointer;
}
.ev-split button + button {
  border-left: 1px solid var(--border-strong);
}
.ev-split button:hover {
  color: var(--text);
  background: var(--surface-hover);
}
.ev-split button[disabled] {
  opacity: 0.45;
  cursor: default;
}

/* ---------------------------------------------------------------- board */
.evl-board {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  padding: 10px;
  overflow-x: auto;
  transition: opacity var(--fast) var(--ease);
}
.evl-board.is-loading {
  opacity: 0.7;
}
.evl-board__loading {
  margin: auto;
}
.evl-board__cols {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.evl-board__more {
  align-self: flex-start;
}
.evl-col {
  display: flex;
  flex: 0 0 240px;
  flex-direction: column;
  width: 240px;
  max-height: calc(100vh - 300px);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition:
    border-color var(--fast) var(--ease),
    box-shadow var(--fast) var(--ease);
}
.evl-col.is-drop {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px var(--brand-soft);
}
.evl-col__head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 600;
}
.evl-col__title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.evl-col__count {
  font-weight: 500;
  color: var(--text-muted);
}
.evl-col__cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 60px;
  padding: 0 8px 8px;
  overflow-y: auto;
}
.evl-col__empty,
.evl-col__more {
  margin: 0;
  padding: 6px;
  font-size: 11.5px;
  color: var(--text-muted);
  text-align: center;
}
.evl-card {
  padding: 8px 10px;
  font-size: 11.5px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  cursor: grab;
}
.evl-card:active {
  cursor: grabbing;
}
.evl-card.is-moving {
  opacity: 0.5;
}
.evl-card__name {
  padding: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--brand);
  text-align: left;
  background: none;
  border: 0;
  cursor: pointer;
}
.evl-card__name:hover {
  text-decoration: underline;
}
.evl-card__meta {
  display: grid;
  gap: 2px;
  margin: 6px 0 0;
}
.evl-card__meta div {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}
.evl-card__meta dd {
  margin: 0;
}

/* The ticket design's card: a bigger name, then the priority chip and the owner's initials. */
.evl-card--rich {
  padding: 12px 14px;
}
.evl-card--rich .evl-card__name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
}
.evl-card__row {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 11px;
  min-width: 0;
}
.evl-chip {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 5px 11px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  border-radius: 20px;
}
.evl-chip--high {
  color: var(--danger);
  background: var(--danger-bg);
}
.evl-chip--medium {
  color: var(--warning);
  background: var(--warning-bg);
}
.evl-chip--low {
  color: var(--text-muted);
  background: var(--surface-3);
}
.evl-card__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  color: var(--brand);
  background: var(--surface-3);
  border-radius: 50%;
}
.evl-card__avatar.is-none {
  color: var(--text-subtle);
}
.evl-card__tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  margin-top: 6px;
}
.evl-card__move {
  max-width: 110px;
  height: 22px;
  min-width: 0;
  margin-right: auto;
  padding: 0 4px;
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  opacity: 0;
  transition: opacity var(--fast) var(--ease);
}
.evl-card:hover .evl-card__move,
.evl-card:focus-within .evl-card__move {
  opacity: 1;
}
@media (hover: none) {
  .evl-card__move {
    opacity: 1;
  }
}

/* ---------------------------------------------------------------- view settings panel */
.evs {
  flex: none;
  width: 300px;
  padding: var(--sp-4);
  overflow-y: auto;
  border-left: 1px solid var(--border);
}
.evs__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-2);
}
.evs__head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}
.evs__sec {
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--border);
}
.evs__sec:last-child {
  border-bottom: 0;
}
.evs__label {
  display: block;
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 600;
}
.evs .input {
  height: 34px;
  font-size: 13px;
}
.evs .field {
  margin-bottom: var(--sp-3);
}
.evs .ev-help {
  margin: 6px 0 0;
  font-size: 11.5px;
}
.evs__types {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}
.evs__type {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  cursor: pointer;
}
.evs__type:hover:not([disabled]) {
  color: var(--text);
}
.evs__type.is-on {
  color: var(--brand);
  background: var(--brand-soft);
  border-color: var(--brand);
}
.evs__type[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}
.evs__row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 4px;
  font-size: 12.5px;
  color: var(--text);
  text-align: left;
  background: none;
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.evs__row > span:not(.evs__value) {
  flex: 1;
}
.evs__row:hover:not([disabled]) {
  background: var(--surface-hover);
}
.evs__row[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}
.evs__row--danger {
  color: var(--danger);
}
.evs__row--check input {
  accent-color: var(--brand);
}
.evs__value {
  max-width: 120px;
  overflow: hidden;
  font-size: 11.5px;
  color: var(--text-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.evs__kbd {
  padding: 1px 5px;
  font-family: inherit;
  font-size: 10.5px;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 4px;
}
.evs__back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: var(--sp-3);
  padding: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  background: none;
  border: 0;
  cursor: pointer;
}
.evs__choices {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.evs .ev-seg {
  margin-bottom: var(--sp-3);
}

/* ---------------------------------------------------------------- dialogs and drawers */
/* Drawers here list their buttons in the order the design shows them. */
#evAdvModal form .modal__footer,
#evCreateModal form .modal__footer {
  flex-direction: row;
  justify-content: flex-start;
}
.ev-dialog .modal__footer,
#evFormModal .modal__footer,
#evViewDeleteModal .modal__footer {
  justify-content: flex-end;
  border-top: 1px solid var(--border);
}
.ev-advgrid {
  display: grid;
  gap: var(--sp-4);
}
.ev-advgrid .field {
  margin: 0;
}
.ev-adv-search {
  margin-bottom: var(--sp-4);
}

/* choose columns */
#evFormModal .modal {
  width: 100%;
  max-width: 760px;
}
.evc-form {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.evc {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--sp-4);
}
.evc__col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}
.evc__col--sel {
  padding-left: var(--sp-4);
  border-left: 1px solid var(--border);
}
.evc__list,
.evc__order {
  max-height: 360px;
  overflow-y: auto;
}
.evc__head {
  margin: 6px 0;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.evc__order {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.evc__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  font-size: 12.5px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.evc__name {
  flex: 1;
  min-width: 0;
}
.evc__locked {
  font-size: 11px;
  color: var(--text-muted);
}
.evc__tools {
  display: inline-flex;
  gap: 2px;
}
.evc__tools button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  color: var(--text-muted);
  background: none;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
}
.evc__tools button:hover:not([disabled]) {
  color: var(--text);
  background: var(--surface-hover);
}
.evc__tools button[disabled] {
  opacity: 0.35;
  cursor: default;
}
.evc__note {
  margin: 4px 0 0;
}
.evc__reset {
  margin-right: auto;
}

/* preview */
.ev-preview__name {
  margin: 0 0 var(--sp-3);
  font-size: 18px;
  font-weight: 600;
}
.ev-preview__meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
  margin: 0;
}
.ev-preview__meta dt {
  font-size: 11.5px;
  color: var(--text-muted);
}
.ev-preview__meta dd {
  margin: 2px 0 0;
  font-size: 13.5px;
}
.ev-preview__meta .input {
  height: 34px;
  font-size: 13px;
}
.ev-preview__links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: var(--sp-4) 0 0;
}
.ev-preview__props {
  margin-top: var(--sp-4);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--border);
}
.ev-preview__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: 8px;
}
.ev-preview__bar h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}
.ev-preview__bar .ev-search {
  width: 200px;
}
.ev-props {
  display: flex;
  flex-direction: column;
  margin: 0;
}
.ev-props__row {
  display: grid;
  grid-template-columns: 42% minmax(0, 1fr);
  gap: var(--sp-3);
  padding: 8px 0;
  font-size: 13px;
  border-bottom: 1px dashed var(--border);
}
.ev-props__row dt {
  color: var(--text-muted);
}
.ev-props__row dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.ev-props__row.is-editing {
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
}
.ev-props .input {
  height: 38px;
  font-size: 13.5px;
}

/* create */
/* QA BUG-01, EV16: a field's error line makes its cell taller. Stretched cells hand that height to
   the label and input rows of the field beside it (.field is a grid), so its box dropped out of
   line. Keep each cell's own height, top-aligned. */
.ev-create__grid {
  align-items: start;
}
.ev-create__more {
  margin-top: var(--sp-3);
}
.ev-create__assoc {
  display: grid;
  gap: var(--sp-3);
  margin-top: var(--sp-5);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--border);
}
.ev-create__heading {
  margin: 0;
  font-size: 13.5px;
  font-weight: 600;
}
/* EV12: the Events create panel's sizes (create-form.css: .cf__head, .cf__body, .cf-field,
   .cf-input, .cf__foot, .cf-req, .cf-assoc). Only the Events drawer has .ev-create--design. */
.modal.ev-create--design .modal__header {
  padding: 18px 24px;
}
.modal.ev-create--design .modal__title {
  font-size: 21px;
  font-weight: 700;
}
.modal.ev-create--design .modal__body {
  padding: 8px 24px 24px;
}
.modal.ev-create--design .form-grid {
  gap: 18px;
}
.modal.ev-create--design input.input,
.modal.ev-create--design select.input {
  height: 40px;
  font-size: 14px;
}
.modal.ev-create--design .modal__footer {
  gap: 10px;
}
.modal.ev-create--design .cf-req {
  margin-left: 2px;
}
.modal.ev-create--design .ev-create__heading--design {
  font-size: 17px;
  font-weight: 700;
}
.modal.ev-create--design .cf-assoc__obj {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 700;
}

/* restore */
.ev-restore {
  max-height: 360px;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.ev-restore li {
  padding: 6px 12px;
  border-bottom: 1px solid var(--border);
}
.ev-restore li:last-child {
  border-bottom: 0;
}
.ev-restore__name {
  font-weight: 600;
}

/* export */
.vs-x__sec {
  margin-bottom: var(--sp-4);
}
.vs-x__sec h3 {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 600;
}
.vs-x__summary {
  margin: 0 0 var(--sp-3);
  font-size: 13px;
}
.vs-x__h4 {
  margin: var(--sp-3) 0 6px;
  font-size: 12.5px;
  font-weight: 600;
}
.vs-x__list {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
}
.vs-x__more summary {
  margin: 8px 0;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

/* ---------------------------------------------------------------- small screens */
@media (max-width: 991.98px) {
  .evl {
    flex-direction: column;
  }
  .evs {
    width: auto;
    border-top: 1px solid var(--border);
    border-left: 0;
  }
  .evl-main {
    padding: var(--sp-3);
  }
  .evl-search {
    width: 100%;
  }
  .evl-tablewrap {
    max-height: none;
  }
  .evc {
    grid-template-columns: minmax(0, 1fr);
  }
  .evc__col--sel {
    padding-left: 0;
    border-left: 0;
  }
  .ev-checks {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .evl-assoc__grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* QA #635 (HUB-649): "Add timeline activity from …" under a contact / company of Create Ticket;
   disabled until a record is picked. */
.ev-create__timeline .check.is-disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
.ev-create__timeline .check.is-disabled input {
  cursor: not-allowed;
}

/* QA #635 (HUB-649): a ticket's Contact / Company card (ticket-board.php "Associate Ticket with":
   crm-border crm-p-2 crm-rounded-sm crm-bg-surface-2) and the design's info tip (.tka-i). */
.ev-create__assoc-card {
  display: grid;
  gap: var(--sp-3);
  background: var(--surface-2);
}
.ev-create__tip {
  vertical-align: -3px;
  cursor: help;
}
