.crm-list-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.crm-search-wrap {
  position: relative;
  flex: 1;
  min-width: min(460px, 100%);
}

.crm-search-hint {
  margin-top: 7px;
  color: var(--muted);
  font-size: .82rem;
}

.crm-suggestions {
  position: absolute;
  z-index: 30;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.crm-suggestion {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 12px 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  background: transparent;
  text-align: left;
}

.crm-suggestion:hover {
  background: var(--panel-2);
}

.crm-suggestion:last-child {
  border-bottom: 0;
}

.crm-suggestion small {
  color: var(--muted);
}

.crm-action-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.crm-table-actions {
  min-width: 210px;
}

.crm-mini-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: var(--panel);
  font-size: .82rem;
}

.crm-mini-btn:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.crm-mini-btn.danger {
  color: var(--danger);
}

.crm-empty {
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: 18px;
  color: var(--muted);
  background: var(--panel-2);
  text-align: center;
}

.crm-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  justify-content: end;
  background: rgba(3, 7, 18, .45);
  backdrop-filter: blur(4px);
}

.crm-drawer {
  width: min(620px, 100vw);
  height: 100vh;
  overflow-y: auto;
  padding: 22px;
  border-left: 1px solid var(--line);
  background: var(--panel);
  box-shadow: -18px 0 50px rgba(0,0,0,.22);
}

.crm-drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.crm-drawer-head h3 {
  margin: 0 0 4px;
  font-size: 1.55rem;
}

.crm-drawer-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.crm-close {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: var(--panel-2);
  font-size: 1.3rem;
}

.crm-detail-grid {
  display: grid;
  gap: 12px;
}

.crm-detail-item {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel-2);
}

.crm-detail-item span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.crm-field-help {
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.35;
}

.crm-required {
  color: var(--danger);
  font-weight: 800;
}

.crm-form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.crm-confirm-box {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--danger) 50%, var(--line));
  border-radius: 18px;
  background: color-mix(in srgb, var(--danger) 7%, var(--panel));
}

@media (max-width: 720px) {
  .crm-list-toolbar {
    flex-direction: column;
  }

  .crm-list-toolbar .btn {
    width: 100%;
  }

  .crm-drawer-backdrop {
    justify-content: stretch;
  }

  .crm-drawer {
    width: 100vw;
    border-left: 0;
    padding: 18px 14px 94px;
  }

  .crm-action-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .crm-mini-btn {
    width: 100%;
  }

  .crm-table-actions {
    min-width: 0;
  }
}
